meier/plocMPSoC #188
@ -26,6 +26,9 @@ static const DeviceCommandId_t TC_DOWNLINK_PWR_ON = 14;
|
|||||||
static const DeviceCommandId_t TC_DOWNLINK_PWR_OFF = 15;
|
static const DeviceCommandId_t TC_DOWNLINK_PWR_OFF = 15;
|
||||||
static const DeviceCommandId_t TC_MODE_REPLAY = 16;
|
static const DeviceCommandId_t TC_MODE_REPLAY = 16;
|
||||||
|
|
||||||
|
// Will reset the sequence count of the OBSW
|
||||||
|
static const DeviceCommandId_t OBSW_RESET_SEQ_COUNT = 50;
|
||||||
|
|
||||||
static const uint16_t SIZE_ACK_REPORT = 14;
|
static const uint16_t SIZE_ACK_REPORT = 14;
|
||||||
static const uint16_t SIZE_EXE_REPORT = 14;
|
static const uint16_t SIZE_EXE_REPORT = 14;
|
||||||
static const uint16_t SIZE_TM_MEM_READ_REPORT = 18;
|
static const uint16_t SIZE_TM_MEM_READ_REPORT = 18;
|
||||||
|
@ -167,6 +167,10 @@ ReturnValue_t PlocMPSoCHandler::buildCommandFromCommand(DeviceCommandId_t device
|
|||||||
result = prepareTcModeReplay();
|
result = prepareTcModeReplay();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case (mpsoc::OBSW_RESET_SEQ_COUNT): {
|
||||||
|
sequenceCount = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
sif::debug << "PlocMPSoCHandler::buildCommandFromCommand: Command not implemented"
|
sif::debug << "PlocMPSoCHandler::buildCommandFromCommand: Command not implemented"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
@ -194,6 +198,7 @@ void PlocMPSoCHandler::fillCommandAndReplyMap() {
|
|||||||
this->insertInCommandMap(mpsoc::TC_DOWNLINK_PWR_OFF);
|
this->insertInCommandMap(mpsoc::TC_DOWNLINK_PWR_OFF);
|
||||||
this->insertInCommandMap(mpsoc::TC_REPLAY_WRITE_SEQUENCE);
|
this->insertInCommandMap(mpsoc::TC_REPLAY_WRITE_SEQUENCE);
|
||||||
this->insertInCommandMap(mpsoc::TC_MODE_REPLAY);
|
this->insertInCommandMap(mpsoc::TC_MODE_REPLAY);
|
||||||
|
this->insertInCommandMap(mpsoc::OBSW_RESET_SEQ_COUNT);
|
||||||
this->insertInReplyMap(mpsoc::ACK_REPORT, 1, nullptr, mpsoc::SIZE_ACK_REPORT);
|
this->insertInReplyMap(mpsoc::ACK_REPORT, 1, nullptr, mpsoc::SIZE_ACK_REPORT);
|
||||||
this->insertInReplyMap(mpsoc::EXE_REPORT, 3, nullptr, mpsoc::SIZE_EXE_REPORT);
|
this->insertInReplyMap(mpsoc::EXE_REPORT, 3, nullptr, mpsoc::SIZE_EXE_REPORT);
|
||||||
this->insertInReplyMap(mpsoc::TM_MEMORY_READ_REPORT, 2, nullptr, mpsoc::SIZE_TM_MEM_READ_REPORT);
|
this->insertInReplyMap(mpsoc::TM_MEMORY_READ_REPORT, 2, nullptr, mpsoc::SIZE_TM_MEM_READ_REPORT);
|
||||||
@ -459,8 +464,9 @@ ReturnValue_t PlocMPSoCHandler::handleAckReport(const uint8_t* data) {
|
|||||||
// TODO: Interpretation of status field in acknowledgment report
|
// TODO: Interpretation of status field in acknowledgment report
|
||||||
sif::debug << "PlocMPSoCHandler::handleAckReport: Received Ack failure report" << std::endl;
|
sif::debug << "PlocMPSoCHandler::handleAckReport: Received Ack failure report" << std::endl;
|
||||||
DeviceCommandId_t commandId = getPendingCommand();
|
DeviceCommandId_t commandId = getPendingCommand();
|
||||||
|
uint16_t status = getStatus(data);
|
||||||
if (commandId != DeviceHandlerIF::NO_COMMAND_ID) {
|
if (commandId != DeviceHandlerIF::NO_COMMAND_ID) {
|
||||||
triggerEvent(ACK_FAILURE, commandId);
|
triggerEvent(ACK_FAILURE, commandId, status);
|
||||||
}
|
}
|
||||||
sendFailureReport(mpsoc::ACK_REPORT, MPSoCReturnValuesIF::RECEIVED_ACK_FAILURE);
|
sendFailureReport(mpsoc::ACK_REPORT, MPSoCReturnValuesIF::RECEIVED_ACK_FAILURE);
|
||||||
disableAllReplies();
|
disableAllReplies();
|
||||||
@ -568,6 +574,8 @@ ReturnValue_t PlocMPSoCHandler::enableReplyInReplyMap(DeviceCommandMap::iterator
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case mpsoc::OBSW_RESET_SEQ_COUNT:
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
sif::debug << "PlocMPSoCHandler::enableReplyInReplyMap: Unknown command id" << std::endl;
|
sif::debug << "PlocMPSoCHandler::enableReplyInReplyMap: Unknown command id" << std::endl;
|
||||||
break;
|
break;
|
||||||
@ -743,3 +751,6 @@ void PlocMPSoCHandler::printStatus(const uint8_t* data) {
|
|||||||
sif::info << "Verification report status: 0x" << std::hex << status << std::endl;
|
sif::info << "Verification report status: 0x" << std::hex << status << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PlocMPSoCHandler::getStatus(const uint8_t* data) {
|
||||||
|
return *(data + STATUS_OFFSET) << 8 | *(data + STATUS_OFFSET + 1);
|
||||||
|
}
|
||||||
|
@ -206,6 +206,8 @@ private:
|
|||||||
void printStatus(const uint8_t* data);
|
void printStatus(const uint8_t* data);
|
||||||
|
|
||||||
ReturnValue_t prepareTcModeReplay();
|
ReturnValue_t prepareTcModeReplay();
|
||||||
|
|
||||||
|
uint16_t getStatus(const uint8_t* data);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* BSP_Q7S_DEVICES_PLOC_PLOCMPSOCHANDLER_H_ */
|
#endif /* BSP_Q7S_DEVICES_PLOC_PLOCMPSOCHANDLER_H_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user