This commit is contained in:
parent
8ea6df273d
commit
5aa0b3530a
@ -370,8 +370,8 @@ class TcFlashWrite : public ploc::SpTcBase {
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
size_t serializedSize = 0;
|
||||
result = SerializeAdapter::serialize(&writeLen, payloadStart, &serializedSize, sizeof(writeLen),
|
||||
size_t serializedSize = ccsds::HEADER_LEN;
|
||||
result = SerializeAdapter::serialize(&writeLen, payloadStart, &serializedSize, spParams.maxSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
@ -663,8 +663,8 @@ class TcCamcmdSend : public TcBase {
|
||||
if (res != HasReturnvaluesIF::RETURN_OK) {
|
||||
return res;
|
||||
}
|
||||
size_t size = sizeof(dataLen);
|
||||
SerializeAdapter::serialize(&dataLen, payloadStart, &size, sizeof(dataLen),
|
||||
size_t size = ccsds::HEADER_LEN;
|
||||
SerializeAdapter::serialize(&dataLen, payloadStart, &size, spParams.maxSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
std::memcpy(payloadStart + sizeof(dataLen), commandData, commandDataLen);
|
||||
*(payloadStart + sizeof(dataLen) + commandDataLen) = CARRIAGE_RETURN;
|
||||
|
@ -721,11 +721,11 @@ class SetAdcWindowAndStride : public ploc::SpTcBase {
|
||||
static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2;
|
||||
|
||||
void initPacket(uint16_t windowSize, uint16_t stridingStepSize) {
|
||||
size_t serializedSize = 0;
|
||||
size_t serializedSize = 6;
|
||||
uint8_t* data = payloadStart;
|
||||
SerializeAdapter::serialize(&windowSize, &data, &serializedSize, sizeof(windowSize),
|
||||
SerializeAdapter::serialize(&windowSize, &data, &serializedSize, spParams.maxSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
SerializeAdapter::serialize(&stridingStepSize, &data, &serializedSize, sizeof(stridingStepSize),
|
||||
SerializeAdapter::serialize(&stridingStepSize, &data, &serializedSize, spParams.maxSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
}
|
||||
};
|
||||
@ -1066,16 +1066,13 @@ class CheckMemory : public ploc::SpTcBase {
|
||||
|
||||
void initPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) {
|
||||
uint8_t* data = payloadStart;
|
||||
size_t serLen = 0;
|
||||
SerializeAdapter::serialize(&memoryId, &data, &serLen, sizeof(memoryId),
|
||||
size_t serLen = 6;
|
||||
SerializeAdapter::serialize(&memoryId, &data, &serLen, spParams.maxSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
serLen = 0;
|
||||
SerializeAdapter::serialize(&n, &data, &serLen, sizeof(n), SerializeIF::Endianness::BIG);
|
||||
serLen = 0;
|
||||
SerializeAdapter::serialize(&startAddress, &data, &serLen, sizeof(startAddress),
|
||||
SerializeAdapter::serialize(&n, &data, &serLen, spParams.maxSize, SerializeIF::Endianness::BIG);
|
||||
SerializeAdapter::serialize(&startAddress, &data, &serLen, spParams.maxSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
serLen = 0;
|
||||
SerializeAdapter::serialize(&length, &data, &serLen, sizeof(length),
|
||||
SerializeAdapter::serialize(&length, &data, &serLen, spParams.maxSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
}
|
||||
};
|
||||
@ -1122,7 +1119,6 @@ class WriteMemory : public ploc::SpTcBase {
|
||||
|
||||
ReturnValue_t initPacket(uint8_t memoryId, uint32_t startAddr, uint16_t updateDataLen,
|
||||
uint8_t* updateData) {
|
||||
size_t serializedSize = 0;
|
||||
uint8_t* data = payloadStart;
|
||||
if (updateDataLen % 2 != 0) {
|
||||
spParams.setPayloadLen(META_DATA_LENGTH + updateDataLen + 1);
|
||||
@ -1134,13 +1130,14 @@ class WriteMemory : public ploc::SpTcBase {
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
SerializeAdapter::serialize(&memoryId, &data, &serializedSize, sizeof(memoryId),
|
||||
size_t serializedSize = 6;
|
||||
SerializeAdapter::serialize(&memoryId, &data, &serializedSize, spParams.maxSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
SerializeAdapter::serialize(&n, &data, &serializedSize, sizeof(n),
|
||||
SerializeAdapter::serialize(&n, &data, &serializedSize, spParams.maxSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
SerializeAdapter::serialize(&startAddr, &data, &serializedSize, sizeof(startAddr),
|
||||
SerializeAdapter::serialize(&startAddr, &data, &serializedSize, spParams.maxSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
SerializeAdapter::serialize(&updateDataLen, &data, &serializedSize, sizeof(updateDataLen),
|
||||
SerializeAdapter::serialize(&updateDataLen, &data, &serializedSize, spParams.maxSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
std::memcpy(data, updateData, updateDataLen);
|
||||
if (updateDataLen % 2 != 0) {
|
||||
@ -1181,18 +1178,15 @@ class EraseMemory : public ploc::SpTcBase {
|
||||
uint32_t length = 0;
|
||||
|
||||
void initPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) {
|
||||
size_t serializedSize = 0;
|
||||
uint8_t* data = payloadStart;
|
||||
SerializeAdapter::serialize(&memoryId, &data, &serializedSize, sizeof(memoryId),
|
||||
size_t serializedSize = 6;
|
||||
SerializeAdapter::serialize(&memoryId, &data, &serializedSize, spParams.maxSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
serializedSize = 0;
|
||||
SerializeAdapter::serialize(&n, &data, &serializedSize, sizeof(n),
|
||||
SerializeAdapter::serialize(&n, &data, &serializedSize, spParams.maxSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
serializedSize = 0;
|
||||
SerializeAdapter::serialize(&startAddress, &data, &serializedSize, sizeof(startAddress),
|
||||
SerializeAdapter::serialize(&startAddress, &data, &serializedSize, spParams.maxSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
serializedSize = 0;
|
||||
SerializeAdapter::serialize(&length, &data, &serializedSize, sizeof(length),
|
||||
SerializeAdapter::serialize(&length, &data, &serializedSize, spParams.maxSize,
|
||||
SerializeIF::Endianness::BIG);
|
||||
}
|
||||
};
|
||||
|
@ -161,26 +161,32 @@ void PlocSupvHelper::stopProcess() { terminate = true; }
|
||||
|
||||
ReturnValue_t PlocSupvHelper::performUpdate() {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
sif::info << "PlocSupvHelper::performUpdate: Calculating Image CRC" << std::endl;
|
||||
result = calcImageCrc();
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
sif::info << "PlocSupvHelper::performUpdate: Selecting Memory" << std::endl;
|
||||
result = selectMemory();
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
sif::info << "PlocSupvHelper::performUpdate: Preparing Update" << std::endl;
|
||||
result = prepareUpdate();
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
sif::info << "PlocSupvHelper::performUpdate: Erasing Memory" << std::endl;
|
||||
result = eraseMemory();
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
sif::info << "PlocSupvHelper::performUpdate: Writing Update Packets" << std::endl;
|
||||
result = writeUpdatePackets();
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
sif::info << "PlocSupvHelper::performUpdate: Memory Check" << std::endl;
|
||||
result = handleCheckMemoryCommand();
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
@ -317,6 +323,9 @@ ReturnValue_t PlocSupvHelper::prepareUpdate() {
|
||||
resetSpParams();
|
||||
supv::ApidOnlyPacket packet(spParams, supv::APID_PREPARE_UPDATE);
|
||||
result = packet.buildPacket();
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
result = handlePacketTransmission(packet, PREPARE_UPDATE_EXECUTION_REPORT);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
|
@ -178,11 +178,11 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha
|
||||
#ifdef XIPHOS_Q7S
|
||||
SdCardManager* sdcMan = nullptr;
|
||||
#endif
|
||||
uint8_t commandBuffer[supv::MAX_COMMAND_SIZE];
|
||||
uint8_t commandBuffer[supv::MAX_COMMAND_SIZE]{};
|
||||
SpacePacketCreator creator;
|
||||
ploc::SpTcParams spParams = ploc::SpTcParams(creator);
|
||||
|
||||
std::array<uint8_t, supv::MAX_COMMAND_SIZE> tmBuf;
|
||||
std::array<uint8_t, supv::MAX_COMMAND_SIZE> tmBuf{};
|
||||
|
||||
bool terminate = false;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user