@kvaser/canking-api
Version:
CanKing API to communicate with the CanKing service using Node.js.
156 lines (155 loc) • 6.41 kB
TypeScript
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import Long from "long";
/**
* Possible CAN frame flags. The flag value must match the canlib flag value.
*
* NOTE (known proto3 deviation): The zero value is STATUS_LEVEL_NONE rather than
* STATUS_LEVEL_UNSPECIFIED because the backend maps these values directly to an
* internal status level enum where 0 = None (no status set). Changing the zero
* value would require cascading changes across the service implementation.
*/
export declare enum StatusLevel {
STATUS_LEVEL_NONE = 0,
/** STATUS_LEVEL_OK - Status is OK. */
STATUS_LEVEL_OK = 1,
/** STATUS_LEVEL_WARNING - Status is warning. */
STATUS_LEVEL_WARNING = 2,
/** STATUS_LEVEL_ERROR - Status is error. */
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 - The log replay is in started state. */
LOG_REPLAY_STATE_STARTED = 1,
/** LOG_REPLAY_STATE_STOPPED - The log replay is in stopped state. */
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 {
LOGGER_STATE_UNSPECIFIED = 0,
/** LOGGER_STATE_PRESTART - The logger is in the pre-start state. */
LOGGER_STATE_PRESTART = 1,
/** LOGGER_STATE_STARTED - The logger is currently started. */
LOGGER_STATE_STARTED = 2,
/** LOGGER_STATE_STOPPED - The logger is currently stopped. */
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 {
/** The number of received messages. */
rxMessageCounter: number;
/** The number of received messages per second. */
rxMessagesPerSecond: number;
/** The number of transmitted messages. */
txMessageCounter: number;
/** The number of transmitted messages per second. */
txMessagesPerSecond: number;
/** The number of error frames. */
errorFrameCounter: number;
/** The number of error frames per second. */
errorFramesPerSecond: number;
/** The number of overruns. */
overrunCounter: number;
/** The number of overruns per second. */
overrunsPerSecond: number;
/** The number of received errors. */
rxErrorCounter: number;
/** The number of transmitted errors. */
txErrorCounter: number;
/** The number of overrun errors. */
overrunErrorCounter: number;
/** The bus on status level. */
busOnStatus: StatusLevel;
/** The error status level. */
errorStatus: StatusLevel;
/** The overrun status level. */
overrunStatus: StatusLevel;
/** The bus load. */
busLoad: number;
}
/** A message holding special data processing status information. */
export interface DataProcessingStatus {
/** Number of errors encountered during data processing. */
errorCounter: number;
/** The last execution time of the data processing. */
lastExecutionTime: Long;
/** The minimum execution time of the data processing. */
minExecutionTime: Long;
/** The maximum execution time of the data processing. */
maxExecutionTime: Long;
}
/** A message holding special log replay status information. */
export interface LogReplayStatus {
/** The current state of the log replay. */
state: LogReplayState;
}
/** A message holding special message or signal logger status information. */
export interface LoggerStatus {
/** The current state of the logger. */
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 {
/** A list of node status items. */
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 {};