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 DEFAULT_CMD_TIMEOUT_MS = 5000;
|
||||||
static constexpr uint32_t CMD_TIMEOUT_MKFS = 15000;
|
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;
|
static const uint8_t INTERFACE_ID = CLASS_ID::MPSOC_RETURN_VALUES_IF;
|
||||||
|
|
||||||
@ -504,14 +504,14 @@ class TcFlashMkfs : public TcBase {
|
|||||||
public:
|
public:
|
||||||
TcFlashMkfs(ploc::SpTcParams params, uint16_t sequenceCount, FlashId flashId)
|
TcFlashMkfs(ploc::SpTcParams params, uint16_t sequenceCount, FlashId flashId)
|
||||||
: TcBase(params, apid::TC_FLASH_MKFS, sequenceCount) {
|
: 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) {
|
if (flashId == FlashId::FLASH_1) {
|
||||||
flashIdStr = "1:/";
|
flashIdStr = "1:\\";
|
||||||
}
|
}
|
||||||
std::memcpy(payloadStart, flashIdStr, 3);
|
std::memcpy(payloadStart, flashIdStr, 3);
|
||||||
// Null terminator
|
// Null terminator
|
||||||
payloadStart[3] = 0;
|
payloadStart[3] = 0;
|
||||||
|
spParams.setFullPayloadLen(4 + CRC_SIZE);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1079,29 +1079,25 @@ class TcSimplexStoreFile : public TcBase {
|
|||||||
return INVALID_PARAMETER;
|
return INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
std::string fileName(reinterpret_cast<const char*>(*dataPtr));
|
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;
|
return FILENAME_TOO_LONG;
|
||||||
}
|
}
|
||||||
size_t currentCopyIdx = 0;
|
sif::debug << "file name: " << fileName << std::endl;
|
||||||
size_t payloadLen = fileName.length() + sizeof(NULL_TERMINATOR) + CRC_SIZE;
|
char divStr[16]{};
|
||||||
if (chunkParameter > 1) {
|
sprintf(divStr, "DIV%03u", chunkParameter);
|
||||||
char divStr[16]{};
|
sif::debug << "div str: " << divStr << std::endl;
|
||||||
sprintf(divStr, "DIV%03u", chunkParameter);
|
std::memcpy(payloadStart, divStr, DIV_STR_LEN);
|
||||||
std::memcpy(payloadStart, divStr, DIV_STR_LEN);
|
std::memset(payloadStart + DIV_STR_LEN, 0, FILENAME_FIELD_SIZE);
|
||||||
payloadLen += DIV_STR_LEN;
|
std::memcpy(payloadStart + DIV_STR_LEN, fileName.data(), fileName.length());
|
||||||
currentCopyIdx += DIV_STR_LEN;
|
spParams.setFullPayloadLen(DIV_STR_LEN + FILENAME_FIELD_SIZE + CRC_SIZE);
|
||||||
}
|
|
||||||
|
|
||||||
std::memcpy(payloadStart + currentCopyIdx, *dataPtr, fileName.length());
|
|
||||||
spParams.setFullPayloadLen(payloadLen);
|
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32_t chunkParameter = 0;
|
uint32_t chunkParameter = 0;
|
||||||
static constexpr size_t MAX_DATA_LENGTH = 256;
|
|
||||||
static constexpr size_t MIN_DATA_LENGTH = 4;
|
static constexpr size_t MIN_DATA_LENGTH = 4;
|
||||||
static constexpr size_t DIV_STR_LEN = 6;
|
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