add first CFDP events
This commit is contained in:
parent
bdbe0cc9da
commit
e893e73f86
@ -1,2 +1,3 @@
|
|||||||
target_sources(${LIB_FSFW_NAME} PRIVATE SourceHandler.cpp DestHandler.cpp
|
target_sources(
|
||||||
|
${LIB_FSFW_NAME} PRIVATE SourceHandler.cpp DestHandler.cpp
|
||||||
FaultHandlerBase.cpp UserBase.cpp CfdpHandler.cpp)
|
FaultHandlerBase.cpp UserBase.cpp CfdpHandler.cpp)
|
||||||
|
@ -12,7 +12,11 @@
|
|||||||
struct FsfwHandlerParams {
|
struct FsfwHandlerParams {
|
||||||
FsfwHandlerParams(object_id_t objectId, HasFileSystemIF& vfs, AcceptsTelemetryIF& packetDest,
|
FsfwHandlerParams(object_id_t objectId, HasFileSystemIF& vfs, AcceptsTelemetryIF& packetDest,
|
||||||
StorageManagerIF& tcStore, StorageManagerIF& tmStore, MessageQueueIF& msgQueue)
|
StorageManagerIF& tcStore, StorageManagerIF& tmStore, MessageQueueIF& msgQueue)
|
||||||
: objectId(objectId), vfs(vfs), packetDest(packetDest), tcStore(tcStore), tmStore(tmStore),
|
: objectId(objectId),
|
||||||
|
vfs(vfs),
|
||||||
|
packetDest(packetDest),
|
||||||
|
tcStore(tcStore),
|
||||||
|
tmStore(tmStore),
|
||||||
msgQueue(msgQueue) {}
|
msgQueue(msgQueue) {}
|
||||||
object_id_t objectId{};
|
object_id_t objectId{};
|
||||||
HasFileSystemIF& vfs;
|
HasFileSystemIF& vfs;
|
||||||
|
@ -427,22 +427,33 @@ ReturnValue_t cfdp::DestHandler::sendFinishedPdu() {
|
|||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
fp.tcStore->getFreeElement(&storeId, finishedPdu.getSerializedSize(), &dataPtr);
|
fp.tcStore->getFreeElement(&storeId, finishedPdu.getSerializedSize(), &dataPtr);
|
||||||
if (result != OK) {
|
if (result != OK) {
|
||||||
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
|
sif::warning << "cfdp::DestHandler:sendFinishedPdu: Getting store slot failed" << std::endl;
|
||||||
|
#endif
|
||||||
// TODO: Error handling and event, this is a non CFDP specific error (most likely store is full)
|
// TODO: Error handling and event, this is a non CFDP specific error (most likely store is full)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
size_t serLen = 0;
|
size_t serLen = 0;
|
||||||
result = finishedPdu.serialize(dataPtr, serLen, finishedPdu.getSerializedSize());
|
result = finishedPdu.serialize(dataPtr, serLen, finishedPdu.getSerializedSize());
|
||||||
if (result != OK) {
|
if (result != OK) {
|
||||||
// TODO: Error printout, this really should not happen
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
|
sif::warning << "cfdp::DestHandler::sendFinishedPdu: Serializing Finished PDU failed"
|
||||||
|
<< std::endl;
|
||||||
|
#endif
|
||||||
|
// TODO: Event, non CFDP specific error
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
TmTcMessage msg(storeId);
|
TmTcMessage msg(storeId);
|
||||||
result = fp.msgQueue->sendMessage(fp.packetDest.getReportReceptionQueue(), &msg);
|
result = fp.msgQueue->sendMessage(fp.packetDest.getReportReceptionQueue(), &msg);
|
||||||
if (result != OK) {
|
if (result != OK) {
|
||||||
// TODO: Error handling and event, this is a non CFDP specific error (most likely store is full)
|
// TODO: Error handling and event, this is a non CFDP specific error (most likely store is full)
|
||||||
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
|
sif::warning << "cfdp::DestHandler::sendFinishedPdu: Sending PDU failed" << std::endl;
|
||||||
|
#endif
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
fsmRes.packetsSent++;
|
fsmRes.packetsSent++;
|
||||||
|
sif::info << "Sent finished PDU" << std::endl;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,5 +5,15 @@ namespace cfdp {
|
|||||||
|
|
||||||
enum class CfdpStates { IDLE, BUSY_CLASS_1_NACKED, BUSY_CLASS_2_ACKED, SUSPENDED };
|
enum class CfdpStates { IDLE, BUSY_CLASS_1_NACKED, BUSY_CLASS_2_ACKED, SUSPENDED };
|
||||||
|
|
||||||
}
|
static constexpr uint8_t SSID = SUBSYSTEM_ID::CFDP;
|
||||||
|
|
||||||
|
namespace events {
|
||||||
|
|
||||||
|
static constexpr Event STORE_ERROR = event::makeEvent(SSID, 0, severity::LOW);
|
||||||
|
static constexpr Event MSG_QUEUE_ERROR = event::makeEvent(SSID, 1, severity::LOW);
|
||||||
|
static constexpr Event SERIALIZATION_ERROR = event::makeEvent(SSID, 2, severity::LOW);
|
||||||
|
|
||||||
|
} // namespace events
|
||||||
|
|
||||||
|
} // namespace cfdp
|
||||||
#endif // FSFW_CFDP_HANDLER_DEFS_H
|
#endif // FSFW_CFDP_HANDLER_DEFS_H
|
||||||
|
@ -33,6 +33,7 @@ enum : uint8_t {
|
|||||||
PUS_SERVICE_23 = 103,
|
PUS_SERVICE_23 = 103,
|
||||||
MGM_LIS3MDL = 106,
|
MGM_LIS3MDL = 106,
|
||||||
MGM_RM3100 = 107,
|
MGM_RM3100 = 107,
|
||||||
|
CFDP = 108,
|
||||||
|
|
||||||
FW_SUBSYSTEM_ID_RANGE
|
FW_SUBSYSTEM_ID_RANGE
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user