F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Utils.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title Utils.hpp
3 // \brief CFDP utilities header
4 //
5 // This file is a port of CFDP utility functions from the following files
6 // from the NASA Core Flight System (cFS) CFDP (CF) Application, version 3.0.0,
7 // adapted for use within the F-Prime (F') framework:
8 // - cf_utils.h (CFDP utility function declarations)
9 //
10 // CFDP utils header file
11 //
12 // ======================================================================
13 //
14 // NASA Docket No. GSC-18,447-1
15 //
16 // Copyright (c) 2019 United States Government as represented by the
17 // Administrator of the National Aeronautics and Space Administration.
18 // All Rights Reserved.
19 //
20 // Licensed under the Apache License, Version 2.0 (the "License"); you may
21 // not use this file except in compliance with the License. You may obtain
22 // a copy of the License at
23 //
24 // http://www.apache.org/licenses/LICENSE-2.0
25 //
26 // Unless required by applicable law or agreed to in writing, software
27 // distributed under the License is distributed on an "AS IS" BASIS,
28 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29 // See the License for the specific language governing permissions and
30 // limitations under the License.
31 //
32 // ======================================================================
33 
34 #ifndef CFDP_UTILS_HPP
35 #define CFDP_UTILS_HPP
36 
37 #include <Fw/Types/Assert.hpp>
38 
40 
41 namespace Svc {
42 namespace Ccsds {
43 namespace Cfdp {
44 
55 };
56 
64  void* context;
65  I32 counter;
66 };
67 
76 };
77 
78 /************************************************************************/
88 
89 /************************************************************************/
98 CListTraverseStatus PrioSearch(CListNode* node, void* context);
99 
100 /************************************************************************/
112 
113 /************************************************************************/
126 bool TxnStatusIsError(TxnStatus txn_stat);
127 
128 /************************************************************************/
138 
139 } // namespace Cfdp
140 } // namespace Ccsds
141 } // namespace Svc
142 
143 #endif /* !CFDP_UTILS_HPP */
Argument structure for use with CfdpCListTraverseR()
Definition: Utils.hpp:73
Transaction * txn
output transaction pointer
Definition: Utils.hpp:54
CFDP Transaction state machine class.
CListTraverseStatus
Traverse status for circular list operations.
Definition: Clist.hpp:45
void(*)(Transaction *txn, void *context) CfdpTraverseAllTransactionsFunc
Callback function type for use with Channel::traverseAllTransactions()
Definition: Types.hpp:421
U32 EntityId
Entity id size.
CListTraverseStatus PrioSearch(CListNode *node, void *context)
Searches for the first transaction with a lower priority than given.
Definition: Utils.cpp:109
TxnStatus
Values for Transaction Status code.
Definition: Types.hpp:193
Argument structure for use with Channel::traverseAllTransactions()
Definition: Utils.hpp:62
U32 TransactionSeq
transaction sequence number size
Argument structure for use with CList_Traverse()
Definition: Utils.hpp:51
ConditionCode TxnStatusToConditionCode(TxnStatus txn_stat)
Converts the internal transaction status to a CFDP condition code.
Definition: Utils.cpp:120
I32 counter
Running tally of all nodes traversed from all lists.
Definition: Utils.hpp:65
Transaction * txn
OUT: holds value of transaction with which to call CfdpCListInsertAfter on.
Definition: Utils.hpp:74
CfdpTraverseAllTransactionsFunc fn
internal callback to use for each CList_Traverse
Definition: Utils.hpp:63
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
CListTraverseStatus FindTransactionBySequenceNumberImpl(CListNode *node, void *context)
List traversal function to check if the desired sequence number matches.
Definition: Utils.cpp:105
U8 priority
seeking this priority
Definition: Utils.hpp:75
Circular linked list node structure.
Definition: Clist.hpp:66
RateGroupDivider component implementation.
void * context
opaque object to pass to internal callback
Definition: Utils.hpp:64
AckTxnStatus GetTxnStatus(Transaction *txn)
Gets the status of this transaction.
Definition: Utils.cpp:43
bool TxnStatusIsError(TxnStatus txn_stat)
Check if the internal transaction status represents an error.
Definition: Utils.cpp:113