CFDP SOURCE handler #157
@ -143,6 +143,20 @@ enum RecordContinuationState {
|
||||
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
|
||||
|
||||
#endif /* FSFW_SRC_FSFW_CFDP_PDU_DEFINITIONS_H_ */
|
||||
|
@ -1 +1,16 @@
|
||||
#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;
|
||||
}
|
||||
|
@ -1,9 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include "fsfw/ipc/MessageQueueIF.h"
|
||||
#include "fsfw/storagemanager/StorageManagerIF.h"
|
||||
|
||||
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 {
|
||||
public:
|
||||
MsgsToUserParser(StorageManagerIF& ipcStore, uint32_t queueDepth);
|
||||
|
||||
ReturnValue_t parseMsgs(const uint8_t* msgsToUserPtr, size_t sizeOfMessages);
|
||||
|
||||
private:
|
||||
MessageQueueIF* messageQueue;
|
||||
StorageManagerIF& ipcStore;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace cfdp
|
||||
|
@ -10,3 +10,14 @@ MessageToUserTlv::MessageToUserTlv(const std::vector<uint8_t>& data)
|
||||
|
||||
MessageToUserTlv::MessageToUserTlv(const uint8_t* value, size_t 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;
|
||||
}
|
||||
|
@ -12,6 +12,8 @@ class MessageToUserTlv : public cfdp::Tlv {
|
||||
MessageToUserTlv(const uint8_t* value, size_t size);
|
||||
explicit MessageToUserTlv(const std::vector<uint8_t>& data);
|
||||
|
||||
bool isReservedCfdpMessage(uint8_t& messageType) const;
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user