Skip to content

Commit

Permalink
Fix #138, Convert int32 return codes and variables to CFE_Status_t
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Apr 24, 2023
1 parent 6fef38e commit 75c1136
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: "CodeQL Analysis"
on:
push:
pull_request:

jobs:
codeql:
name: CodeQL Analysis
uses: nasa/cFS/.github/workflows/codeql-reusable.yml@main
with:
with:
component-path: apps/ci_lab
make: 'make -C build/native/default_cpu1/apps/ci_lab'
24 changes: 11 additions & 13 deletions fsw/src/ci_lab_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ CI_LAB_GlobalData_t CI_LAB_Global;
* Individual message handler function prototypes
*
* Per the recommended code pattern, these should accept a const pointer
* to a structure type which matches the message, and return an int32
* to a structure type which matches the message, and return a CFE_Status_t
* where CFE_SUCCESS (0) indicates successful handling of the message.
*/
int32 CI_LAB_Noop(const CI_LAB_NoopCmd_t *data);
int32 CI_LAB_ResetCounters(const CI_LAB_ResetCountersCmd_t *data);
CFE_Status_t CI_LAB_Noop(const CI_LAB_NoopCmd_t *data);
CFE_Status_t CI_LAB_ResetCounters(const CI_LAB_ResetCountersCmd_t *data);

/* Housekeeping message handler */
int32 CI_LAB_ReportHousekeeping(const CFE_MSG_CommandHeader_t *data);
CFE_Status_t CI_LAB_ReportHousekeeping(const CFE_MSG_CommandHeader_t *data);

/** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -77,7 +77,7 @@ int32 CI_LAB_ReportHousekeeping(const CFE_MSG_CommandHeader_t *data);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
void CI_Lab_AppMain(void)
{
int32 status;
CFE_Status_t status;
uint32 RunStatus = CFE_ES_RunStatus_APP_RUN;
CFE_SB_Buffer_t *SBBufPtr;

Expand Down Expand Up @@ -257,13 +257,11 @@ void CI_LAB_ProcessGroundCommand(CFE_SB_Buffer_t *SBBufPtr)
/* Handle NOOP command packets */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
int32 CI_LAB_Noop(const CI_LAB_NoopCmd_t *data)
CFE_Status_t CI_LAB_Noop(const CI_LAB_NoopCmd_t *data)
{
/* Does everything the name implies */
CI_LAB_Global.HkTlm.Payload.CommandCounter++;

CFE_EVS_SendEvent(CI_LAB_COMMANDNOP_INF_EID, CFE_EVS_EventType_INFORMATION, "CI: NOOP command");

return CFE_SUCCESS;
}

Expand All @@ -273,7 +271,7 @@ int32 CI_LAB_Noop(const CI_LAB_NoopCmd_t *data)
/* Handle ResetCounters command packets */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
int32 CI_LAB_ResetCounters(const CI_LAB_ResetCountersCmd_t *data)
CFE_Status_t CI_LAB_ResetCounters(const CI_LAB_ResetCountersCmd_t *data)
{
CFE_EVS_SendEvent(CI_LAB_COMMANDRST_INF_EID, CFE_EVS_EventType_INFORMATION, "CI: RESET command");
CI_LAB_ResetCounters_Internal();
Expand All @@ -289,7 +287,7 @@ int32 CI_LAB_ResetCounters(const CI_LAB_ResetCountersCmd_t *data)
/* the software bus */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
int32 CI_LAB_ReportHousekeeping(const CFE_MSG_CommandHeader_t *data)
CFE_Status_t CI_LAB_ReportHousekeeping(const CFE_MSG_CommandHeader_t *data)
{
CI_LAB_Global.HkTlm.Payload.SocketConnected = CI_LAB_Global.SocketConnected;
CFE_SB_TimeStampMsg(CFE_MSG_PTR(CI_LAB_Global.HkTlm.TelemetryHeader));
Expand Down Expand Up @@ -322,9 +320,9 @@ void CI_LAB_ResetCounters_Internal(void)
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
void CI_LAB_ReadUpLink(void)
{
int i;
int32 status;
uint8 *bytes;
int i;
CFE_Status_t status;
uint8 * bytes;

for (i = 0; i <= 10; i++)
{
Expand Down
2 changes: 0 additions & 2 deletions fsw/src/ci_lab_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader;

} CI_LAB_NoArgsCmd_t;

/*
Expand All @@ -63,7 +62,6 @@ typedef struct
uint32 IngestPackets;
uint32 IngestErrors;
uint32 Spare2;

} CI_LAB_HkTlm_Payload_t;

typedef struct
Expand Down

0 comments on commit 75c1136

Please sign in to comment.