cam cmd reply handling

This commit is contained in:
Jakob Meier 2022-05-04 19:08:37 +02:00
parent 475f6f1687
commit 8aacbc2b40

View File

@ -688,9 +688,11 @@ ReturnValue_t PlocMPSoCHandler::handleCamCmdRpt(const uint8_t* data) {
reinterpret_cast<const char*>(dataFieldPtr),
tmCamCmdRpt.rememberSpacePacketSize - mpsoc::SPACE_PACKET_HEADER_SIZE - 3);
uint8_t ackValue = *(packet.getPacketData() + packet.getPacketDataLength() - 2);
sif::info << "CamCmdRpt message: " << camCmdRptMsg << std::endl;
sif::info << "CamCmdRpt Ack value: 0x" << std::hex << static_cast<unsigned int>(ackValue)
<< std::endl;
#if OBSW_DEBUG_PLOC_MPSOC == 1
sif::info << "PlocMPSoCHandler: CamCmdRpt message: " << camCmdRptMsg << std::endl;
sif::info << "PlocMPSoCHandler: CamCmdRpt Ack value: 0x" << std::hex
<< static_cast<unsigned int>(ackValue) << std::endl;
#endif /* OBSW_DEBUG_PLOC_MPSOC == 1 */
handleDeviceTM(packet.getPacketData(), packet.getPacketDataLength() - 1, mpsoc::TM_CAM_CMD_RPT);
return result;
}
@ -921,10 +923,11 @@ void PlocMPSoCHandler::handleDeviceTM(const uint8_t* data, size_t dataSize,
}
void PlocMPSoCHandler::disableAllReplies() {
using namespace mpsoc;
DeviceReplyMap::iterator iter;
/* Disable ack reply */
iter = deviceReplyMap.find(mpsoc::ACK_REPORT);
iter = deviceReplyMap.find(ACK_REPORT);
DeviceReplyInfo* info = &(iter->second);
info->delayCycles = 0;
info->command = deviceCommandMap.end();
@ -933,17 +936,26 @@ void PlocMPSoCHandler::disableAllReplies() {
/* If the command expects a telemetry packet the appropriate tm reply will be disabled here */
switch (commandId) {
case mpsoc::TC_MEM_WRITE:
case TC_MEM_WRITE:
break;
case mpsoc::TC_MEM_READ: {
iter = deviceReplyMap.find(mpsoc::TM_MEMORY_READ_REPORT);
case TC_MEM_READ: {
iter = deviceReplyMap.find(TM_MEMORY_READ_REPORT);
info = &(iter->second);
info->delayCycles = 0;
info->active = false;
info->command = deviceCommandMap.end();
break;
}
case TC_CAM_CMD_SEND: {
iter = deviceReplyMap.find(TM_CAM_CMD_RPT);
info = &(iter->second);
info->delayCycles = 0;
info->active = false;
info->command = deviceCommandMap.end();
break;
}
default: {
sif::debug << "PlocMPSoCHandler::disableAllReplies: Unknown command id" << commandId
sif::debug << "PlocMPSoCHandler::disableAllReplies: Unknown command id: " << commandId
<< std::endl;
break;
}