Skip to content

Commit c6fe5f4

Browse files
authored
Merge pull request #482 from jphickey/fix-481-state-cleanup
Fix #481, simplify and consolidate state machines
2 parents d026bfd + a0914c4 commit c6fe5f4

30 files changed

Lines changed: 4431 additions & 4042 deletions

config/default_cf_extern_typedefs.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,13 @@ typedef enum
7171
*/
7272
typedef enum
7373
{
74-
CF_QueueIdx_PEND = 0, /**< \brief first one on this list is active */
75-
CF_QueueIdx_TXA = 1,
76-
CF_QueueIdx_TXW = 2,
77-
CF_QueueIdx_RX = 3,
78-
CF_QueueIdx_HIST = 4,
79-
CF_QueueIdx_HIST_FREE = 5,
80-
CF_QueueIdx_FREE = 6,
81-
CF_QueueIdx_NUM = 7
74+
CF_QueueIdx_PEND = 0, /**< \brief tx transactions that have not started */
75+
CF_QueueIdx_TX = 1, /**< \brief tx transactions in progress */
76+
CF_QueueIdx_RX = 2, /**< \brief rx transactions in progress */
77+
CF_QueueIdx_HIST = 3, /**< \brief transaction history (completed) */
78+
CF_QueueIdx_HIST_FREE = 4, /**< \brief unused transaction history structs */
79+
CF_QueueIdx_FREE = 5, /**< \brief unused transaction structs */
80+
CF_QueueIdx_NUM = 6
8281
} CF_QueueIdx_t;
8382

8483
/**

fsw/inc/cf_events.h

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@
501501
* available resource to track the chunks associated
502502
* with the file.
503503
*/
504-
#define CF_CFDP_NO_CHUNKLIST_AVAIL_EID 88
504+
#define CF_CFDP_NO_CHUNKLIST_AVAIL_EID 69
505505

506506
/**************************************************************************
507507
* CF_CFDP_R event IDs - Engine receive
@@ -520,13 +520,13 @@
520520
#define CF_CFDP_R_REQUEST_MD_INF_EID (70)
521521

522522
/**
523-
* \brief CF Creating Temp File For RX Transaction Without Metadata PDU
523+
* \brief CF Creating Temp File For RX Transaction
524524
*
525525
* \par Type: INFORMATION
526526
*
527527
* \par Cause:
528528
*
529-
* RX transaction missing metadata causing creation of a temporary
529+
* RX transaction creation of a temporary
530530
* filename to store the data
531531
*/
532532
#define CF_CFDP_R_TEMP_FILE_INF_EID (71)
@@ -661,33 +661,33 @@
661661
*
662662
* \par Cause:
663663
*
664-
* Failure from file rename call after reception of an out-of-order RX
665-
* Class 2 Metadata PDU
664+
* Failure from file rename call after end of transaction
666665
*/
667666
#define CF_CFDP_R_RENAME_ERR_EID (83)
668667

669668
/**
670-
* \brief CF RX Class 2 Metadata PDU File Open Failed Event ID
669+
* \brief CF File retained
671670
*
672-
* \par Type: ERROR
671+
* \par Type: INFORMATION
673672
*
674673
* \par Cause:
675674
*
676-
* Failure from file open call after reception of an out-of-order RX
677-
* Class 2 Metadata PDU
675+
* Engine has fully retained the file after a successful transaction
678676
*/
679-
#define CF_CFDP_R_OPEN_ERR_EID (84)
677+
#define CF_CFDP_R_FILE_RETAINED_EID (84)
680678

681679
/**
682-
* \brief CF Invalid Out-of-order Metadata PDU Received Event ID
680+
* \brief CF RX File not retained
683681
*
684-
* \par Type: ERROR
682+
* \par Type: INFORMATION
685683
*
686684
* \par Cause:
687685
*
688-
* Failure to decode out-of-order metadata PDU
686+
* Temporary file associated with a receive transaction was discarded
687+
* without being retained. This may be due to an error in the
688+
* transaction, failure to validate, or cancellation.
689689
*/
690-
#define CF_CFDP_R_PDU_MD_ERR_EID (85)
690+
#define CF_CFDP_R_NOT_RETAINED_EID (85)
691691

692692
/**
693693
* \brief CF Class 2 CRC Read From File Failed Event ID
@@ -723,19 +723,6 @@
723723
*/
724724
#define CF_CFDP_R_INACT_TIMER_ERR_EID (88)
725725

726-
/**
727-
* \brief CF No chunklist available
728-
*
729-
* \par Type: ERROR
730-
*
731-
* \par Cause:
732-
*
733-
* Engine has aborted a transaction due to lack of an
734-
* available resource to track the chunks associated
735-
* with the file.
736-
*/
737-
#define CF_CFDP_NO_CHUNKLIST_AVAIL_EID 88
738-
739726
/**************************************************************************
740727
* CF_CFDP_S event IDs - Engine send
741728
*/
@@ -934,6 +921,31 @@
934921
*/
935922
#define CF_CFDP_S_INACT_TIMER_ERR_EID (107)
936923

924+
/**
925+
* \brief CF TX File Moved
926+
*
927+
* \par Type: INFORMATION
928+
*
929+
* \par Cause:
930+
*
931+
* Source File has been moved after a TX transaction
932+
* This occurs when the move directory is configured.
933+
*/
934+
#define CF_CFDP_S_FILE_MOVED_EID (108)
935+
936+
/**
937+
* \brief CF TX File Removed
938+
*
939+
* \par Type: INFORMATION
940+
*
941+
* \par Cause:
942+
*
943+
* Source File has been removed after a successful TX transaction
944+
* where the "keep" flag was false and there is no move directory
945+
* configured.
946+
*/
947+
#define CF_CFDP_S_FILE_REMOVED_EID (109)
948+
937949
/**************************************************************************
938950
* CF_CMD event IDs - Command processing
939951
*/

fsw/src/cf_assert.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,19 @@
5454
* \brief Debug build assert
5555
*/
5656
#define CF_Assert(x) (assert(x))
57+
#define CF_TRACE(...) \
58+
do \
59+
{ \
60+
OS_printf(__VA_ARGS__); \
61+
} while (0)
5762

5863
#else /* CF_DEBUG_BUILD */
5964

6065
/**
6166
* \brief Normal build assert
6267
*/
6368
#define CF_Assert(x) /* no-op */
69+
#define CF_TRACE(...)
6470

6571
#endif /* CF_DEBUG_BUILD */
6672

0 commit comments

Comments
 (0)