CFDP SOURCE handler #157
@ -267,20 +267,16 @@ ReturnValue_t cfdp::SourceHandler::prepareAndSendNextFileDataPdu(bool& noFileDat
|
|||||||
addError(result);
|
addError(result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
sif::debug << "sending next fd pdu, offset " << offset.value() << "" << std::endl;
|
|
||||||
auto fileDataInfo = FileDataInfo(offset, fileBuf.data(), readLen);
|
auto fileDataInfo = FileDataInfo(offset, fileBuf.data(), readLen);
|
||||||
auto fileDataPdu = FileDataCreator(transactionParams.pduConf, fileDataInfo);
|
auto fileDataPdu = FileDataCreator(transactionParams.pduConf, fileDataInfo);
|
||||||
result = sendGenericPdu(fileDataPdu);
|
result = sendGenericPdu(fileDataPdu);
|
||||||
if (result != OK) {
|
if (result != OK) {
|
||||||
sif::debug << "SENDING generic PDU failed" << std::endl;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
transactionParams.progress += readLen;
|
transactionParams.progress += readLen;
|
||||||
if (transactionParams.progress >= fileSize) {
|
if (transactionParams.progress >= fileSize) {
|
||||||
// Advance FSM after all file data PDUs were sent.
|
// Advance FSM after all file data PDUs were sent.
|
||||||
step = TransactionStep::SENDING_EOF;
|
step = TransactionStep::SENDING_EOF;
|
||||||
sif::debug << "done" << std::endl;
|
|
||||||
TaskFactory::delayTask(10000);
|
|
||||||
}
|
}
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ TcpTmTcBridge::TcpTmTcBridge(object_id_t objectId, object_id_t tcDestination,
|
|||||||
: TmTcBridge("TCP TMTC Bridge", objectId, tcDestination, msgQueueDepth, tmStoreId, tcStoreId) {
|
: TmTcBridge("TCP TMTC Bridge", objectId, tcDestination, msgQueueDepth, tmStoreId, tcStoreId) {
|
||||||
mutex = MutexFactory::instance()->createMutex();
|
mutex = MutexFactory::instance()->createMutex();
|
||||||
// Connection is always up, TM is requested by connecting to server and receiving packets
|
// Connection is always up, TM is requested by connecting to server and receiving packets
|
||||||
registerCommConnect();
|
TmTcBridge::registerCommConnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t TcpTmTcBridge::initialize() {
|
ReturnValue_t TcpTmTcBridge::initialize() {
|
||||||
|
@ -134,8 +134,8 @@ ReturnValue_t TmTcBridge::handleTmQueue() {
|
|||||||
#endif
|
#endif
|
||||||
#endif /* FSFW_VERBOSE_LEVEL >= 3 */
|
#endif /* FSFW_VERBOSE_LEVEL >= 3 */
|
||||||
|
|
||||||
if (communicationLinkUp == false or packetSentCounter >= sentPacketsPerCycle) {
|
if (!communicationLinkUp or packetSentCounter >= sentPacketsPerCycle) {
|
||||||
ReturnValue_t result = storeDownlinkData(&message);
|
result = storeDownlinkData(&message);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
tmStore->deleteData(message.getStorageId());
|
tmStore->deleteData(message.getStorageId());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user