something hangs up
This commit is contained in:
parent
1b92aa03f3
commit
c7b90fb8e0
@ -578,8 +578,8 @@ ReturnValue_t PlocSupervisorHandler::scanForReply(const uint8_t* start, size_t r
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
tmReader.setData(start, remainingSize);
|
tmReader.setData(start, remainingSize);
|
||||||
sif::debug << "PlocSupervisorHandler::scanForReply: Received Packet" << std::endl;
|
// sif::debug << "PlocSupervisorHandler::scanForReply: Received Packet" << std::endl;
|
||||||
arrayprinter::print(start, remainingSize);
|
// arrayprinter::print(start, remainingSize);
|
||||||
uint16_t apid = tmReader.getModuleApid();
|
uint16_t apid = tmReader.getModuleApid();
|
||||||
|
|
||||||
switch (apid) {
|
switch (apid) {
|
||||||
|
@ -68,8 +68,8 @@ ReturnValue_t PlocSupvUartManager::initializeInterface(CookieIF* cookie) {
|
|||||||
// Use non-canonical mode and clear echo flag
|
// Use non-canonical mode and clear echo flag
|
||||||
tty.c_lflag &= ~(ICANON | ECHO);
|
tty.c_lflag &= ~(ICANON | ECHO);
|
||||||
|
|
||||||
// Blocking mode, 0.5 seconds timeout
|
// Blocking mode, 0.2 seconds timeout
|
||||||
tty.c_cc[VTIME] = 5;
|
tty.c_cc[VTIME] = 2;
|
||||||
tty.c_cc[VMIN] = 0;
|
tty.c_cc[VMIN] = 0;
|
||||||
|
|
||||||
uart::setBaudrate(tty, uartCookie->getBaudrate());
|
uart::setBaudrate(tty, uartCookie->getBaudrate());
|
||||||
@ -429,8 +429,7 @@ ReturnValue_t PlocSupvUartManager::writeUpdatePackets() {
|
|||||||
update.bytesWritten);
|
update.bytesWritten);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = handlePacketTransmissionNoReply(packet);
|
result = handlePacketTransmissionNoReply(packet, 2000);
|
||||||
// result = encodeAndSendPacket(packet.getFullPacket(), packet.getFullPacketLen());
|
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
triggerEvent(WRITE_MEMORY_FAILED, buildProgParams1(progPercent, update.sequenceCount),
|
triggerEvent(WRITE_MEMORY_FAILED, buildProgParams1(progPercent, update.sequenceCount),
|
||||||
update.bytesWritten);
|
update.bytesWritten);
|
||||||
@ -494,19 +493,6 @@ uint32_t PlocSupvUartManager::buildProgParams1(uint8_t percent, uint16_t seqCoun
|
|||||||
// return result;
|
// return result;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
ReturnValue_t PlocSupvUartManager::handleRemainingExeReport(ploc::SpTmReader& reader) {
|
|
||||||
size_t remBytes = reader.getPacketDataLen() + 1;
|
|
||||||
ReturnValue_t result = handleTmReception(remBytes, tmBuf.data() + ccsds::HEADER_LEN);
|
|
||||||
if (result != returnvalue::OK) {
|
|
||||||
sif::warning << "Reading exe failure report failed" << std::endl;
|
|
||||||
}
|
|
||||||
result = exeReportHandling();
|
|
||||||
if (result != returnvalue::OK) {
|
|
||||||
sif::warning << "Handling exe report failed" << std::endl;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t PlocSupvUartManager::selectMemory() {
|
ReturnValue_t PlocSupvUartManager::selectMemory() {
|
||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
resetSpParams();
|
resetSpParams();
|
||||||
@ -515,7 +501,7 @@ ReturnValue_t PlocSupvUartManager::selectMemory() {
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result = handlePacketTransmissionNoReply(packet);
|
result = handlePacketTransmissionNoReply(packet, 2000);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -580,7 +566,6 @@ ReturnValue_t PlocSupvUartManager::handlePacketTransmissionNoReply(
|
|||||||
if (not ackReceived) {
|
if (not ackReceived) {
|
||||||
retval = handleAckReception(packet, packetLen);
|
retval = handleAckReception(packet, packetLen);
|
||||||
if (retval == 1) {
|
if (retval == 1) {
|
||||||
sif::debug << "ACK received" << std::endl;
|
|
||||||
ackReceived = true;
|
ackReceived = true;
|
||||||
packetWasHandled = true;
|
packetWasHandled = true;
|
||||||
} else if (retval == -1) {
|
} else if (retval == -1) {
|
||||||
@ -589,7 +574,6 @@ ReturnValue_t PlocSupvUartManager::handlePacketTransmissionNoReply(
|
|||||||
} else {
|
} else {
|
||||||
retval = handleExeAckReception(packet, packetLen);
|
retval = handleExeAckReception(packet, packetLen);
|
||||||
if (retval == 1) {
|
if (retval == 1) {
|
||||||
sif::debug << "EXE ACK received" << std::endl;
|
|
||||||
break;
|
break;
|
||||||
} else if (retval == -1) {
|
} else if (retval == -1) {
|
||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
@ -601,7 +585,7 @@ ReturnValue_t PlocSupvUartManager::handlePacketTransmissionNoReply(
|
|||||||
decodedRingBuf.deleteData(packetLen);
|
decodedRingBuf.deleteData(packetLen);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TaskFactory::delayTask(50);
|
TaskFactory::delayTask(20);
|
||||||
}
|
}
|
||||||
if (countdown.hasTimedOut()) {
|
if (countdown.hasTimedOut()) {
|
||||||
return result::NO_REPLY_TIMEOUT;
|
return result::NO_REPLY_TIMEOUT;
|
||||||
@ -777,7 +761,6 @@ ReturnValue_t PlocSupvUartManager::handleCheckMemoryCommand(uint8_t failStep) {
|
|||||||
if (retval == 1) {
|
if (retval == 1) {
|
||||||
packetWasHandled = true;
|
packetWasHandled = true;
|
||||||
exeReceived = true;
|
exeReceived = true;
|
||||||
break;
|
|
||||||
} else if (retval == -1) {
|
} else if (retval == -1) {
|
||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
@ -795,7 +778,6 @@ ReturnValue_t PlocSupvUartManager::handleCheckMemoryCommand(uint8_t failStep) {
|
|||||||
result = report.verifyCrc(update.crc);
|
result = report.verifyCrc(update.crc);
|
||||||
if (result == returnvalue::OK) {
|
if (result == returnvalue::OK) {
|
||||||
triggerEvent(SUPV_MEM_CHECK_OK, result);
|
triggerEvent(SUPV_MEM_CHECK_OK, result);
|
||||||
return result;
|
|
||||||
} else {
|
} else {
|
||||||
sif::warning
|
sif::warning
|
||||||
|
|
||||||
@ -813,7 +795,7 @@ ReturnValue_t PlocSupvUartManager::handleCheckMemoryCommand(uint8_t failStep) {
|
|||||||
decodedRingBuf.deleteData(packetLen);
|
decodedRingBuf.deleteData(packetLen);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TaskFactory::delayTask(50);
|
TaskFactory::delayTask(20);
|
||||||
}
|
}
|
||||||
if (ackReceived and exeReceived and checkReplyReceived) {
|
if (ackReceived and exeReceived and checkReplyReceived) {
|
||||||
break;
|
break;
|
||||||
@ -823,7 +805,6 @@ ReturnValue_t PlocSupvUartManager::handleCheckMemoryCommand(uint8_t failStep) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t PlocSupvUartManager::getFileSize(std::string filename) {
|
uint32_t PlocSupvUartManager::getFileSize(std::string filename) {
|
||||||
@ -963,8 +944,10 @@ ReturnValue_t PlocSupvUartManager::handleRunningLongerRequest() {
|
|||||||
ReturnValue_t PlocSupvUartManager::encodeAndSendPacket(const uint8_t* sendData, size_t sendLen) {
|
ReturnValue_t PlocSupvUartManager::encodeAndSendPacket(const uint8_t* sendData, size_t sendLen) {
|
||||||
size_t encodedLen = 0;
|
size_t encodedLen = 0;
|
||||||
addHdlcFraming(sendData, sendLen, encodedSendBuf.data(), &encodedLen, encodedSendBuf.size());
|
addHdlcFraming(sendData, sendLen, encodedSendBuf.data(), &encodedLen, encodedSendBuf.size());
|
||||||
sif::debug << "Sending TC" << std::endl;
|
if (printTc) {
|
||||||
arrayprinter::print(encodedSendBuf.data(), encodedLen);
|
sif::debug << "Sending TC" << std::endl;
|
||||||
|
arrayprinter::print(encodedSendBuf.data(), encodedLen);
|
||||||
|
}
|
||||||
size_t bytesWritten = write(serialPort, encodedSendBuf.data(), encodedLen);
|
size_t bytesWritten = write(serialPort, encodedSendBuf.data(), encodedLen);
|
||||||
if (bytesWritten != encodedLen) {
|
if (bytesWritten != encodedLen) {
|
||||||
sif::warning
|
sif::warning
|
||||||
|
@ -253,6 +253,7 @@ class PlocSupvUartManager : public DeviceCommunicationIF,
|
|||||||
|
|
||||||
std::array<uint8_t, supv::MAX_COMMAND_SIZE> tmBuf{};
|
std::array<uint8_t, supv::MAX_COMMAND_SIZE> tmBuf{};
|
||||||
|
|
||||||
|
bool printTc = false;
|
||||||
bool debugMode = false;
|
bool debugMode = false;
|
||||||
bool timestamping = true;
|
bool timestamping = true;
|
||||||
|
|
||||||
@ -275,7 +276,7 @@ class PlocSupvUartManager : public DeviceCommunicationIF,
|
|||||||
ReturnValue_t writeUpdatePackets();
|
ReturnValue_t writeUpdatePackets();
|
||||||
// ReturnValue_t performEventBufferRequest();
|
// ReturnValue_t performEventBufferRequest();
|
||||||
ReturnValue_t handlePacketTransmissionNoReply(supv::TcBase& packet,
|
ReturnValue_t handlePacketTransmissionNoReply(supv::TcBase& packet,
|
||||||
uint32_t timeoutExecutionReport = 60000);
|
uint32_t timeoutExecutionReport);
|
||||||
int handleAckReception(supv::TcBase& tc, size_t packetLen);
|
int handleAckReception(supv::TcBase& tc, size_t packetLen);
|
||||||
int handleExeAckReception(supv::TcBase& tc, size_t packetLen);
|
int handleExeAckReception(supv::TcBase& tc, size_t packetLen);
|
||||||
|
|
||||||
@ -310,7 +311,6 @@ class PlocSupvUartManager : public DeviceCommunicationIF,
|
|||||||
*/
|
*/
|
||||||
uint32_t getFileSize(std::string filename);
|
uint32_t getFileSize(std::string filename);
|
||||||
ReturnValue_t handleEventBufferReception(ploc::SpTmReader& reader);
|
ReturnValue_t handleEventBufferReception(ploc::SpTmReader& reader);
|
||||||
ReturnValue_t handleRemainingExeReport(ploc::SpTmReader& reader);
|
|
||||||
|
|
||||||
void resetSpParams();
|
void resetSpParams();
|
||||||
void pushIpcData(const uint8_t* data, size_t len);
|
void pushIpcData(const uint8_t* data, size_t len);
|
||||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
|||||||
Subproject commit 70a1d49246b5bd5297c22d336e9dd8f58f019f90
|
Subproject commit 292bafa0918d386e7f64bf9ed0e114a887420899
|
Loading…
Reference in New Issue
Block a user