33 #ifndef CFDP_CHANNEL_HPP 34 #define CFDP_CHANNEL_HPP 253 return &m_playback[index];
264 return &m_polldir[index];
468 void processPlaybackDirectory(
Playback* pb);
477 void updatePollPbCounted(
Playback* pb, I32 up,
U8* counter);
501 U32 m_outgoingCounter;
509 U32 m_dirMaxChunks[
static_cast<U32
>(
536 #endif // CFDP_CHANNEL_HPP
void moveTransaction(Transaction *txn, QueueId::T queue)
Move a transaction from one queue to another.
U8 getChannelId() const
Get the channel ID.
~Channel()
Destruct a Channel.
History * getHistory(U32 index)
Get a history by index (for testing)
CFDP Transaction state machine class.
void removeFromQueue(QueueId::T queueidx, CListNode *node)
Remove a node from a channel queue.
CListTraverseStatus
Traverse status for circular list operations.
void(*)(Transaction *txn, void *context) CfdpTraverseAllTransactionsFunc
Callback function type for use with Channel::traverseAllTransactions()
void setCurrentTxn(const Transaction *txn)
Set current transaction.
U32 getOutgoingCounter() const
Get the outgoing PDU counter for this cycle.
void CfdpCListInsertAfter(CListNode **head, CListNode *start, CListNode *after)
Insert the given node into the last after the given start node.
U32 EntityId
Entity id size.
I32 traverseAllTransactions(CfdpTraverseAllTransactionsFunc fn, void *context)
Traverses all transactions on all active queues and performs an operation on them.
Wrapper around a CfdpChunkList object.
void processPollingDirectories()
Process all polling directories for this channel.
void incrementCmdTxCounter()
Increment the command TX counter for this channel.
CListTraverseStatus cycleTxFirstActive(CListNode *node, void *context)
Traverse callback for cycling the first active transaction.
U32 TransactionSeq
transaction sequence number size
Flow::T getFlowState() const
Get the flow state for this channel.
void cycleTx()
Cycle the TX side of this channel.
static CListTraverseStatus cycleTxFirstActiveWrapper(CListNode *node, void *context)
Static wrapper for cycleTxFirstActive callback.
void resetOutgoingCounter()
Reset the outgoing PDU counter to zero.
void insertAfterInQueue(QueueId::T queueidx, CListNode *start, CListNode *after)
Insert a node after another in a channel queue.
Channel(Engine *engine, U8 channelId, CfdpManager *cfdpManager, Fw::MemAllocator &allocator, FwEnumStoreType memId)
Construct a Channel.
void clearCurrentIfMatch(Transaction *txn)
Check if current transaction matches and clear if so.
void tickTransactions()
Tick all transactions on this channel.
void freeTransaction(Transaction *txn)
Frees and resets a transaction and returns it for later use.
void dequeueTransaction(Transaction *txn)
Free a transaction from the queue it's on.
void decrementCmdTxCounter()
Decrement the command TX counter for this channel.
void CfdpCListInsertBack(CListNode **head, CListNode *node)
Insert the given node into the back of a list.
static CListTraverseStatus doTickWrapper(CListNode *node, void *context)
Static wrapper for doTick callback.
uint8_t U8
8-bit unsigned integer
void processPlaybackDirectories()
Process all playback directories for this channel.
void insertSortPrio(Transaction *txn, QueueId::T queue)
Insert a transaction into a priority sorted transaction queue.
Transaction * findUnusedTransaction(Direction direction)
Find an unused transaction on this channel.
void cleanup(Fw::MemAllocator &allocator, FwEnumStoreType memId)
Clean up dynamically allocated resources.
Memory Allocation base class.
Transaction * getTransaction(U32 index)
Get a transaction by index (for testing)
void insertBackInQueue(QueueId::T queueidx, CListNode *node)
Insert a node at the back of a channel queue.
void CfdpCListRemove(CListNode **head, CListNode *node)
Remove the given node from the list.
CListTraverseStatus doTick(CListNode *node, void *context)
Traverse callback for ticking a transaction.
Circular linked list node structure.
void incrementOutgoingCounter()
Increment the outgoing PDU counter.
Transaction * findTransactionBySequenceNumber(TransactionSeq transaction_sequence_number, EntityId src_eid)
Finds an active transaction by sequence number.
Channel & operator=(const Channel &)=delete
RateGroupDivider component implementation.
CfdpPollDir * getPollDir(U32 index)
Get a polling directory entry.
U32 getNumCmdTx() const
Get the number of commanded TX transactions.
Defines a base class for a memory allocator for classes.
void resetHistory(History *history)
Returns a history structure back to its unused state.
friend class CfdpManagerTester
CListNode ** getChunkListHead(U8 direction)
Gets the head of the chunk list for this channel + direction.
void setFlowState(Flow::T flowState)
Set the flow state for this channel.
CfdpChunkWrapper * findUnusedChunks(Direction dir)
Find unused chunks for this channel.
void recycleTransaction(Transaction *txn)
Recover resources associated with a transaction.
Direction
Direction identifier.
Playback * getPlayback(U32 index)
Get a playback directory entry.
static CListTraverseStatus traverseAllTransactionsWrapper(CListNode *node, void *context)
Static wrapper for traverseAllTransactions callback.
Pairs an offset with a size to identify a specific piece of a file.