Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration Candidate 20191230 #34

Merged
merged 5 commits into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ project(CFE_SAMPLE_APP C)
include_directories(fsw/mission_inc)
include_directories(fsw/platform_inc)

# Include the public API from sample_lib to demonstrate how
# to call library-provided functions
include_directories(${sample_lib_MISSION_DIR}/fsw/public_inc)

aux_source_directory(fsw/src APP_SRC_FILES)

# Create the app module
Expand Down
41 changes: 28 additions & 13 deletions fsw/src/sample_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
#include "sample_app.h"
#include "sample_table.h"

/* The sample_lib module provides the SAMPLE_Function() prototype */
#include <sample_lib.h>

#include <string.h>

/*
Expand Down Expand Up @@ -163,8 +166,8 @@ int32 SAMPLE_AppInit( void )
CFE_EVS_BINARY_FILTER);
if (status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("Sample App: Error Registering Events, RC = 0x%08X\n",
status);
CFE_ES_WriteToSysLog("Sample App: Error Registering Events, RC = 0x%08lX\n",
(unsigned long)status);
return ( status );
}

Expand All @@ -184,8 +187,8 @@ int32 SAMPLE_AppInit( void )
Sample_AppData.PipeName);
if (status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("Sample App: Error creating pipe, RC = 0x%08X\n",
status);
CFE_ES_WriteToSysLog("Sample App: Error creating pipe, RC = 0x%08lX\n",
(unsigned long)status);
return ( status );
}

Expand All @@ -196,8 +199,8 @@ int32 SAMPLE_AppInit( void )
Sample_AppData.SAMPLE_CommandPipe);
if (status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("Sample App: Error Subscribing to HK request, RC = 0x%08X\n",
status);
CFE_ES_WriteToSysLog("Sample App: Error Subscribing to HK request, RC = 0x%08lX\n",
(unsigned long)status);
return ( status );
}

Expand All @@ -208,8 +211,8 @@ int32 SAMPLE_AppInit( void )
Sample_AppData.SAMPLE_CommandPipe);
if (status != CFE_SUCCESS )
{
CFE_ES_WriteToSysLog("Sample App: Error Subscribing to Command, RC = 0x%08X\n",
status);
CFE_ES_WriteToSysLog("Sample App: Error Subscribing to Command, RC = 0x%08lX\n",
(unsigned long)status);

return ( status );
}
Expand All @@ -225,7 +228,7 @@ int32 SAMPLE_AppInit( void )
if ( status != CFE_SUCCESS )
{
CFE_ES_WriteToSysLog("Sample App: Error Registering \
Table, RC = 0x%08X\n", status);
Table, RC = 0x%08lX\n", (unsigned long)status);

return ( status );
}
Expand Down Expand Up @@ -353,8 +356,8 @@ void SAMPLE_ReportHousekeeping( const CCSDS_CommandPacket_t *Msg )
/*
** Get command execution counters...
*/
Sample_AppData.SAMPLE_HkTelemetryPkt.sample_command_error_count = Sample_AppData.CmdCounter;
Sample_AppData.SAMPLE_HkTelemetryPkt.sample_command_count = Sample_AppData.ErrCounter;
Sample_AppData.SAMPLE_HkTelemetryPkt.sample_command_error_count = Sample_AppData.ErrCounter;
Sample_AppData.SAMPLE_HkTelemetryPkt.sample_command_count = Sample_AppData.CmdCounter;

/*
** Send housekeeping telemetry packet...
Expand Down Expand Up @@ -427,19 +430,31 @@ void SAMPLE_ResetCounters( const SAMPLE_ResetCounters_t *Msg )
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void SAMPLE_ProcessCC( const SAMPLE_Process_t *Msg )
{
int32 status;
SampleTable_t *TblPtr;
const char *TableName = "SAMPLE_APP.SampleTable";

/* Sample Use of Table */
CFE_TBL_GetAddress((void *)&TblPtr,

status = CFE_TBL_GetAddress((void *)&TblPtr,
Sample_AppData.TblHandles[0]);

if (status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("Sample App: Fail to get table address: 0x%08lx",
(unsigned long)status);
return;
}

CFE_ES_WriteToSysLog("Sample App: Table Value 1: %d Value 2: %d",
TblPtr->Int1,
TblPtr->Int2);

SAMPLE_GetCrc(TableName);

/* Invoke a function provided by SAMPLE_LIB */
SAMPLE_Function();

return;

} /* End of SAMPLE_ProcessCC */
Expand Down Expand Up @@ -524,7 +539,7 @@ void SAMPLE_GetCrc( const char *TableName )
else
{
Crc = TblInfoPtr.Crc;
CFE_ES_WriteToSysLog("Sample App: CRC: 0x%08X\n\n", Crc);
CFE_ES_WriteToSysLog("Sample App: CRC: 0x%08lX\n\n", (unsigned long)Crc);
}

return;
Expand Down