Skip to content

Commit d7467f5

Browse files
committed
Fix #394, revert merge of PR #383.
This reverts commit 4e97d3b, reversing changes made to 913b5fc.
1 parent 0f18ae4 commit d7467f5

18 files changed

+628
-622
lines changed

fsw/inc/cf_msg.h

+63-45
Large diffs are not rendered by default.

fsw/src/cf_app.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ CF_AppData_t CF_AppData;
4646
*-----------------------------------------------------------------*/
4747
void CF_HkCmd(void)
4848
{
49-
CFE_MSG_SetMsgTime(&CF_AppData.HkPacket.tlm_header.Msg, CFE_TIME_GetTime());
50-
/* return value ignored */ CFE_SB_TransmitMsg(&CF_AppData.HkPacket.tlm_header.Msg, true);
49+
CFE_MSG_SetMsgTime(&CF_AppData.hk.tlm_header.Msg, CFE_TIME_GetTime());
50+
/* return value ignored */ CFE_SB_TransmitMsg(&CF_AppData.hk.tlm_header.Msg, true);
5151
}
5252

5353
/*----------------------------------------------------------------
@@ -205,7 +205,7 @@ CFE_Status_t CF_Init(void)
205205

206206
CF_AppData.run_status = CFE_ES_RunStatus_APP_RUN;
207207

208-
CFE_MSG_Init(&CF_AppData.HkPacket.tlm_header.Msg, CFE_SB_ValueToMsgId(CF_HK_TLM_MID), sizeof(CF_AppData.HkPacket));
208+
CFE_MSG_Init(&CF_AppData.hk.tlm_header.Msg, CFE_SB_ValueToMsgId(CF_HK_TLM_MID), sizeof(CF_AppData.hk));
209209

210210
status = CFE_EVS_Register(NULL, 0, CFE_EVS_EventFilter_BINARY);
211211
if (status != CFE_SUCCESS)
@@ -301,7 +301,7 @@ void CF_ProcessMsg(CFE_SB_Buffer_t *msg)
301301
break;
302302

303303
default:
304-
++CF_AppData.HkPacket.CommandErrorCounter;
304+
++CF_AppData.hk.counters.err;
305305
CFE_EVS_SendEvent(CF_EID_ERR_INIT_CMD_LENGTH, CFE_EVS_EventType_ERROR,
306306
"CF: invalid command packet id=0x%lx", (unsigned long)CFE_SB_MsgIdToValue(msg_id));
307307
break;

fsw/src/cf_app.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
*/
7878
typedef struct
7979
{
80-
CF_HkPacket_t HkPacket;
80+
CF_HkPacket_t hk;
8181

8282
uint32 run_status;
8383

fsw/src/cf_cfdp.c

+17-17
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ CFE_Status_t CF_CFDP_RecvPh(uint8 chan_num, CF_Logical_PduBuffer_t *ph)
598598
{
599599
CFE_EVS_SendEvent(CF_EID_ERR_PDU_TRUNCATION, CFE_EVS_EventType_ERROR,
600600
"CF: PDU rejected due to EID/seq number field truncation");
601-
++CF_AppData.HkPacket.channel_hk[chan_num].counters.recv.error;
601+
++CF_AppData.hk.channel_hk[chan_num].counters.recv.error;
602602
ret = CF_ERROR;
603603
}
604604
/*
@@ -611,7 +611,7 @@ CFE_Status_t CF_CFDP_RecvPh(uint8 chan_num, CF_Logical_PduBuffer_t *ph)
611611
{
612612
CFE_EVS_SendEvent(CF_EID_ERR_PDU_LARGE_FILE, CFE_EVS_EventType_ERROR,
613613
"CF: PDU with large file bit received (unsupported)");
614-
++CF_AppData.HkPacket.channel_hk[chan_num].counters.recv.error;
614+
++CF_AppData.hk.channel_hk[chan_num].counters.recv.error;
615615
ret = CF_ERROR;
616616
}
617617
else
@@ -625,13 +625,13 @@ CFE_Status_t CF_CFDP_RecvPh(uint8 chan_num, CF_Logical_PduBuffer_t *ph)
625625
{
626626
CFE_EVS_SendEvent(CF_EID_ERR_PDU_SHORT_HEADER, CFE_EVS_EventType_ERROR, "CF: PDU too short (%lu received)",
627627
(unsigned long)CF_CODEC_GET_SIZE(ph->pdec));
628-
++CF_AppData.HkPacket.channel_hk[chan_num].counters.recv.error;
628+
++CF_AppData.hk.channel_hk[chan_num].counters.recv.error;
629629
ret = CF_SHORT_PDU_ERROR;
630630
}
631631
else
632632
{
633633
/* PDU is ok, so continue processing */
634-
++CF_AppData.HkPacket.channel_hk[chan_num].counters.recv.pdu;
634+
++CF_AppData.hk.channel_hk[chan_num].counters.recv.pdu;
635635
}
636636
}
637637

@@ -656,7 +656,7 @@ CFE_Status_t CF_CFDP_RecvMd(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
656656
CFE_EVS_SendEvent(CF_EID_ERR_PDU_MD_SHORT, CFE_EVS_EventType_ERROR,
657657
"CF: metadata packet too short: %lu bytes received",
658658
(unsigned long)CF_CODEC_GET_SIZE(ph->pdec));
659-
++CF_AppData.HkPacket.channel_hk[t->chan_num].counters.recv.error;
659+
++CF_AppData.hk.channel_hk[t->chan_num].counters.recv.error;
660660
ret = CF_PDU_METADATA_ERROR;
661661
}
662662
else
@@ -678,7 +678,7 @@ CFE_Status_t CF_CFDP_RecvMd(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
678678
CFE_EVS_SendEvent(CF_EID_ERR_PDU_INVALID_SRC_LEN, CFE_EVS_EventType_ERROR,
679679
"CF: metadata PDU rejected due to invalid length in source filename of 0x%02x",
680680
md->source_filename.length);
681-
++CF_AppData.HkPacket.channel_hk[t->chan_num].counters.recv.error;
681+
++CF_AppData.hk.channel_hk[t->chan_num].counters.recv.error;
682682
ret = CF_PDU_METADATA_ERROR;
683683
}
684684
else
@@ -690,7 +690,7 @@ CFE_Status_t CF_CFDP_RecvMd(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
690690
CFE_EVS_SendEvent(CF_EID_ERR_PDU_INVALID_DST_LEN, CFE_EVS_EventType_ERROR,
691691
"CF: metadata PDU rejected due to invalid length in dest filename of 0x%02x",
692692
md->dest_filename.length);
693-
++CF_AppData.HkPacket.channel_hk[t->chan_num].counters.recv.error;
693+
++CF_AppData.hk.channel_hk[t->chan_num].counters.recv.error;
694694
ret = CF_PDU_METADATA_ERROR;
695695
}
696696
else
@@ -735,7 +735,7 @@ CFE_Status_t CF_CFDP_RecvFd(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
735735
CFE_EVS_SendEvent(CF_EID_ERR_PDU_FD_SHORT, CFE_EVS_EventType_ERROR,
736736
"CF: filedata PDU too short: %lu bytes received", (unsigned long)CF_CODEC_GET_SIZE(ph->pdec));
737737
CF_CFDP_SetTxnStatus(t, CF_TxnStatus_PROTOCOL_ERROR);
738-
++CF_AppData.HkPacket.channel_hk[t->chan_num].counters.recv.error;
738+
++CF_AppData.hk.channel_hk[t->chan_num].counters.recv.error;
739739
ret = CF_SHORT_PDU_ERROR;
740740
}
741741
else if (ph->pdu_header.segment_meta_flag)
@@ -744,7 +744,7 @@ CFE_Status_t CF_CFDP_RecvFd(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
744744
CFE_EVS_SendEvent(CF_EID_ERR_PDU_FD_UNSUPPORTED, CFE_EVS_EventType_ERROR,
745745
"CF: filedata PDU with segment metadata received");
746746
CF_CFDP_SetTxnStatus(t, CF_TxnStatus_PROTOCOL_ERROR);
747-
++CF_AppData.HkPacket.channel_hk[t->chan_num].counters.recv.error;
747+
++CF_AppData.hk.channel_hk[t->chan_num].counters.recv.error;
748748
ret = CF_ERROR;
749749
}
750750

@@ -850,7 +850,7 @@ CFE_Status_t CF_CFDP_RecvNak(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
850850
*-----------------------------------------------------------------*/
851851
void CF_CFDP_RecvDrop(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
852852
{
853-
++CF_AppData.HkPacket.channel_hk[t->chan_num].counters.recv.dropped;
853+
++CF_AppData.hk.channel_hk[t->chan_num].counters.recv.dropped;
854854
}
855855

856856
/*----------------------------------------------------------------
@@ -918,14 +918,14 @@ void CF_CFDP_RecvIdle(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
918918
{
919919
CFE_EVS_SendEvent(CF_EID_ERR_CFDP_IDLE_MD, CFE_EVS_EventType_ERROR,
920920
"CF: got invalid md PDU -- abandoning transaction");
921-
++CF_AppData.HkPacket.channel_hk[t->chan_num].counters.recv.error;
921+
++CF_AppData.hk.channel_hk[t->chan_num].counters.recv.error;
922922
/* leave state as idle, which will reset below */
923923
}
924924
break;
925925
default:
926926
CFE_EVS_SendEvent(CF_EID_ERR_CFDP_FD_UNHANDLED, CFE_EVS_EventType_ERROR,
927927
"CF: unhandled file directive code 0x%02x in idle state", fdh->directive_code);
928-
++CF_AppData.HkPacket.channel_hk[t->chan_num].counters.recv.error;
928+
++CF_AppData.hk.channel_hk[t->chan_num].counters.recv.error;
929929
break;
930930
}
931931
}
@@ -1327,7 +1327,7 @@ static CFE_Status_t CF_CFDP_PlaybackDir_Initiate(CF_Playback_t *p, const char *s
13271327
{
13281328
CFE_EVS_SendEvent(CF_EID_ERR_CFDP_OPENDIR, CFE_EVS_EventType_ERROR,
13291329
"CF: failed to open playback directory %s, error=%ld", src_filename, (long)ret);
1330-
++CF_AppData.HkPacket.channel_hk[chan].counters.fault.directory_read;
1330+
++CF_AppData.hk.channel_hk[chan].counters.fault.directory_read;
13311331
}
13321332
else
13331333
{
@@ -1482,7 +1482,7 @@ static void CF_CFDP_ProcessPlaybackDirectories(CF_Channel_t *c)
14821482
{
14831483
CF_CFDP_ProcessPlaybackDirectory(c, &c->playback[i]);
14841484
CF_CFDP_UpdatePollPbCounted(&c->playback[i], c->playback[i].busy,
1485-
&CF_AppData.HkPacket.channel_hk[chan_index].playback_counter);
1485+
&CF_AppData.hk.channel_hk[chan_index].playback_counter);
14861486
}
14871487
}
14881488

@@ -1551,7 +1551,7 @@ void CF_CFDP_ProcessPollingDirectories(CF_Channel_t *c)
15511551
count_check = 1;
15521552
}
15531553

1554-
CF_CFDP_UpdatePollPbCounted(&p->pb, count_check, &CF_AppData.HkPacket.channel_hk[chan_index].poll_counter);
1554+
CF_CFDP_UpdatePollPbCounted(&p->pb, count_check, &CF_AppData.hk.channel_hk[chan_index].poll_counter);
15551555
}
15561556
}
15571557

@@ -1576,7 +1576,7 @@ void CF_CFDP_CycleEngine(void)
15761576
/* consume all received messages, even if channel is frozen */
15771577
CF_CFDP_ReceiveMessage(c);
15781578

1579-
if (!CF_AppData.HkPacket.channel_hk[i].frozen)
1579+
if (!CF_AppData.hk.channel_hk[i].frozen)
15801580
{
15811581
/* handle ticks before tx cycle. Do this because there may be a limited number of TX messages available
15821582
* this cycle, and it's important to respond to class 2 ACK/NAK more than it is to send new filedata
@@ -1829,7 +1829,7 @@ void CF_CFDP_DisableEngine(void)
18291829
}
18301830

18311831
/* finally all queue counters must be reset */
1832-
memset(&CF_AppData.HkPacket.channel_hk[i].q_size, 0, sizeof(CF_AppData.HkPacket.channel_hk[i].q_size));
1832+
memset(&CF_AppData.hk.channel_hk[i].q_size, 0, sizeof(CF_AppData.hk.channel_hk[i].q_size));
18331833

18341834
CFE_SB_DeletePipe(c->pipe);
18351835
}

fsw/src/cf_cfdp_dispatch.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void CF_CFDP_R_DispatchRecv(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph,
5959
}
6060
else
6161
{
62-
++CF_AppData.HkPacket.channel_hk[t->chan_num].counters.recv.spurious;
62+
++CF_AppData.hk.channel_hk[t->chan_num].counters.recv.spurious;
6363
CFE_EVS_SendEvent(CF_EID_ERR_CFDP_R_DC_INV, CFE_EVS_EventType_ERROR,
6464
"CF R%d(%lu:%lu): received PDU with invalid directive code %d for sub-state %d",
6565
(t->state == CF_TxnState_R2), (unsigned long)t->history->src_eid,
@@ -74,7 +74,7 @@ void CF_CFDP_R_DispatchRecv(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph,
7474
}
7575
else
7676
{
77-
++CF_AppData.HkPacket.channel_hk[t->chan_num].counters.recv.dropped;
77+
++CF_AppData.hk.channel_hk[t->chan_num].counters.recv.dropped;
7878
}
7979
}
8080

@@ -118,7 +118,7 @@ void CF_CFDP_S_DispatchRecv(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph,
118118
}
119119
else
120120
{
121-
++CF_AppData.HkPacket.channel_hk[t->chan_num].counters.recv.spurious;
121+
++CF_AppData.hk.channel_hk[t->chan_num].counters.recv.spurious;
122122
CFE_EVS_SendEvent(CF_EID_ERR_CFDP_S_DC_INV, CFE_EVS_EventType_ERROR,
123123
"CF S%d(%lu:%lu): received PDU with invalid directive code %d for sub-state %d",
124124
(t->state == CF_TxnState_S2), (unsigned long)t->history->src_eid,

0 commit comments

Comments
 (0)