From e70af5b5db782eacd384c7c41493d8cb25a8abeb Mon Sep 17 00:00:00 2001 From: Balazs Racz Date: Wed, 23 Dec 2020 17:05:25 +0100 Subject: [PATCH] Adds error codes defined by the firmware upgrade standard. --- src/openlcb/Defs.hxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/openlcb/Defs.hxx b/src/openlcb/Defs.hxx index 68f3e734e..855e6bb31 100644 --- a/src/openlcb/Defs.hxx +++ b/src/openlcb/Defs.hxx @@ -160,7 +160,8 @@ struct Defs }; - enum ErrorCodes { + enum ErrorCodes + { ERROR_CODE_OK = 0, ERROR_PERMANENT = 0x1000, @@ -182,6 +183,15 @@ struct Defs ERROR_OPENMRN_ALREADY_EXISTS = ERROR_OPENMRN_NOT_FOUND | 2, + // Codes defined by the firmware upgrade standard + + /// The firmware data is incompatible with this hardware node. + ERROR_FIRMWARE_INCOMPATIBLE = ERROR_INVALID_ARGS | 8, + /// The firmware data is invalid or corrupted. + ERROR_FIRMWARE_CORRUPTED = ERROR_INVALID_ARGS | 9, + /// The firmware written has failed checksum (temporary error). + ERROR_FIRMWARE_CSUM = 0x2088, + // Internal error codes generated by the stack. ERROR_DST_NOT_FOUND = 0x40000, //< on CAN. Permanent error code. // There is a conflict with MinGW macros here.