@kvaser/canking-api
Version:
CanKing API to communicate with the CanKing service using Node.js.
320 lines (319 loc) • 15.6 kB
TypeScript
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import Long from "long";
import { ApiPreferences } from "./common_params";
import { ScheduleTable, SignalValue, WriteFrame } from "./frame_params";
import { CanChannelConfiguration, DataProcessorNodeProperties, LinChannelConfiguration, LogFileFormat, MeasurementSetup, PeriodicTransmissionSettings, SourceNodeProperties, TargetNodeProperties } from "./measurement_settings";
/** Possible events. */
export declare enum MeasurementEvent {
MEASUREMENT_EVENT_UNSPECIFIED = 0,
/** MEASUREMENT_EVENT_MEASUREMENT_SETUP_CHANGED - Raised when the measurement setup has changed, will pass the new MeasurementSetup as event data */
MEASUREMENT_EVENT_MEASUREMENT_SETUP_CHANGED = 1,
/** MEASUREMENT_EVENT_ONLINE_STATUS_CHANGED - Raised when the online status has changed, will pass the new OnlineStatus as event data */
MEASUREMENT_EVENT_ONLINE_STATUS_CHANGED = 2,
/** MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STARTED - Raised when a periodic transmission has started, will pass the transmission's identifier as event data */
MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STARTED = 3,
/** MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STOPPED - Raised when a periodic transmission has stopped, will pass the transmission's identifier as event data */
MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STOPPED = 4,
UNRECOGNIZED = -1
}
export declare function measurementEventFromJSON(object: any): MeasurementEvent;
export declare function measurementEventToJSON(object: MeasurementEvent): string;
/** A request message for setting a new measurement setup. */
export interface SetMeasurementSetupRequest {
preferences: ApiPreferences | undefined;
setup: MeasurementSetup | undefined;
}
/** A request message for adding all connected CAN channels. */
export interface AddAllConnectedCanChannelsRequest {
preferences: ApiPreferences | undefined;
configuration: CanChannelConfiguration | undefined;
}
/** A request message for adding all connected LIN channels. */
export interface AddAllConnectedLinChannelsRequest {
preferences: ApiPreferences | undefined;
configuration: LinChannelConfiguration | undefined;
}
/** A request message for adding or updating a source node. */
export interface AddOrUpdateSourceRequest {
preferences: ApiPreferences | undefined;
source: SourceNodeProperties | undefined;
/**
* If true then all properties will be replaced with values from source.
* If false then only properties with values in source will be updated.
* This field is ignored when adding a new node.
*/
replaceAllProperties: boolean;
}
/** A response message for getting a source node. */
export interface GetSourceResponse {
source: SourceNodeProperties | undefined;
}
/** A request message for adding or updating a data processor node. */
export interface AddOrUpdateDataProcessorRequest {
preferences: ApiPreferences | undefined;
dataProcessor: DataProcessorNodeProperties | undefined;
/** If adding a new data processor after another node then set previous_node to the id of the preceding node */
previousNode: string;
/** If adding a new data processor before another node then set next_node to the id of the subsequent node */
nextNode: string;
/**
* If true then all properties will be replaced with values from data_processor.
* If false then only properties with values in data_processor will be updated.
* This field is ignored when adding a new node.
*/
replaceAllProperties: boolean;
}
/** A response message for getting a data processor node. */
export interface GetDataProcessorResponse {
dataProcessor: DataProcessorNodeProperties | undefined;
}
/** A request message for adding or updating a target node. */
export interface AddOrUpdateTargetRequest {
preferences: ApiPreferences | undefined;
target: TargetNodeProperties | undefined;
/**
* If true then all properties will be replaced with values from target.
* If false then only properties with values in target will be updated.
* This field is ignored when adding a new node.
*/
replaceAllProperties: boolean;
}
/** A response message for getting a target node. */
export interface GetTargetResponse {
target: TargetNodeProperties | undefined;
}
/** A request message for connecting two nodes. */
export interface ConnectNodesRequest {
preferences: ApiPreferences | undefined;
startNode: string;
endNode: string;
}
/** A request message for disconnecting two nodes. */
export interface DisconnectNodesRequest {
preferences: ApiPreferences | undefined;
startNode: string;
endNode: string;
}
/**
* A request message for any service method that needs to know one identifier of a node
* in the measurement setup.
*/
export interface IdentifierRequest {
preferences: ApiPreferences | undefined;
identifier: string;
}
/**
* A request message for any service method that needs to know identifiers of a nodes
* in the measurement setup.
*/
export interface IdentifiersRequest {
preferences: ApiPreferences | undefined;
identifiers: string[];
}
/** A request message for sending out one message frame. */
export interface SendMessageRequest {
preferences: ApiPreferences | undefined;
channelIdentifier: string;
frame: WriteFrame | undefined;
}
/** A request message for sending out one LIN wakeup frame. */
export interface SendLinWakeupFrameRequest {
preferences: ApiPreferences | undefined;
/** Identifier of the LIN channel to send the wakeup frame on. */
channelIdentifier: string;
/** The number of wakeup frames to send. Maximum value of count is 255 (0xFF). */
count: number;
/** The time, in bit times, between the wakeup frames. Maximum value of interval is either 255 (0xFF) or 65535 (0xFFFF) depending on device. */
interval: number;
}
/** A request message for writing a LIN message header to the LIN bus. */
export interface RequestLinMessageRequest {
preferences: ApiPreferences | undefined;
/** Identifier of the LIN channel to clear the message buffer on. */
channelIdentifier: string;
/** The LIN message id to write to the LIN bus. */
frameId: number;
}
/**
* A request message for updating a message buffer in a slave. The contents of the message buffer will be used the next time the slave
* is polled for the specified LIN message id.
*/
export interface UpdateLinMessageRequest {
preferences: ApiPreferences | undefined;
/** Identifier of the LIN channel to update the message buffer on. */
channelIdentifier: string;
/** The new LIN message. */
frame: WriteFrame | undefined;
}
/** A request message for clearing a message buffer for a LIN slave. The slave will not answer next time it is polled. */
export interface ClearLinMessageRequest {
preferences: ApiPreferences | undefined;
/** Identifier of the LIN channel to clear the message buffer on. */
channelIdentifier: string;
/** The LIN message id for which the corresponding buffer will be cleared. */
frameId: number;
}
/** A request message for start sending out message frames periodically. */
export interface StartPeriodicTransmissionRequest {
preferences: ApiPreferences | undefined;
/** Periodic transmission settings */
settings: PeriodicTransmissionSettings | undefined;
}
/** A request message for updating the settings of a periodic transmission. */
export interface UpdatePeriodicTransmissionRequest {
preferences: ApiPreferences | undefined;
/** Periodic transmission settings */
settings: PeriodicTransmissionSettings | undefined;
/** Identifier of periodic transmission */
identifier: string;
}
/** A response message for start sending out message frames periodically. */
export interface StartPeriodicTransmissionResponse {
periodicTransmissionIdentifier: string;
}
/** A message for streaming online status information. */
export interface OnlineStatus {
isOnline: boolean;
}
/** Event arguments */
export interface MeasurementEventArgs {
eventType: MeasurementEvent;
identifier?: string | undefined;
measurementSetup?: MeasurementSetup | undefined;
onlineStatus?: OnlineStatus | undefined;
}
/** A request message to get supported log file formats. */
export interface GetLogFileFormatsRequest {
preferences: ApiPreferences | undefined;
/** Set to true to include message log formats. */
messageLog: boolean;
/** Set to true to include signal value log formats. */
signalLog: boolean;
/** Set to true to only include formats with read support. */
readSupport: boolean;
}
/** A response message for GetLogFileFormats request. */
export interface GetLogFileFormatsResponse {
/** All supported formats. */
formats: LogFileFormat[];
/** Name of each supported format. */
names: string[];
/** File extensions for each supported format. */
extensions: string[];
/** Description of each supported format. */
descriptions: string[];
}
/** A request message to get all channels listed in a log file. */
export interface GetChannelsFromLogFileRequest {
preferences: ApiPreferences | undefined;
/** Log file to retrieve channels from. */
logFile: string;
}
/** A response message for GetChannelsFromLogFile request. */
export interface GetChannelsFromLogFileResponse {
/** Channels listed in the log file. */
channels: number[];
}
/** A request message to get all frame definitions listed in the specified database files. */
export interface GetFrameDefinitionsFromDatabaseFilesRequest {
preferences: ApiPreferences | undefined;
/** Database files to retrieve frame definitions from. */
files: string[];
}
/** A request message to get all schedule tables listed in the specified database files. */
export interface GetScheduleTablesFromDatabaseFilesRequest {
preferences: ApiPreferences | undefined;
/** Database files to retrieve schedule tables from. */
files: string[];
}
/** A response message for GetScheduleTablesFromDatabaseFiles request. */
export interface GetScheduleTablesFromDatabaseFilesResponse {
/** Tables listed in the database file. */
tables: ScheduleTable[];
}
/** A request message to get all signal values for a message. */
export interface GetSignalDataFromMessageDataRequest {
preferences: ApiPreferences | undefined;
/** Message qualified name. */
messageQualifiedName: string;
/** Message data. */
data: number[];
}
/** A response message for GetSignalDataFromMessageData request. */
export interface GetSignalDataFromMessageDataResponse {
/** Signal values. */
signalValues: SignalValue[];
}
/** A request message to set all signal values for a message. */
export interface SetSignalDataToMessageDataRequest {
preferences: ApiPreferences | undefined;
/** Message qualified name. */
messageQualifiedName: string;
/** The current message data. */
data: number[];
/** New signal values. One or more signals to be updated. */
signalValues: SignalValue[];
}
/** A response message for SetSignalDataToMessageData request. */
export interface SetSignalDataToMessageDataResponse {
/**
* Updated signal values. Might be different from the once passed in the request if the
* specified signal value couldn't be exactly represented in raw data.
*/
signalValues: SignalValue[];
/** Updated message data. */
data: number[];
}
export declare const SetMeasurementSetupRequest: MessageFns<SetMeasurementSetupRequest>;
export declare const AddAllConnectedCanChannelsRequest: MessageFns<AddAllConnectedCanChannelsRequest>;
export declare const AddAllConnectedLinChannelsRequest: MessageFns<AddAllConnectedLinChannelsRequest>;
export declare const AddOrUpdateSourceRequest: MessageFns<AddOrUpdateSourceRequest>;
export declare const GetSourceResponse: MessageFns<GetSourceResponse>;
export declare const AddOrUpdateDataProcessorRequest: MessageFns<AddOrUpdateDataProcessorRequest>;
export declare const GetDataProcessorResponse: MessageFns<GetDataProcessorResponse>;
export declare const AddOrUpdateTargetRequest: MessageFns<AddOrUpdateTargetRequest>;
export declare const GetTargetResponse: MessageFns<GetTargetResponse>;
export declare const ConnectNodesRequest: MessageFns<ConnectNodesRequest>;
export declare const DisconnectNodesRequest: MessageFns<DisconnectNodesRequest>;
export declare const IdentifierRequest: MessageFns<IdentifierRequest>;
export declare const IdentifiersRequest: MessageFns<IdentifiersRequest>;
export declare const SendMessageRequest: MessageFns<SendMessageRequest>;
export declare const SendLinWakeupFrameRequest: MessageFns<SendLinWakeupFrameRequest>;
export declare const RequestLinMessageRequest: MessageFns<RequestLinMessageRequest>;
export declare const UpdateLinMessageRequest: MessageFns<UpdateLinMessageRequest>;
export declare const ClearLinMessageRequest: MessageFns<ClearLinMessageRequest>;
export declare const StartPeriodicTransmissionRequest: MessageFns<StartPeriodicTransmissionRequest>;
export declare const UpdatePeriodicTransmissionRequest: MessageFns<UpdatePeriodicTransmissionRequest>;
export declare const StartPeriodicTransmissionResponse: MessageFns<StartPeriodicTransmissionResponse>;
export declare const OnlineStatus: MessageFns<OnlineStatus>;
export declare const MeasurementEventArgs: MessageFns<MeasurementEventArgs>;
export declare const GetLogFileFormatsRequest: MessageFns<GetLogFileFormatsRequest>;
export declare const GetLogFileFormatsResponse: MessageFns<GetLogFileFormatsResponse>;
export declare const GetChannelsFromLogFileRequest: MessageFns<GetChannelsFromLogFileRequest>;
export declare const GetChannelsFromLogFileResponse: MessageFns<GetChannelsFromLogFileResponse>;
export declare const GetFrameDefinitionsFromDatabaseFilesRequest: MessageFns<GetFrameDefinitionsFromDatabaseFilesRequest>;
export declare const GetScheduleTablesFromDatabaseFilesRequest: MessageFns<GetScheduleTablesFromDatabaseFilesRequest>;
export declare const GetScheduleTablesFromDatabaseFilesResponse: MessageFns<GetScheduleTablesFromDatabaseFilesResponse>;
export declare const GetSignalDataFromMessageDataRequest: MessageFns<GetSignalDataFromMessageDataRequest>;
export declare const GetSignalDataFromMessageDataResponse: MessageFns<GetSignalDataFromMessageDataResponse>;
export declare const SetSignalDataToMessageDataRequest: MessageFns<SetSignalDataToMessageDataRequest>;
export declare const SetSignalDataToMessageDataResponse: MessageFns<SetSignalDataToMessageDataResponse>;
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
[K in keyof T]?: DeepPartial<T[K]>;
} : Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
type Exact<P, I extends P> = P extends Builtin ? P : P & {
[K in keyof P]: Exact<P[K], I[K]>;
} & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
export {};