39 #ifndef Svc_Ccsds_CfdpTransaction_HPP 40 #define Svc_Ccsds_CfdpTransaction_HPP 298 void sTick(I32* cont);
412 Status::T sCheckAndRespondNak(
bool* nakProcessed);
454 void rTick(I32* cont);
592 void r1SubstateRecvEof(
const Fw::Buffer& pdu);
602 void r2SubstateRecvEof(
const Fw::Buffer& pdu);
611 void r1SubstateRecvFileData(
const Fw::Buffer& pdu);
624 void r2SubstateRecvFileData(
const Fw::Buffer& pdu);
635 void r2GapCompute(
const Chunk* chunk,
NakPdu& nak);
642 static void r2GapComputeWrapper(
const Chunk* chunk,
void* opaque);
708 void rSendInactivityEvent();
748 Timer m_inactivity_timer;
858 #endif // Svc_Ccsds_CfdpTransaction_HPP U8 getPriority() const
Get transaction priority.
friend class CfdpManagerTester
const FileDirectiveDispatchTable * substate[static_cast< U32 >(TxSubState::TX_SUB_STATE_NUM_STATES)]
void s1Recv(const Fw::Buffer &buffer)
S1 receive PDU processing.
void s2EofAck(const Fw::Buffer &pdu)
S2 received ACK PDU.
TransactionInitType
Transaction initiation method.
void sAckTimerTick()
Perform acknowledgement timer tick (time-based) processing for S transactions.
TxnState
High-level state of a transaction.
void s2Fin(const Fw::Buffer &pdu)
S2 received FIN, so set flag to send FIN-ACK.
CFDP Transaction state machine class.
CListTraverseStatus
Traverse status for circular list operations.
void sDispatchTransmit(const SSubstateSendDispatchTable *dispatch)
Dispatch function to send/generate PDUs on send-file transactions.
StateSendFunc tx[static_cast< U32 >(TxnState::TXN_STATE_INVALID)]
Transmit handler function.
void rCancel()
Cancel an R transaction.
void sSubstateSendFileData()
Standard state function to send the next file data PDU for active transaction.
Summary of all possible transaction state information (tx and rx)
void r2Reset()
CFDP R2 transaction reset function.
void r2Recv(const Fw::Buffer &buffer)
R2 receive PDU processing.
StateRecvFunc rx[static_cast< U32 >(TxnState::TXN_STATE_INVALID)]
a separate recv handler for each possible file directive PDU in this state
void r2Complete(I32 ok_to_send_nak)
Checks R2 transaction state for transaction completion status.
void s2Tx()
S2 dispatch function.
void sTickNak(I32 *cont)
Perform NAK response for TX transactions.
const FileDirectiveDispatchTable * state[static_cast< U32 >(RxSubState::RX_SUB_STATE_NUM_STATES)]
Wrapper around a CfdpChunkList object.
StateRecvFunc fdirective[static_cast< U32 >(FileDirective::FILE_DIRECTIVE_INVALID_MAX)]
a separate recv handler for each possible file directive PDU in this state
void s2NakArm(const Fw::Buffer &pdu)
S2 NAK handling but with arming the NAK timer.
static CListTraverseStatus prioritySearchCallback(CListNode *node, void *context)
Static callback for priority search.
Transaction(Channel *channel, U8 channelId, Engine *engine, CfdpManager *manager)
A table of receive handler functions based on transaction state.
void rTick(I32 *cont)
Perform tick (time-based) processing for R transactions.
TxnStatus
Values for Transaction Status code.
void s2Recv(const Fw::Buffer &buffer)
S2 receive PDU processing.
A dispatch table for send file transactions, receive side.
void s2EarlyFin(const Fw::Buffer &pdu)
A FIN was received before file complete, so abandon the transaction.
Summary of all possible transaction flags (tx and rx)
A dispatch table for send file transactions, transmit side.
U8 getChannelId() const
Get channel ID.
Class representing a 32-bit checksum as mandated by the CCSDS File Delivery Protocol.
void s1SubstateSendEof()
Sends an EOF for S1.
void r1Reset()
CFDP R1 transaction reset function.
void reset()
Reset transaction to default state.
void sDispatchRecv(const Fw::Buffer &buffer, const SSubstateRecvDispatchTable *dispatch)
Dispatch function for received PDUs on send-file transactions.
StateSendFunc substate[static_cast< U32 >(TxSubState::TX_SUB_STATE_NUM_STATES)]
void s2SubstateSendEof()
Triggers tick processing to send an EOF and wait for EOF-ACK for S2.
History * getHistory() const
Get transaction history.
void s1Tx()
S1 dispatch function.
TxnState getState() const
Get transaction state.
static CListTraverseStatus findBySequenceNumberCallback(CListNode *node, void *context)
Static callback for finding transaction by sequence number.
void s2SubstateSendFileData()
Send filedata handling for S2.
void(Transaction::*)() StateSendFunc
A member function pointer for dispatching actions to a handler, without existing PDU data...
U32 FileSize
File size and offset type.
void rAckTimerTick()
Perform acknowledgement timer tick (time-based) processing for R transactions.
uint8_t U8
8-bit unsigned integer
void sTick(I32 *cont)
Perform tick (time-based) processing for S transactions.
void sSubstateSendMetadata()
Send metadata PDU.
Class::T getClass() const
Get transaction class (CLASS_1 or CLASS_2)
A dispatch table for receive file transactions, receive side.
void initTxFile(Class::T cfdp_class, Keep::T keep, U8 chan, U8 priority)
Initialize transaction for outgoing file transfer.
void rInit()
Initialize a transaction structure for R.
void sCancel()
Cancel an S transaction.
C++ header for working with basic fprime types.
Circular linked list node structure.
Marker value for the highest possible state number.
RateGroupDivider component implementation.
void rDispatchRecv(const Fw::Buffer &buffer, const RSubstateDispatchTable *dispatch, StateRecvFunc fd_fn)
Dispatch function for received PDUs on receive-file transactions.
void r2SetFinTxnStatus(TxnStatus txn_stat)
Helper function to store transaction status code and set send_fin flag.
A table of receive handler functions based on file directive code.
void txStateDispatch(const TxnSendDispatchTable *dispatch)
Top-level Dispatch function to send a PDU based on current state.
Status::T rCheckCrc(U32 expected_crc)
Checks that the transaction file's CRC matches expected.
A table of transmit handler functions based on transaction state.
void(Transaction::*)(const Fw::Buffer &buffer) StateRecvFunc
A member function pointer for dispatching actions to a handler, with existing PDU data...
void s2Nak(const Fw::Buffer &pdu)
S2 NAK PDU received handling.
void r1Recv(const Fw::Buffer &buffer)
R1 receive PDU processing.
Pairs an offset with a size to identify a specific piece of a file.