CFDP SOURCE handler #157

Merged
muellerr merged 107 commits from cfdp-source-handler into develop 2023-10-19 10:59:55 +02:00
5 changed files with 58 additions and 1 deletions
Showing only changes of commit 66704dc571 - Show all commits

View File

@ -143,6 +143,20 @@ enum RecordContinuationState {
CONTAINS_START_AND_END = 0b11 CONTAINS_START_AND_END = 0b11
}; };
enum class ProxyOpMessageType : uint8_t {
PUT_REQUEST = 0x00,
MSG_TO_USR = 0x01,
FS_REQUEST = 0x02,
FAULT_HANDLER_OVERRIDE = 0x03,
TRANSMISSION_MODE = 0x04,
FLOW_LABEL = 0x05,
SEG_CTRL = 0x06,
PUT_RESPONSE = 0x07,
FS_RESPONSE = 0x08,
PUT_CANCEL = 0x09,
CLOSURE = 0x0b
};
} // namespace cfdp } // namespace cfdp
#endif /* FSFW_SRC_FSFW_CFDP_PDU_DEFINITIONS_H_ */ #endif /* FSFW_SRC_FSFW_CFDP_PDU_DEFINITIONS_H_ */

View File

@ -1 +1,16 @@
#include "MsgToUserParser.h" #include "MsgToUserParser.h"
#include "fsfw/cfdp/tlv/MessageToUserTlv.h"
#include "fsfw/ipc/QueueFactory.h"
cfdp::MsgsToUserParser::MsgsToUserParser(StorageManagerIF& ipcStore, uint32_t messageQueueDepth)
: ipcStore(ipcStore) {
messageQueue = QueueFactory::instance()->createMessageQueue(messageQueueDepth);
}
ReturnValue_t cfdp::MsgsToUserParser::parseMsgs(const uint8_t* msgsToUserPtr,
size_t sizeOfMessages) {
size_t currentIdx = 0;
while (currentIdx < sizeOfMessages) {
}
return 0;
}

View File

@ -1,9 +1,24 @@
#pragma once #pragma once
#include "fsfw/ipc/MessageQueueIF.h"
#include "fsfw/storagemanager/StorageManagerIF.h"
namespace cfdp { namespace cfdp {
/**
* This class parses messages to user for special CFDP messages and converts them to appropriate
* CFDP requests sent via the IPC store where applicable. It also provides an API to retrieve
* custom messages which are not special CFDP messages from a provided bytestream.
*/
class MsgsToUserParser { class MsgsToUserParser {
public:
MsgsToUserParser(StorageManagerIF& ipcStore, uint32_t queueDepth);
ReturnValue_t parseMsgs(const uint8_t* msgsToUserPtr, size_t sizeOfMessages);
private:
MessageQueueIF* messageQueue;
StorageManagerIF& ipcStore;
}; };
} } // namespace cfdp

View File

@ -10,3 +10,14 @@ MessageToUserTlv::MessageToUserTlv(const std::vector<uint8_t>& data)
MessageToUserTlv::MessageToUserTlv(const uint8_t* value, size_t size) MessageToUserTlv::MessageToUserTlv(const uint8_t* value, size_t size)
: Tlv(cfdp::TlvType::MSG_TO_USER, value, size) {} : Tlv(cfdp::TlvType::MSG_TO_USER, value, size) {}
bool MessageToUserTlv::isReservedCfdpMessage(uint8_t& messageType) const {
if (cfdp::Tlv::getLengthField() < 5) {
return false;
}
if (std::strcmp(reinterpret_cast<const char*>(getValue()), "cfdp") == 0) {
messageType = getValue()[4];
return true;
}
return false;
}

View File

@ -12,6 +12,8 @@ class MessageToUserTlv : public cfdp::Tlv {
MessageToUserTlv(const uint8_t* value, size_t size); MessageToUserTlv(const uint8_t* value, size_t size);
explicit MessageToUserTlv(const std::vector<uint8_t>& data); explicit MessageToUserTlv(const std::vector<uint8_t>& data);
bool isReservedCfdpMessage(uint8_t& messageType) const;
private: private:
}; };