gpio state sent with execution report

This commit is contained in:
2022-04-29 22:55:01 +02:00
parent cf20d8e94d
commit cedc6bec23
5 changed files with 32 additions and 13 deletions

View File

@ -859,7 +859,6 @@ ReturnValue_t PlocSupervisorHandler::handleAckReport(const uint8_t* data) {
}
case supv::APID_ACK_SUCCESS: {
setNextReplyId();
handleSpecialAcknowledgments(data);
break;
}
default: {
@ -887,6 +886,7 @@ ReturnValue_t PlocSupervisorHandler::handleExecutionReport(const uint8_t* data)
switch (apid) {
case (supv::APID_EXE_SUCCESS): {
handleSpecialExecutionReport(data);
break;
}
case (supv::APID_EXE_FAILURE): {
@ -1813,17 +1813,17 @@ ReturnValue_t PlocSupervisorHandler::eventSubscription() {
return result;
}
void PlocSupervisorHandler::handleSpecialAcknowledgments(const uint8_t* data) {
void PlocSupervisorHandler::handleSpecialExecutionReport(const uint8_t* data) {
DeviceCommandId_t commandId = getPendingCommand();
switch(commandId) {
case supv::READ_GPIO: {
supv::AcknowledgmentReport ack;
ack.addWholeData(data, supv::SIZE_ACK_REPORT);
uint16_t gpioState = ack.getStatusCode();
supv::ExecutionReport exe;
exe.addWholeData(data, supv::SIZE_EXE_REPORT);
uint16_t gpioState = exe.getStatusCode();
#if OBSW_DEBUG_PLOC_SUPERVISOR == 1
sif::info << "PlocsupervisorHandler: Read GPIO TM, State: " << gpioState << std::endl;
#endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */
handleDeviceTM(reinterpret_cast<uint8_t*>(&gpioState), sizeof(gpioState), supv::ACK_REPORT);
handleDeviceTM(reinterpret_cast<uint8_t*>(&gpioState), sizeof(gpioState), supv::EXE_REPORT);
break;
}
default: