continue switch to new packet format
This commit is contained in:
parent
95a3ea1d23
commit
f32f68d0e0
@ -378,6 +378,10 @@ class TcBase : public ploc::SpTcBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setLenFromPayloadLen(size_t payloadLen) {
|
||||||
|
spParams.setFullPayloadLen(ccsds::HEADER_LEN + SECONDARY_HEADER_LEN + payloadLen + CRC_LEN);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint8_t serviceId = 0;
|
uint8_t serviceId = 0;
|
||||||
|
|
||||||
@ -387,6 +391,7 @@ class TcBase : public ploc::SpTcBase {
|
|||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
std::memset(spParams.buf + ccsds::HEADER_LEN, 0, TIMESTAMP_LEN);
|
std::memset(spParams.buf + ccsds::HEADER_LEN, 0, TIMESTAMP_LEN);
|
||||||
|
payloadStart = spParams.buf + SECONDARY_HEADER_LEN;
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -413,7 +418,7 @@ class NoPayloadPacket : public TcBase {
|
|||||||
* @brief This class can be used to generate the space packet selecting the boot image of
|
* @brief This class can be used to generate the space packet selecting the boot image of
|
||||||
* of the MPSoC.
|
* of the MPSoC.
|
||||||
*/
|
*/
|
||||||
class MPSoCBootSelect : public ploc::SpTcBase {
|
class MPSoCBootSelect : public TcBase {
|
||||||
public:
|
public:
|
||||||
static const uint8_t NVM0 = 0;
|
static const uint8_t NVM0 = 0;
|
||||||
static const uint8_t NVM1 = 1;
|
static const uint8_t NVM1 = 1;
|
||||||
@ -428,8 +433,8 @@ class MPSoCBootSelect : public ploc::SpTcBase {
|
|||||||
*
|
*
|
||||||
* @note Selection of partitions is currently not supported.
|
* @note Selection of partitions is currently not supported.
|
||||||
*/
|
*/
|
||||||
MPSoCBootSelect(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
MPSoCBootSelect(TcParams params) : TcBase(params) {
|
||||||
spParams.setFullPayloadLen(DATA_FIELD_LENGTH);
|
params.setLenFromPayloadLen(4);
|
||||||
spParams.creator.setApid(APID_SEL_MPSOC_BOOT_IMAGE);
|
spParams.creator.setApid(APID_SEL_MPSOC_BOOT_IMAGE);
|
||||||
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
||||||
}
|
}
|
||||||
@ -444,16 +449,13 @@ class MPSoCBootSelect : public ploc::SpTcBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const uint16_t DATA_FIELD_LENGTH = 6;
|
|
||||||
|
|
||||||
static const uint8_t MEM_OFFSET = 0;
|
static const uint8_t MEM_OFFSET = 0;
|
||||||
static const uint8_t BP0_OFFSET = 1;
|
static const uint8_t BP0_OFFSET = 1;
|
||||||
static const uint8_t BP1_OFFSET = 2;
|
static const uint8_t BP1_OFFSET = 2;
|
||||||
static const uint8_t BP2_OFFSET = 3;
|
static const uint8_t BP2_OFFSET = 3;
|
||||||
static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2;
|
|
||||||
|
|
||||||
void initPacket(uint8_t mem = 0, uint8_t bp0 = 0, uint8_t bp1 = 0, uint8_t bp2 = 0) {
|
void initPacket(uint8_t mem = 0, uint8_t bp0 = 0, uint8_t bp1 = 0, uint8_t bp2 = 0) {
|
||||||
std::memcpy(payloadStart + MEM_OFFSET, &mem, sizeof(mem));
|
payloadStart[0] = mem;
|
||||||
std::memcpy(payloadStart + BP0_OFFSET, &bp0, sizeof(bp0));
|
std::memcpy(payloadStart + BP0_OFFSET, &bp0, sizeof(bp0));
|
||||||
std::memcpy(payloadStart + BP1_OFFSET, &bp1, sizeof(bp1));
|
std::memcpy(payloadStart + BP1_OFFSET, &bp1, sizeof(bp1));
|
||||||
std::memcpy(payloadStart + BP2_OFFSET, &bp2, sizeof(bp2));
|
std::memcpy(payloadStart + BP2_OFFSET, &bp2, sizeof(bp2));
|
||||||
|
@ -1431,7 +1431,7 @@ ReturnValue_t PlocSupervisorHandler::prepareEmptyCmd(uint16_t apid, uint8_t serv
|
|||||||
ReturnValue_t PlocSupervisorHandler::prepareSelBootImageCmd(const uint8_t* commandData) {
|
ReturnValue_t PlocSupervisorHandler::prepareSelBootImageCmd(const uint8_t* commandData) {
|
||||||
supv::MPSoCBootSelect packet(spParams);
|
supv::MPSoCBootSelect packet(spParams);
|
||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
packet.buildPacket(*commandData, *(commandData + 1), *(commandData + 2), *(commandData + 3));
|
packet.buildPacket(commandData[0], commandData[1], commandData[2], commandData[3]);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user