some important bugfixes
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
This commit is contained in:
parent
cc863503ac
commit
b9ad396fb4
@ -17,7 +17,7 @@ namespace mpsoc {
|
||||
static constexpr uint32_t DEFAULT_CMD_TIMEOUT_MS = 5000;
|
||||
static constexpr uint32_t CMD_TIMEOUT_MKFS = 15000;
|
||||
|
||||
enum FlashId : uint8_t { FLASH_0 = 0, FLASH_1 = 0 };
|
||||
enum FlashId : uint8_t { FLASH_0 = 0, FLASH_1 = 1 };
|
||||
|
||||
static const uint8_t INTERFACE_ID = CLASS_ID::MPSOC_RETURN_VALUES_IF;
|
||||
|
||||
@ -504,14 +504,14 @@ class TcFlashMkfs : public TcBase {
|
||||
public:
|
||||
TcFlashMkfs(ploc::SpTcParams params, uint16_t sequenceCount, FlashId flashId)
|
||||
: TcBase(params, apid::TC_FLASH_MKFS, sequenceCount) {
|
||||
spParams.setFullPayloadLen(1 + CRC_SIZE);
|
||||
const char* flashIdStr = "0:/";
|
||||
const char* flashIdStr = "0:\\";
|
||||
if (flashId == FlashId::FLASH_1) {
|
||||
flashIdStr = "1:/";
|
||||
flashIdStr = "1:\\";
|
||||
}
|
||||
std::memcpy(payloadStart, flashIdStr, 3);
|
||||
// Null terminator
|
||||
payloadStart[3] = 0;
|
||||
spParams.setFullPayloadLen(4 + CRC_SIZE);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1079,29 +1079,25 @@ class TcSimplexStoreFile : public TcBase {
|
||||
return INVALID_PARAMETER;
|
||||
}
|
||||
std::string fileName(reinterpret_cast<const char*>(*dataPtr));
|
||||
if (fileName.size() + sizeof(NULL_TERMINATOR) > FILENAME_FIELD_SIZE) {
|
||||
if (fileName.size() > MAX_FILENAME_SIZE) {
|
||||
return FILENAME_TOO_LONG;
|
||||
}
|
||||
size_t currentCopyIdx = 0;
|
||||
size_t payloadLen = fileName.length() + sizeof(NULL_TERMINATOR) + CRC_SIZE;
|
||||
if (chunkParameter > 1) {
|
||||
char divStr[16]{};
|
||||
sprintf(divStr, "DIV%03u", chunkParameter);
|
||||
std::memcpy(payloadStart, divStr, DIV_STR_LEN);
|
||||
payloadLen += DIV_STR_LEN;
|
||||
currentCopyIdx += DIV_STR_LEN;
|
||||
}
|
||||
|
||||
std::memcpy(payloadStart + currentCopyIdx, *dataPtr, fileName.length());
|
||||
spParams.setFullPayloadLen(payloadLen);
|
||||
sif::debug << "file name: " << fileName << std::endl;
|
||||
char divStr[16]{};
|
||||
sprintf(divStr, "DIV%03u", chunkParameter);
|
||||
sif::debug << "div str: " << divStr << std::endl;
|
||||
std::memcpy(payloadStart, divStr, DIV_STR_LEN);
|
||||
std::memset(payloadStart + DIV_STR_LEN, 0, FILENAME_FIELD_SIZE);
|
||||
std::memcpy(payloadStart + DIV_STR_LEN, fileName.data(), fileName.length());
|
||||
spParams.setFullPayloadLen(DIV_STR_LEN + FILENAME_FIELD_SIZE + CRC_SIZE);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
private:
|
||||
uint32_t chunkParameter = 0;
|
||||
static constexpr size_t MAX_DATA_LENGTH = 256;
|
||||
static constexpr size_t MIN_DATA_LENGTH = 4;
|
||||
static constexpr size_t DIV_STR_LEN = 6;
|
||||
static constexpr size_t MAX_DATA_LENGTH = DIV_STR_LEN + FILENAME_FIELD_SIZE;
|
||||
};
|
||||
|
||||
/**
|
||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit a59aceda751bd1594b91c632fe0ae85b844707df
|
||||
Subproject commit f9041f215aa39df2df314b6353c098853ac64426
|
Loading…
Reference in New Issue
Block a user