CFDP SOURCE handler #157
@ -26,6 +26,7 @@ void cfdp::SourceHandler::fsmNacked() {
|
||||
if (result != OK) {
|
||||
// TODO: Some error handling
|
||||
}
|
||||
step = TransactionStep::SENDING_METADATA;
|
||||
}
|
||||
if (step == TransactionStep::SENDING_METADATA) {
|
||||
// TODO: Prepare and send metadata PDU
|
||||
@ -83,9 +84,18 @@ ReturnValue_t cfdp::SourceHandler::checksumGeneration() {
|
||||
}
|
||||
|
||||
ReturnValue_t cfdp::SourceHandler::putRequest(PutRequestFull& putRequest, RemoteEntityCfg& cfg) {
|
||||
if (state != CfdpState::IDLE) {
|
||||
return SOURCE_TRANSACTION_PENDING;
|
||||
}
|
||||
transactionParams.closureRequested = putRequest.closureRequested;
|
||||
transactionParams.destId = putRequest.destId;
|
||||
transactionParams.transmissionMode = putRequest.transmissionMode;
|
||||
if (transactionParams.transmissionMode == TransmissionMode::ACKNOWLEDGED) {
|
||||
state = cfdp::CfdpState::BUSY_CLASS_2_ACKED;
|
||||
} else if (transactionParams.transmissionMode == TransmissionMode::UNACKNOWLEDGED) {
|
||||
state = cfdp::CfdpState::BUSY_CLASS_1_NACKED;
|
||||
}
|
||||
step = TransactionStep::IDLE;
|
||||
if (transactionParams.transmissionMode == TransmissionMode::ACKNOWLEDGED) {
|
||||
}
|
||||
if (putRequest.sourceNameSize > transactionParams.sourceName.size()) {
|
||||
|
@ -12,6 +12,7 @@ namespace cfdp {
|
||||
enum class CfdpState { IDLE, BUSY_CLASS_1_NACKED, BUSY_CLASS_2_ACKED, SUSPENDED };
|
||||
|
||||
static constexpr uint8_t SSID = SUBSYSTEM_ID::CFDP;
|
||||
static constexpr uint8_t CID = CLASS_ID::CFDP;
|
||||
|
||||
struct PacketInfo {
|
||||
PacketInfo(PduType type, store_address_t storeId,
|
||||
@ -48,13 +49,14 @@ using PacketInfoList = etl::list<PacketInfo, SIZE>;
|
||||
using PacketInfoListBase = etl::ilist<PacketInfo>;
|
||||
|
||||
struct PutRequestFull {
|
||||
public:
|
||||
EntityId destId;
|
||||
TransmissionMode transmissionMode;
|
||||
char destName[524];
|
||||
size_t destNameSize;
|
||||
char sourceName[524];
|
||||
size_t sourceNameSize;
|
||||
bool closureRequested;
|
||||
TransmissionMode transmissionMode = TransmissionMode::UNACKNOWLEDGED;
|
||||
char destName[524]{};
|
||||
size_t destNameSize = 0;
|
||||
char sourceName[524]{};
|
||||
size_t sourceNameSize = 0;
|
||||
bool closureRequested = true;
|
||||
};
|
||||
|
||||
namespace events {
|
||||
@ -68,5 +70,7 @@ static constexpr Event FILENAME_TOO_LARGE_ERROR = event::makeEvent(SSID, 4, seve
|
||||
|
||||
} // namespace events
|
||||
|
||||
static constexpr ReturnValue_t SOURCE_TRANSACTION_PENDING = returnvalue::makeCode(CID, 0);
|
||||
|
||||
} // namespace cfdp
|
||||
#endif // FSFW_CFDP_HANDLER_DEFS_H
|
||||
|
Loading…
Reference in New Issue
Block a user