PLOC SUPV Update to newer firmware #316

Merged
muellerr merged 99 commits from mueller/tas_ploc_supv_update into develop 2022-11-18 14:27:13 +01:00
2 changed files with 7 additions and 7 deletions
Showing only changes of commit 3be45b32ef - Show all commits

View File

@ -109,7 +109,7 @@ ReturnValue_t PlocSupvHelper::performOperation(uint8_t operationCode) {
putTaskToSleep = true; putTaskToSleep = true;
break; break;
} }
case InternalState::LONGER_REQUEST: { case InternalState::DEDICATED_REQUEST: {
if (handleRunningLongerRequest() == REQUEST_DONE) { if (handleRunningLongerRequest() == REQUEST_DONE) {
MutexGuard mg(lock); MutexGuard mg(lock);
state = InternalState::DEFAULT; state = InternalState::DEFAULT;
@ -219,7 +219,7 @@ ReturnValue_t PlocSupvHelper::performUpdate(const supv::UpdateParams& params) {
update.packetNum = 1; update.packetNum = 1;
update.deleteMemory = params.deleteMemory; update.deleteMemory = params.deleteMemory;
update.sequenceCount = params.seqCount; update.sequenceCount = params.seqCount;
state = InternalState::LONGER_REQUEST; state = InternalState::DEDICATED_REQUEST;
request = Request::UPDATE; request = Request::UPDATE;
} }
return result; return result;
@ -243,7 +243,7 @@ ReturnValue_t PlocSupvHelper::performMemCheck(std::string file, uint8_t memoryId
MutexGuard mg(lock); MutexGuard mg(lock);
update.file = file; update.file = file;
update.fullFileSize = getFileSize(file); update.fullFileSize = getFileSize(file);
state = InternalState::LONGER_REQUEST; state = InternalState::DEDICATED_REQUEST;
request = Request::CHECK_MEMORY; request = Request::CHECK_MEMORY;
update.memoryId = memoryId; update.memoryId = memoryId;
update.startAddress = startAddress; update.startAddress = startAddress;
@ -261,7 +261,7 @@ ReturnValue_t PlocSupvHelper::initiateUpdateContinuation() {
return HasActionsIF::IS_BUSY; return HasActionsIF::IS_BUSY;
} }
MutexGuard mg(lock); MutexGuard mg(lock);
state = InternalState::LONGER_REQUEST; state = InternalState::DEDICATED_REQUEST;
request = Request::CONTINUE_UPDATE; request = Request::CONTINUE_UPDATE;
return returnvalue::OK; return returnvalue::OK;
} }
@ -884,7 +884,7 @@ ReturnValue_t PlocSupvHelper::sendMessage(CookieIF* cookie, const uint8_t* sendD
return FAILED; return FAILED;
} }
lock->lockMutex(); lock->lockMutex();
if (state == InternalState::SLEEPING or state == InternalState::LONGER_REQUEST) { if (state == InternalState::SLEEPING or state == InternalState::DEDICATED_REQUEST) {
lock->unlockMutex(); lock->unlockMutex();
return FAILED; return FAILED;
} }
@ -979,7 +979,7 @@ ReturnValue_t PlocSupvHelper::tryHdlcParsing() {
ReturnValue_t result = parseRecRingBufForHdlc(bytesRead); ReturnValue_t result = parseRecRingBufForHdlc(bytesRead);
if (result == returnvalue::OK) { if (result == returnvalue::OK) {
// Packet found, advance read pointer. // Packet found, advance read pointer.
if (state == InternalState::LONGER_REQUEST) { if (state == InternalState::DEDICATED_REQUEST) {
decodedRingBuf.writeData(decodedBuf.data(), bytesRead); decodedRingBuf.writeData(decodedBuf.data(), bytesRead);
decodedQueue.insert(bytesRead); decodedQueue.insert(bytesRead);
} else { } else {

View File

@ -214,7 +214,7 @@ class PlocSupvHelper : public DeviceCommunicationIF,
EventBufferRequest eventBufferReq; EventBufferRequest eventBufferReq;
enum class InternalState { SLEEPING, DEFAULT, LONGER_REQUEST, GO_TO_SLEEP }; enum class InternalState { SLEEPING, DEFAULT, DEDICATED_REQUEST, GO_TO_SLEEP };
enum class Request { enum class Request {
DEFAULT, DEFAULT,