mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Communication: Add AppErrorMessage support
App errors are responses from the device indicating internal runtime errors.
This commit is contained in:
committed by
Kyle Schwarz
parent
75af3220b0
commit
cac8d760b0
@@ -108,6 +108,7 @@ public:
|
||||
LiveDataNotSupported = 0x2052,
|
||||
LINSettingsNotAvailable = 0x2053,
|
||||
ModeNotFound = 0x2054,
|
||||
AppErrorParsingFailed = 0x2055,
|
||||
|
||||
// Transport Events
|
||||
FailedToRead = 0x3000,
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
#ifndef __APPERRORMESSAGE_H_
|
||||
#define __APPERRORMESSAGE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/communication/message/message.h"
|
||||
#include <unordered_set>
|
||||
#include <memory>
|
||||
#include "icsneo/api/eventmanager.h"
|
||||
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
enum class AppErrorType : uint16_t {
|
||||
AppErrorRxMessagesFull = 0,
|
||||
AppErrorTxMessagesFull = 1,
|
||||
AppErrorTxReportMessagesFull = 2,
|
||||
AppErrorBadCommWithDspIC = 3,
|
||||
AppErrorDriverOverflow = 4,
|
||||
AppErrorPCBuffOverflow = 5,
|
||||
AppErrorPCChksumError = 6,
|
||||
AppErrorPCMissedByte = 7,
|
||||
AppErrorPCOverrunError = 8,
|
||||
AppErrorSettingFailure = 9,
|
||||
AppErrorTooManySelectedNetworks = 10,
|
||||
AppErrorNetworkNotEnabled = 11,
|
||||
AppErrorRtcNotCorrect = 12,
|
||||
AppErrorLoadedDefaultSettings = 13,
|
||||
AppErrorFeatureNotUnlocked = 14,
|
||||
AppErrorFeatureRtcCmdDropped = 15,
|
||||
AppErrorTxMessagesFlushed = 16,
|
||||
AppErrorTxMessagesHalfFull = 17,
|
||||
AppErrorNetworkNotValid = 18,
|
||||
AppErrorTxInterfaceNotImplemented = 19,
|
||||
AppErrorTxMessagesCommEnableIsOff = 20,
|
||||
AppErrorRxFilterMatchCountExceeded = 21,
|
||||
AppErrorEthPreemptionNotEnabled = 22,
|
||||
AppErrorTxNotSupportedInMode = 23,
|
||||
AppErrorJumboFramesNotSupported = 24,
|
||||
AppErrorEthernetIpFragment = 25,
|
||||
AppErrorTxMessagesUnderrun = 26,
|
||||
AppErrorDeviceFanFailure = 27,
|
||||
AppErrorDeviceOvertemperature = 28,
|
||||
AppErrorTxMessageIndexOutOfRange = 29,
|
||||
AppErrorUndersizedFrameDropped = 30,
|
||||
AppErrorOversizedFrameDropped = 31,
|
||||
AppErrorWatchdogEvent = 32,
|
||||
AppErrorSystemClockFailure = 33,
|
||||
AppErrorSystemClockRecovered = 34,
|
||||
AppErrorSystemPeripheralReset = 35,
|
||||
AppErrorSystemCommunicationFailure = 36,
|
||||
AppErrorTxMessagesUnsupportedSourceOrPacketId = 37,
|
||||
AppErrorWbmsManagerConnectFailed = 38,
|
||||
AppErrorWbmsManagerConnectBadState = 39,
|
||||
AppErrorWbmsManagerConnectTimeout = 40,
|
||||
AppErrorFailedToInitializeLoggerDisk = 41,
|
||||
AppErrorInvalidSetting = 42,
|
||||
AppErrorSystemFailureRequestedReset = 43,
|
||||
AppErrorPortKeyMistmatch = 45,
|
||||
AppErrorErrorBufferOverflow = 254,
|
||||
AppNoError = 255
|
||||
};
|
||||
|
||||
class AppErrorMessage : public RawMessage {
|
||||
public:
|
||||
AppErrorMessage() : RawMessage(Message::Type::AppError, Network::NetID::RED_App_Error) {}
|
||||
uint16_t errorType;
|
||||
Network::NetID errorNetID;
|
||||
uint32_t timestamp10us;
|
||||
uint32_t timestamp10usMSB;
|
||||
|
||||
static std::shared_ptr<Message> DecodeToMessage(const std::vector<uint8_t>& bytestream, const device_eventhandler_t& report);
|
||||
AppErrorType getAppErrorType();
|
||||
std::string getAppErrorString();
|
||||
};
|
||||
|
||||
} // namespace icsneo
|
||||
|
||||
#endif // __cplusplus
|
||||
#endif
|
||||
@@ -40,6 +40,7 @@ public:
|
||||
LiveData = 0x800f,
|
||||
HardwareInfo = 0x8010,
|
||||
TC10Status = 0x8011,
|
||||
AppError = 0x8012,
|
||||
};
|
||||
|
||||
Message(Type t) : type(t) {}
|
||||
|
||||
@@ -537,6 +537,7 @@ public:
|
||||
case NetID::NeoMemoryWriteDone:
|
||||
case NetID::RED_GET_RTC:
|
||||
case NetID::DiskData:
|
||||
case NetID::RED_App_Error:
|
||||
return Type::Internal;
|
||||
case NetID::Invalid:
|
||||
case NetID::Any:
|
||||
|
||||
Reference in New Issue
Block a user