UNPKG

@kvaser/canking-api

Version:

CanKing API to communicate with the CanKing service using Node.js.

119 lines (118 loc) 4.61 kB
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import Long from "long"; /** Possible CAN frame flags. The flag value must match the canlib flag value. */ export declare enum StatusLevel { STATUS_LEVEL_NONE = 0, STATUS_LEVEL_OK = 1, STATUS_LEVEL_WARNING = 2, STATUS_LEVEL_ERROR = 3, UNRECOGNIZED = -1 } export declare function statusLevelFromJSON(object: any): StatusLevel; export declare function statusLevelToJSON(object: StatusLevel): string; /** Possible log replay states. */ export declare enum LogReplayState { LOG_REPLAY_STATE_UNSPECIFIED = 0, LOG_REPLAY_STATE_STARTED = 1, LOG_REPLAY_STATE_STOPPED = 2, UNRECOGNIZED = -1 } export declare function logReplayStateFromJSON(object: any): LogReplayState; export declare function logReplayStateToJSON(object: LogReplayState): string; /** Possible message or signal logger states. */ export declare enum LoggerState { MESSAGE_LOGGER_STATE_UNSPECIFIED = 0, MESSAGE_LOGGER_STATE_PRESTART = 1, MESSAGE_LOGGER_STATE_STARTED = 2, MESSAGE_LOGGER_STATE_STOPPED = 3, UNRECOGNIZED = -1 } export declare function loggerStateFromJSON(object: any): LoggerState; export declare function loggerStateToJSON(object: LoggerState): string; /** A message holding bus status information. */ export interface BusStatus { rxMessageCounter: number; rxMessagesPerSecond: number; txMessageCounter: number; txMessagesPerSecond: number; errorFrameCounter: number; errorFramesPerSecond: number; overrunCounter: number; overrunsPerSecond: number; rxErrorCounter: number; txErrorCounter: number; overrunErrorCounter: number; busOnStatus: StatusLevel; errorStatus: StatusLevel; overrunStatus: StatusLevel; busLoad: number; } /** A message holding special data processing status information. */ export interface DataProcessingStatus { errorCounter: number; lastExecutionTime: Long; minExecutionTime: Long; maxExecutionTime: Long; } /** A message holding special log replay status information. */ export interface LogReplayStatus { state: LogReplayState; } /** A message holding special message or signal logger status information. */ export interface LoggerStatus { state: LoggerState; } /** A message holding any errors associated with a node. */ export interface ErrorStatus { /** The errors, set to an empty string when any errors have been cleared. */ errors: string; } /** A message for sending node status. */ export interface NodeStatus { /** Identifier of the node */ nodeId: string; /** Name of the node */ nodeName: string; /** Identifier of the stream node */ streamId: string; /** Special bus status */ busStatus: BusStatus | undefined; /** Special data processing status */ dataProcessingStatus: DataProcessingStatus | undefined; /** Special log replay status */ logReplayStatus: LogReplayStatus | undefined; /** Special message logger status */ loggerStatus: LoggerStatus | undefined; /** Error status */ errorStatus: ErrorStatus | undefined; } /** A collection of node status items. */ export interface NodeStatuses { items: NodeStatus[]; } export declare const BusStatus: MessageFns<BusStatus>; export declare const DataProcessingStatus: MessageFns<DataProcessingStatus>; export declare const LogReplayStatus: MessageFns<LogReplayStatus>; export declare const LoggerStatus: MessageFns<LoggerStatus>; export declare const ErrorStatus: MessageFns<ErrorStatus>; export declare const NodeStatus: MessageFns<NodeStatus>; export declare const NodeStatuses: MessageFns<NodeStatuses>; 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 {};