@zandor300/jsmodbus
Version:
Implementation for the Serial/TCP Modbus protocol.
19 lines • 806 B
TypeScript
export type ErrorCode = 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 11;
export declare const ErrorMessages: {
readonly 1: "ILLEGAL FUNCTION";
readonly 2: "ILLEGAL DATA ADDRESS";
readonly 3: "ILLEGAL DATA VALUE";
readonly 4: "SLAVE DEVICE FAILURE";
readonly 5: "ACKNOWLEDGE";
readonly 6: "SLAVE DEVICE BUSY";
readonly 8: "MEMORY PARITY ERROR";
readonly 10: "GATEWAY PATH UNAVAILABLE";
readonly 11: "GATEWAY TARGET DEVICE FAILED TO RESPOND";
};
type IErrorMessage = typeof ErrorMessages;
type ErrorMessage = IErrorMessage[ErrorCode];
export declare function errorCodeToMessage(x: number): ErrorMessage;
export declare function errorCodeToMessage(x: ErrorCode): ErrorMessage;
export declare function isErrorCode(x: any): x is ErrorCode;
export {};
//# sourceMappingURL=errors.d.ts.map