read gpio tm handling

This commit is contained in:
Jakob Meier
2022-04-29 08:34:23 +02:00
parent e18661bb59
commit f0884c0096
3 changed files with 25 additions and 1 deletions

View File

@ -859,6 +859,7 @@ ReturnValue_t PlocSupervisorHandler::handleAckReport(const uint8_t* data) {
}
case supv::APID_ACK_SUCCESS: {
setNextReplyId();
handleSpecialAcknowledgments(data);
break;
}
default: {
@ -1811,3 +1812,21 @@ ReturnValue_t PlocSupervisorHandler::eventSubscription() {
}
return result;
}
void PlocSupervisorHandler::handleSpecialAcknowledgments(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();
#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);
break;
}
default:
break;
}
}