Fresh Supv handler

This commit is contained in:
2023-11-14 11:49:13 +01:00
parent e41e2e62e0
commit bd4449d7dd
3 changed files with 359 additions and 52 deletions

@@ -99,6 +99,7 @@ class FreshSupvHandler : public FreshDeviceHandlerBase {
Mode_t targetMode = HasModesIF::MODE_INVALID;
Submode_t targetSubmode = 0;
Countdown switchTimeout = Countdown(2000);
// Vorago nees some time to boot properly
Countdown bootTimeout = Countdown(supv::BOOT_TIMEOUT_MS);
@@ -119,6 +120,8 @@ class FreshSupvHandler : public FreshDeviceHandlerBase {
bool isPending = false;
bool ackRecv = false;
bool ackExeRecv = false;
bool replyPacketExpected = false;
bool replyPacketReceived = false;
MessageQueueId_t commandedBy = MessageQueueIF::NO_QUEUE;
bool requiresActionReply = false;
Countdown cmdCountdown;
@@ -137,8 +140,8 @@ class FreshSupvHandler : public FreshDeviceHandlerBase {
ReturnValue_t parseTmPackets();
ReturnValue_t sendCommand(TcBase& tc, uint32_t cmdCountdownMs = 1000);
ReturnValue_t sendEmptyCmd(uint16_t apid, uint8_t serviceId);
ReturnValue_t sendCommand(TcBase& tc, bool replyPacketExpected, uint32_t cmdCountdownMs = 1000);
ReturnValue_t sendEmptyCmd(uint16_t apid, uint8_t serviceId, bool replyPacketExpected);
ReturnValue_t prepareSelBootImageCmd(const uint8_t* commandData);
ReturnValue_t prepareSetTimeRefCmd();
ReturnValue_t prepareSetBootTimeoutCmd(const uint8_t* commandData, size_t cmdDataLen);
@@ -170,6 +173,14 @@ class FreshSupvHandler : public FreshDeviceHandlerBase {
ReturnValue_t handleExecutionReport(const uint8_t* data);
ReturnValue_t handleExecutionSuccessReport(ActiveCmdInfo& info, supv::ExecutionReport& report);
void handleExecutionFailureReport(ActiveCmdInfo& info, supv::ExecutionReport& report);
ReturnValue_t handleHkReport(const uint8_t* data);
ReturnValue_t verifyPacket(const uint8_t* start, size_t foundLen);
void confirmReplyPacketReceived(supv::Apid apid, uint8_t serviceId);
void performCommandCompletionHandling(ActiveCmdInfo& info);
ReturnValue_t handleBootStatusReport(const uint8_t* data);
ReturnValue_t genericHandleTm(const char* contextString, const uint8_t* data,
LocalPoolDataSetBase& set, supv::Apid apid, uint8_t serviceId);
ReturnValue_t handleLatchupStatusReport(const uint8_t* data);
};
#endif /* LINUX_PAYLOAD_FRESHSUPVHANDLER_H_ */