This commit is contained in:
parent
83382de330
commit
c8d38cf852
@ -370,8 +370,8 @@ class TcFlashWrite : public ploc::SpTcBase {
|
|||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
size_t serializedSize = 0;
|
size_t serializedSize = ccsds::HEADER_LEN;
|
||||||
result = SerializeAdapter::serialize(&writeLen, payloadStart, &serializedSize, sizeof(writeLen),
|
result = SerializeAdapter::serialize(&writeLen, payloadStart, &serializedSize, spParams.maxSize,
|
||||||
SerializeIF::Endianness::BIG);
|
SerializeIF::Endianness::BIG);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
@ -663,8 +663,8 @@ class TcCamcmdSend : public TcBase {
|
|||||||
if (res != HasReturnvaluesIF::RETURN_OK) {
|
if (res != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
size_t size = sizeof(dataLen);
|
size_t size = ccsds::HEADER_LEN;
|
||||||
SerializeAdapter::serialize(&dataLen, payloadStart, &size, sizeof(dataLen),
|
SerializeAdapter::serialize(&dataLen, payloadStart, &size, spParams.maxSize,
|
||||||
SerializeIF::Endianness::BIG);
|
SerializeIF::Endianness::BIG);
|
||||||
std::memcpy(payloadStart + sizeof(dataLen), commandData, commandDataLen);
|
std::memcpy(payloadStart + sizeof(dataLen), commandData, commandDataLen);
|
||||||
*(payloadStart + sizeof(dataLen) + commandDataLen) = CARRIAGE_RETURN;
|
*(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;
|
static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2;
|
||||||
|
|
||||||
void initPacket(uint16_t windowSize, uint16_t stridingStepSize) {
|
void initPacket(uint16_t windowSize, uint16_t stridingStepSize) {
|
||||||
size_t serializedSize = 0;
|
size_t serializedSize = 6;
|
||||||
uint8_t* data = payloadStart;
|
uint8_t* data = payloadStart;
|
||||||
SerializeAdapter::serialize(&windowSize, &data, &serializedSize, sizeof(windowSize),
|
SerializeAdapter::serialize(&windowSize, &data, &serializedSize, spParams.maxSize,
|
||||||
SerializeIF::Endianness::BIG);
|
SerializeIF::Endianness::BIG);
|
||||||
SerializeAdapter::serialize(&stridingStepSize, &data, &serializedSize, sizeof(stridingStepSize),
|
SerializeAdapter::serialize(&stridingStepSize, &data, &serializedSize, spParams.maxSize,
|
||||||
SerializeIF::Endianness::BIG);
|
SerializeIF::Endianness::BIG);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1066,13 +1066,13 @@ class CheckMemory : public ploc::SpTcBase {
|
|||||||
|
|
||||||
void initPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) {
|
void initPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) {
|
||||||
uint8_t* data = payloadStart;
|
uint8_t* data = payloadStart;
|
||||||
size_t serLen = 0;
|
size_t serLen = 6;
|
||||||
SerializeAdapter::serialize(&memoryId, &data, &serLen, sizeof(memoryId),
|
SerializeAdapter::serialize(&memoryId, &data, &serLen, spParams.maxSize,
|
||||||
SerializeIF::Endianness::BIG);
|
SerializeIF::Endianness::BIG);
|
||||||
SerializeAdapter::serialize(&n, &data, &serLen, sizeof(n), SerializeIF::Endianness::BIG);
|
SerializeAdapter::serialize(&n, &data, &serLen, spParams.maxSize, SerializeIF::Endianness::BIG);
|
||||||
SerializeAdapter::serialize(&startAddress, &data, &serLen, sizeof(startAddress),
|
SerializeAdapter::serialize(&startAddress, &data, &serLen, spParams.maxSize,
|
||||||
SerializeIF::Endianness::BIG);
|
SerializeIF::Endianness::BIG);
|
||||||
SerializeAdapter::serialize(&length, &data, &serLen, sizeof(length),
|
SerializeAdapter::serialize(&length, &data, &serLen, spParams.maxSize,
|
||||||
SerializeIF::Endianness::BIG);
|
SerializeIF::Endianness::BIG);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1119,7 +1119,6 @@ class WriteMemory : public ploc::SpTcBase {
|
|||||||
|
|
||||||
ReturnValue_t initPacket(uint8_t memoryId, uint32_t startAddr, uint16_t updateDataLen,
|
ReturnValue_t initPacket(uint8_t memoryId, uint32_t startAddr, uint16_t updateDataLen,
|
||||||
uint8_t* updateData) {
|
uint8_t* updateData) {
|
||||||
size_t serializedSize = 0;
|
|
||||||
uint8_t* data = payloadStart;
|
uint8_t* data = payloadStart;
|
||||||
if (updateDataLen % 2 != 0) {
|
if (updateDataLen % 2 != 0) {
|
||||||
spParams.setPayloadLen(META_DATA_LENGTH + updateDataLen + 1);
|
spParams.setPayloadLen(META_DATA_LENGTH + updateDataLen + 1);
|
||||||
@ -1131,13 +1130,14 @@ class WriteMemory : public ploc::SpTcBase {
|
|||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
SerializeAdapter::serialize(&memoryId, &data, &serializedSize, sizeof(memoryId),
|
size_t serializedSize = 6;
|
||||||
|
SerializeAdapter::serialize(&memoryId, &data, &serializedSize, spParams.maxSize,
|
||||||
SerializeIF::Endianness::BIG);
|
SerializeIF::Endianness::BIG);
|
||||||
SerializeAdapter::serialize(&n, &data, &serializedSize, sizeof(n),
|
SerializeAdapter::serialize(&n, &data, &serializedSize, spParams.maxSize,
|
||||||
SerializeIF::Endianness::BIG);
|
SerializeIF::Endianness::BIG);
|
||||||
SerializeAdapter::serialize(&startAddr, &data, &serializedSize, sizeof(startAddr),
|
SerializeAdapter::serialize(&startAddr, &data, &serializedSize, spParams.maxSize,
|
||||||
SerializeIF::Endianness::BIG);
|
SerializeIF::Endianness::BIG);
|
||||||
SerializeAdapter::serialize(&updateDataLen, &data, &serializedSize, sizeof(updateDataLen),
|
SerializeAdapter::serialize(&updateDataLen, &data, &serializedSize, spParams.maxSize,
|
||||||
SerializeIF::Endianness::BIG);
|
SerializeIF::Endianness::BIG);
|
||||||
std::memcpy(data, updateData, updateDataLen);
|
std::memcpy(data, updateData, updateDataLen);
|
||||||
if (updateDataLen % 2 != 0) {
|
if (updateDataLen % 2 != 0) {
|
||||||
@ -1178,17 +1178,15 @@ class EraseMemory : public ploc::SpTcBase {
|
|||||||
uint32_t length = 0;
|
uint32_t length = 0;
|
||||||
|
|
||||||
void initPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) {
|
void initPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) {
|
||||||
size_t serializedSize = 0;
|
|
||||||
uint8_t* data = payloadStart;
|
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);
|
SerializeIF::Endianness::BIG);
|
||||||
SerializeAdapter::serialize(&n, &data, &serializedSize, sizeof(n),
|
SerializeAdapter::serialize(&n, &data, &serializedSize, spParams.maxSize,
|
||||||
SerializeIF::Endianness::BIG);
|
SerializeIF::Endianness::BIG);
|
||||||
serializedSize = 0;
|
SerializeAdapter::serialize(&startAddress, &data, &serializedSize, spParams.maxSize,
|
||||||
SerializeAdapter::serialize(&startAddress, &data, &serializedSize, sizeof(startAddress),
|
|
||||||
SerializeIF::Endianness::BIG);
|
SerializeIF::Endianness::BIG);
|
||||||
serializedSize = 0;
|
SerializeAdapter::serialize(&length, &data, &serializedSize, spParams.maxSize,
|
||||||
SerializeAdapter::serialize(&length, &data, &serializedSize, sizeof(length),
|
|
||||||
SerializeIF::Endianness::BIG);
|
SerializeIF::Endianness::BIG);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -161,26 +161,32 @@ void PlocSupvHelper::stopProcess() { terminate = true; }
|
|||||||
|
|
||||||
ReturnValue_t PlocSupvHelper::performUpdate() {
|
ReturnValue_t PlocSupvHelper::performUpdate() {
|
||||||
ReturnValue_t result = RETURN_OK;
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
sif::info << "PlocSupvHelper::performUpdate: Calculating Image CRC" << std::endl;
|
||||||
result = calcImageCrc();
|
result = calcImageCrc();
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
sif::info << "PlocSupvHelper::performUpdate: Selecting Memory" << std::endl;
|
||||||
result = selectMemory();
|
result = selectMemory();
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
sif::info << "PlocSupvHelper::performUpdate: Preparing Update" << std::endl;
|
||||||
result = prepareUpdate();
|
result = prepareUpdate();
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
sif::info << "PlocSupvHelper::performUpdate: Erasing Memory" << std::endl;
|
||||||
result = eraseMemory();
|
result = eraseMemory();
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
sif::info << "PlocSupvHelper::performUpdate: Writing Update Packets" << std::endl;
|
||||||
result = writeUpdatePackets();
|
result = writeUpdatePackets();
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
sif::info << "PlocSupvHelper::performUpdate: Memory Check" << std::endl;
|
||||||
result = handleCheckMemoryCommand();
|
result = handleCheckMemoryCommand();
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
@ -317,6 +323,9 @@ ReturnValue_t PlocSupvHelper::prepareUpdate() {
|
|||||||
resetSpParams();
|
resetSpParams();
|
||||||
supv::ApidOnlyPacket packet(spParams, supv::APID_PREPARE_UPDATE);
|
supv::ApidOnlyPacket packet(spParams, supv::APID_PREPARE_UPDATE);
|
||||||
result = packet.buildPacket();
|
result = packet.buildPacket();
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
result = handlePacketTransmission(packet, PREPARE_UPDATE_EXECUTION_REPORT);
|
result = handlePacketTransmission(packet, PREPARE_UPDATE_EXECUTION_REPORT);
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
|
@ -178,11 +178,11 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha
|
|||||||
#ifdef XIPHOS_Q7S
|
#ifdef XIPHOS_Q7S
|
||||||
SdCardManager* sdcMan = nullptr;
|
SdCardManager* sdcMan = nullptr;
|
||||||
#endif
|
#endif
|
||||||
uint8_t commandBuffer[supv::MAX_COMMAND_SIZE];
|
uint8_t commandBuffer[supv::MAX_COMMAND_SIZE]{};
|
||||||
SpacePacketCreator creator;
|
SpacePacketCreator creator;
|
||||||
ploc::SpTcParams spParams = ploc::SpTcParams(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;
|
bool terminate = false;
|
||||||
|
|
||||||
|
@ -785,24 +785,24 @@ void IMTQHandler::fillRawMtmDataset(const uint8_t* packet) {
|
|||||||
int32_t yRaw = 0;
|
int32_t yRaw = 0;
|
||||||
int32_t zRaw = 0;
|
int32_t zRaw = 0;
|
||||||
uint32_t coilActStatus = 0;
|
uint32_t coilActStatus = 0;
|
||||||
auto res = SerializeAdapter::deSerialize(&xRaw, &dataStart, &deSerLen,
|
auto res =
|
||||||
SerializeIF::Endianness::LITTLE);
|
SerializeAdapter::deSerialize(&xRaw, &dataStart, &deSerLen, SerializeIF::Endianness::LITTLE);
|
||||||
if(res != HasReturnvaluesIF::RETURN_OK) {
|
if (res != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
res = SerializeAdapter::deSerialize(&yRaw, &dataStart, &deSerLen,
|
res =
|
||||||
SerializeIF::Endianness::LITTLE);
|
SerializeAdapter::deSerialize(&yRaw, &dataStart, &deSerLen, SerializeIF::Endianness::LITTLE);
|
||||||
if(res != HasReturnvaluesIF::RETURN_OK) {
|
if (res != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
res = SerializeAdapter::deSerialize(&zRaw, &dataStart, &deSerLen,
|
res =
|
||||||
SerializeIF::Endianness::LITTLE);
|
SerializeAdapter::deSerialize(&zRaw, &dataStart, &deSerLen, SerializeIF::Endianness::LITTLE);
|
||||||
if(res != HasReturnvaluesIF::RETURN_OK) {
|
if (res != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
res = SerializeAdapter::deSerialize(&coilActStatus, &dataStart, &deSerLen,
|
res = SerializeAdapter::deSerialize(&coilActStatus, &dataStart, &deSerLen,
|
||||||
SerializeIF::Endianness::LITTLE);
|
SerializeIF::Endianness::LITTLE);
|
||||||
if(res != HasReturnvaluesIF::RETURN_OK) {
|
if (res != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rawMtmMeasurementSet.mtmRawNt[0] = xRaw * 7.5;
|
rawMtmMeasurementSet.mtmRawNt[0] = xRaw * 7.5;
|
||||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
|||||||
Subproject commit 00e99292cc158a347f485507537fa5b63262243b
|
Subproject commit 1b39bb2ad2421db89487b4ea352edbd4d420b9b1
|
Loading…
Reference in New Issue
Block a user