flash read command
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Jakob Meier
2021-12-23 11:07:19 +01:00
parent 76f840f137
commit 8cddbf86d9
6 changed files with 41 additions and 30 deletions

View File

@ -154,14 +154,14 @@ ReturnValue_t StrHelper::startFlashWrite(std::string flashWriteFile_, uint8_t re
return RETURN_OK;
}
ReturnValue_t StrHelper::startFlashRead(std::string flashReadFile_, uint8_t region,
uint32_t address, uint16_t length) {
ReturnValue_t result = checkPath(flashReadFile_);
ReturnValue_t StrHelper::startFlashRead(std::string flashReadPath_, uint8_t region,
uint32_t address, uint32_t length) {
ReturnValue_t result = checkPath(flashReadPath_);
if (result != RETURN_OK) {
return result;
}
flashReadFile = flashReadFile_;
if(not std::filesystem::exists(flashReadFile)) {
flashReadPath = flashReadPath_;
if(not std::filesystem::exists(flashReadPath)) {
return FILE_NOT_EXISTS;
}
flashReadAddress = address;
@ -456,14 +456,13 @@ ReturnValue_t StrHelper::checkReply() {
if (type != TMTC_ACTIONREPLY) {
sif::warning << "StrHelper::checkReply: Received reply with invalid type ID"
<< std::endl;
triggerEvent(INVALID_TYPE_ID);
return RETURN_FAILED;
return INVALID_TYPE_ID;
}
uint8_t status = datalinkLayer.getStatusField();
if (status != ArcsecDatalinkLayer::STATUS_OK) {
triggerEvent(STATUS_ERROR);
sif::warning << "StrHelper::checkReply: Status failure" << std::endl;
return RETURN_FAILED;
sif::warning << "StrHelper::checkReply: Status failure: "
<< static_cast<unsigned int>(status) << std::endl;
return STATUS_ERROR;
}
return RETURN_OK;
}
@ -511,7 +510,7 @@ ReturnValue_t StrHelper::checkFlashActionReply(uint8_t region_, uint32_t address
if (address != address_) {
return ADDRESS_MISMATCH;
}
if (region != length_) {
if (length != length_) {
return LENGTH_MISMATCH;
}
return RETURN_OK;