pcdu handler pdu2 dataset wip

This commit is contained in:
2021-02-03 19:35:55 +01:00
parent 38d4b28a90
commit 3d734117e1
5 changed files with 444 additions and 246 deletions

View File

@ -18,14 +18,22 @@ ReturnValue_t PDU2Handler::buildNormalDeviceCommand(
}
void PDU2Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) {
ReturnValue_t result;
/* Pointer points to beginning of payload data */
pdu2HkTableDataset.read();
const uint8_t* payloadPtr = packet + GOMSPACE::GS_HDR_LENGTH;
size_t size = (size_t)hkTableSize;
pdu2HkTableDataset.deSerialize(&payloadPtr, &size, SerializeIF::Endianness::BIG);
FullTableReply fullTableReply(id, HK_TABLE_ID, &pdu2HkTableDataset);
handleDeviceTM(&fullTableReply, id, true);
result = pdu2HkTableDataset.deSerialize(&payloadPtr, &size, SerializeIF::Endianness::BIG);
if (result != RETURN_OK) {
sif::debug << "PDU2Handler::letChildHandleHkReply: Failed to deserialize housekeeping "
<< "packet array into pdu2HkTableDataset" << std::endl;
return;
}
// FullTableReply fullTableReply(id, HK_TABLE_ID, &pdu2HkTableDataset);
// handleDeviceTM(&fullTableReply, id, true);
#if OBSW_ENHANCED_PRINTOUT == 1
pdu2HkTableDataset.read();
float temperatureC = pdu2HkTableDataset.temperature.value;
sif::info << "PDU2 Temperature: " << temperatureC << "<EFBFBD>C" << std::endl;
pdu2HkTableDataset.commit();