@@ -51,6 +51,7 @@ namespace Ccsds {
5151void CF_CFDP_EncodeStart (CF_EncoderState_t *penc, void *msgbuf, CF_Logical_PduBuffer_t *ph, size_t encap_hdr_size,
5252 size_t total_size)
5353{
54+ // TODO Current thought is to rework the encore to include a buffer reference
5455 /* Clear the PDU buffer structure to start */
5556 memset (ph, 0 , sizeof (*ph));
5657
@@ -275,7 +276,9 @@ CF_Logical_PduBuffer_t *CF_CFDP_ConstructPduHeader(const CF_Transaction_t *txn,
275276
276277 ph = CF_CFDP_MsgOutGet (txn, silent);
277278 // TODO How to handle stuffing a buffer into the header
279+ // Add a reference in the encoder state
278280
281+ // TODO there is meetering happening here, update it to check if the buffer is size 0
279282 if (ph)
280283 {
281284 hdr = &ph->pdu_header ;
@@ -335,13 +338,13 @@ CF_Logical_PduBuffer_t *CF_CFDP_ConstructPduHeader(const CF_Transaction_t *txn,
335338 * See description in cf_cfdp.h for argument/return detail
336339 *
337340 *-----------------------------------------------------------------*/
338- CFE_Status_t CF_CFDP_SendMd (CF_Transaction_t *txn)
341+ CfdpStatus::T CF_CFDP_SendMd (CF_Transaction_t *txn)
339342{
340343 CF_Logical_PduBuffer_t *ph =
341344 CF_CFDP_ConstructPduHeader (txn, CF_CFDP_FileDirective_METADATA, CF_AppData.config_table ->local_eid ,
342345 txn->history ->peer_eid , 0 , txn->history ->seq_num , 0 );
343346 CF_Logical_PduMd_t *md;
344- CFE_Status_t sret = CFE_SUCCESS;
347+ CfdpStatus::T sret = CFE_SUCCESS;
345348
346349 if (!ph)
347350 {
@@ -378,10 +381,10 @@ CFE_Status_t CF_CFDP_SendMd(CF_Transaction_t *txn)
378381 * See description in cf_cfdp.h for argument/return detail
379382 *
380383 *-----------------------------------------------------------------*/
381- CFE_Status_t CF_CFDP_SendFd (CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
384+ CfdpStatus::T CF_CFDP_SendFd (CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
382385{
383386 /* NOTE: SendFd does not need a call to CF_CFDP_MsgOutGet, as the caller already has it */
384- CFE_Status_t ret = CFE_SUCCESS;
387+ CfdpStatus::T ret = CFE_SUCCESS;
385388
386389 /* this should check if any encoding error occurred */
387390
@@ -435,13 +438,13 @@ void CF_CFDP_AppendTlv(CF_Logical_TlvList_t *ptlv_list, CF_CFDP_TlvType_t tlv_ty
435438 * See description in cf_cfdp.h for argument/return detail
436439 *
437440 *-----------------------------------------------------------------*/
438- CFE_Status_t CF_CFDP_SendEof (CF_Transaction_t *txn)
441+ CfdpStatus::T CF_CFDP_SendEof (CF_Transaction_t *txn)
439442{
440443 CF_Logical_PduBuffer_t *ph =
441444 CF_CFDP_ConstructPduHeader (txn, CF_CFDP_FileDirective_EOF, CF_AppData.config_table ->local_eid ,
442445 txn->history ->peer_eid , 0 , txn->history ->seq_num , 0 );
443446 CF_Logical_PduEof_t *eof;
444- CFE_Status_t ret = CFE_SUCCESS;
447+ CfdpStatus::T ret = CFE_SUCCESS;
445448
446449 if (!ph)
447450 {
@@ -474,12 +477,12 @@ CFE_Status_t CF_CFDP_SendEof(CF_Transaction_t *txn)
474477 * See description in cf_cfdp.h for argument/return detail
475478 *
476479 *-----------------------------------------------------------------*/
477- CFE_Status_t CF_CFDP_SendAck (CF_Transaction_t *txn, CF_CFDP_AckTxnStatus_t ts, CF_CFDP_FileDirective_t dir_code,
480+ CfdpStatus::T CF_CFDP_SendAck (CF_Transaction_t *txn, CF_CFDP_AckTxnStatus_t ts, CF_CFDP_FileDirective_t dir_code,
478481 CF_CFDP_ConditionCode_t cc, CF_EntityId_t peer_eid, CF_TransactionSeq_t tsn)
479482{
480483 CF_Logical_PduBuffer_t *ph;
481484 CF_Logical_PduAck_t * ack;
482- CFE_Status_t ret = CFE_SUCCESS;
485+ CfdpStatus::T ret = CFE_SUCCESS;
483486 CF_EntityId_t src_eid;
484487 CF_EntityId_t dst_eid;
485488
@@ -525,14 +528,14 @@ CFE_Status_t CF_CFDP_SendAck(CF_Transaction_t *txn, CF_CFDP_AckTxnStatus_t ts, C
525528 * See description in cf_cfdp.h for argument/return detail
526529 *
527530 *-----------------------------------------------------------------*/
528- CFE_Status_t CF_CFDP_SendFin (CF_Transaction_t *txn, CF_CFDP_FinDeliveryCode_t dc, CF_CFDP_FinFileStatus_t fs,
531+ CfdpStatus::T CF_CFDP_SendFin (CF_Transaction_t *txn, CF_CFDP_FinDeliveryCode_t dc, CF_CFDP_FinFileStatus_t fs,
529532 CF_CFDP_ConditionCode_t cc)
530533{
531534 CF_Logical_PduBuffer_t *ph =
532535 CF_CFDP_ConstructPduHeader (txn, CF_CFDP_FileDirective_FIN, txn->history ->peer_eid ,
533536 CF_AppData.config_table ->local_eid , 1 , txn->history ->seq_num , 0 );
534537 CF_Logical_PduFin_t *fin;
535- CFE_Status_t ret = CFE_SUCCESS;
538+ CfdpStatus::T ret = CFE_SUCCESS;
536539
537540 if (!ph)
538541 {
@@ -565,10 +568,10 @@ CFE_Status_t CF_CFDP_SendFin(CF_Transaction_t *txn, CF_CFDP_FinDeliveryCode_t dc
565568 * See description in cf_cfdp.h for argument/return detail
566569 *
567570 *-----------------------------------------------------------------*/
568- CFE_Status_t CF_CFDP_SendNak (CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
571+ CfdpStatus::T CF_CFDP_SendNak (CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
569572{
570573 CF_Logical_PduNak_t *nak;
571- CFE_Status_t ret = CFE_SUCCESS;
574+ CfdpStatus::T ret = CFE_SUCCESS;
572575
573576 if (!ph)
574577 {
@@ -600,9 +603,9 @@ CFE_Status_t CF_CFDP_SendNak(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
600603 * See description in cf_cfdp.h for argument/return detail
601604 *
602605 *-----------------------------------------------------------------*/
603- CFE_Status_t CF_CFDP_RecvPh (U8 chan_num, CF_Logical_PduBuffer_t *ph)
606+ CfdpStatus::T CF_CFDP_RecvPh (U8 chan_num, CF_Logical_PduBuffer_t *ph)
604607{
605- CFE_Status_t ret = CFE_SUCCESS;
608+ CfdpStatus::T ret = CFE_SUCCESS;
606609
607610 FW_ASSERT (chan_num < CF_NUM_CHANNELS, chan_num, CF_NUM_CHANNELS);
608611 /*
@@ -660,11 +663,11 @@ CFE_Status_t CF_CFDP_RecvPh(U8 chan_num, CF_Logical_PduBuffer_t *ph)
660663 * See description in cf_cfdp.h for argument/return detail
661664 *
662665 *-----------------------------------------------------------------*/
663- CFE_Status_t CF_CFDP_RecvMd (CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
666+ CfdpStatus::T CF_CFDP_RecvMd (CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
664667{
665668 const CF_Logical_PduMd_t *md = &ph->int_header .md ;
666669 int lv_ret;
667- CFE_Status_t ret = CFE_SUCCESS;
670+ CfdpStatus::T ret = CFE_SUCCESS;
668671
669672 CF_CFDP_DecodeMd (ph->pdec , &ph->int_header .md );
670673 if (!CF_CODEC_IS_OK (ph->pdec ))
@@ -727,9 +730,9 @@ CFE_Status_t CF_CFDP_RecvMd(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
727730 * See description in cf_cfdp.h for argument/return detail
728731 *
729732 *-----------------------------------------------------------------*/
730- CFE_Status_t CF_CFDP_RecvFd (CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
733+ CfdpStatus::T CF_CFDP_RecvFd (CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
731734{
732- CFE_Status_t ret = CFE_SUCCESS;
735+ CfdpStatus::T ret = CFE_SUCCESS;
733736
734737 CF_CFDP_DecodeFileDataHeader (ph->pdec , ph->pdu_header .segment_meta_flag , &ph->int_header .fd );
735738
@@ -773,9 +776,9 @@ CFE_Status_t CF_CFDP_RecvFd(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
773776 * See description in cf_cfdp.h for argument/return detail
774777 *
775778 *-----------------------------------------------------------------*/
776- CFE_Status_t CF_CFDP_RecvEof (CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
779+ CfdpStatus::T CF_CFDP_RecvEof (CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
777780{
778- CFE_Status_t ret = CFE_SUCCESS;
781+ CfdpStatus::T ret = CFE_SUCCESS;
779782
780783 CF_CFDP_DecodeEof (ph->pdec , &ph->int_header .eof );
781784
@@ -795,9 +798,9 @@ CFE_Status_t CF_CFDP_RecvEof(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
795798 * See description in cf_cfdp.h for argument/return detail
796799 *
797800 *-----------------------------------------------------------------*/
798- CFE_Status_t CF_CFDP_RecvAck (CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
801+ CfdpStatus::T CF_CFDP_RecvAck (CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
799802{
800- CFE_Status_t ret = CFE_SUCCESS;
803+ CfdpStatus::T ret = CFE_SUCCESS;
801804
802805 CF_CFDP_DecodeAck (ph->pdec , &ph->int_header .ack );
803806
@@ -818,9 +821,9 @@ CFE_Status_t CF_CFDP_RecvAck(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
818821 * See description in cf_cfdp.h for argument/return detail
819822 *
820823 *-----------------------------------------------------------------*/
821- CFE_Status_t CF_CFDP_RecvFin (CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
824+ CfdpStatus::T CF_CFDP_RecvFin (CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
822825{
823- CFE_Status_t ret = CFE_SUCCESS;
826+ CfdpStatus::T ret = CFE_SUCCESS;
824827
825828 CF_CFDP_DecodeFin (ph->pdec , &ph->int_header .fin );
826829
@@ -842,9 +845,9 @@ CFE_Status_t CF_CFDP_RecvFin(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
842845 * See description in cf_cfdp.h for argument/return detail
843846 *
844847 *-----------------------------------------------------------------*/
845- CFE_Status_t CF_CFDP_RecvNak (CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
848+ CfdpStatus::T CF_CFDP_RecvNak (CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
846849{
847- CFE_Status_t ret = CFE_SUCCESS;
850+ CfdpStatus::T ret = CFE_SUCCESS;
848851
849852 CF_CFDP_DecodeNak (ph->pdec , &ph->int_header .nak );
850853
@@ -1000,14 +1003,14 @@ void CF_CFDP_RecvInit(CF_Transaction_t *txn, CF_Logical_PduBuffer_t *ph)
10001003 * See description in cf_cfdp.h for argument/return detail
10011004 *
10021005 *-----------------------------------------------------------------*/
1003- CFE_Status_t CF_CFDP_InitEngine (void )
1006+ CfdpStatus::T CF_CFDP_InitEngine (void )
10041007{
10051008 /* initialize all transaction nodes */
10061009 CF_History_t * history;
10071010 CF_Transaction_t * txn = CF_AppData.engine .transactions ;
10081011 CF_ChunkWrapper_t *cw = CF_AppData.engine .chunks ;
10091012 CF_CListNode_t ** list_head;
1010- CFE_Status_t ret = CFE_SUCCESS;
1013+ CfdpStatus::T ret = CFE_SUCCESS;
10111014 CF_Poll_t * poll;
10121015 int chunk_mem_offset = 0 ;
10131016 int i;
@@ -1095,12 +1098,13 @@ CFE_Status_t CF_CFDP_InitEngine(void)
10951098 }
10961099 }
10971100
1098- for (j = 0 ; j < CF_NUM_HISTORIES_PER_CHANNEL; ++j)
1099- {
1100- history = &CF_AppData.engine .histories [(i * CF_NUM_HISTORIES_PER_CHANNEL) + j];
1101- CF_CList_InitNode (&history->cl_node );
1102- CF_CList_InsertBack_Ex (&CF_AppData.engine .channels [i], CF_QueueIdx_HIST_FREE, &history->cl_node );
1103- }
1101+ // TODO remove histories
1102+ // for (j = 0; j < CF_NUM_HISTORIES_PER_CHANNEL; ++j)
1103+ // {
1104+ // history = &CF_AppData.engine.histories[(i * CF_NUM_HISTORIES_PER_CHANNEL) + j];
1105+ // CF_CList_InitNode(&history->cl_node);
1106+ // CF_CList_InsertBack_Ex(&CF_AppData.engine.channels[i], CF_QueueIdx_HIST_FREE, &history->cl_node);
1107+ // }
11041108 }
11051109
11061110 if (ret == CFE_SUCCESS)
@@ -1349,14 +1353,14 @@ void CF_CFDP_TxFile_Initiate(CF_Transaction_t *txn, CF_CFDP_Class_t cfdp_class,
13491353 * See description in cf_cfdp.h for argument/return detail
13501354 *
13511355 *-----------------------------------------------------------------*/
1352- CFE_Status_t CF_CFDP_TxFile (const char *src_filename, const char *dst_filename, CF_CFDP_Class_t cfdp_class, U8 keep,
1356+ CfdpStatus::T CF_CFDP_TxFile (const char *src_filename, const char *dst_filename, CF_CFDP_Class_t cfdp_class, U8 keep,
13531357 U8 chan_num, U8 priority, CF_EntityId_t dest_id)
13541358{
13551359 CF_Transaction_t *txn;
13561360 CF_Channel_t * chan = &CF_AppData.engine .channels [chan_num];
13571361 FW_ASSERT (chan_num < CF_NUM_CHANNELS, chan_num, CF_NUM_CHANNELS);
13581362
1359- CFE_Status_t ret = CFE_SUCCESS;
1363+ CfdpStatus::T ret = CFE_SUCCESS;
13601364
13611365 if (chan->num_cmd_tx < CF_MAX_COMMANDED_PLAYBACK_FILES_PER_CHAN)
13621366 {
@@ -1427,11 +1431,11 @@ CF_Transaction_t *CF_CFDP_StartRxTransaction(U8 chan_num)
14271431 * Internal helper routine only, not part of API.
14281432 *
14291433 *-----------------------------------------------------------------*/
1430- CFE_Status_t CF_CFDP_PlaybackDir_Initiate (CF_Playback_t *pb, const char *src_filename, const char *dst_filename,
1434+ CfdpStatus::T CF_CFDP_PlaybackDir_Initiate (CF_Playback_t *pb, const char *src_filename, const char *dst_filename,
14311435 CF_CFDP_Class_t cfdp_class, U8 keep, U8 chan, U8 priority,
14321436 CF_EntityId_t dest_id)
14331437{
1434- CFE_Status_t ret;
1438+ CfdpStatus::T ret;
14351439
14361440 /* make sure the directory can be open */
14371441 ret = OS_DirectoryOpen (&pb->dir_id , src_filename);
@@ -1467,7 +1471,7 @@ CFE_Status_t CF_CFDP_PlaybackDir_Initiate(CF_Playback_t *pb, const char *src_fil
14671471 * See description in cf_cfdp.h for argument/return detail
14681472 *
14691473 *-----------------------------------------------------------------*/
1470- CFE_Status_t CF_CFDP_PlaybackDir (const char *src_filename, const char *dst_filename, CF_CFDP_Class_t cfdp_class,
1474+ CfdpStatus::T CF_CFDP_PlaybackDir (const char *src_filename, const char *dst_filename, CF_CFDP_Class_t cfdp_class,
14711475 U8 keep, U8 chan, U8 priority, U16 dest_id)
14721476{
14731477 int i;
0 commit comments