Skip to content

Commit 43ec0b7

Browse files
committed
Fix #23: Invoke SAMPLE_Function as part of Process command
The CFE framework sample/lab applications did not have any example use-cases where a _library_ function was invoked. For the FSW verification aspect, it is important to do this at least in one place as it verifies that the run-time linking is working properly, not just for functions in the core image but also for dynamically loaded libraries. The unit test framework also needs to support this use case, to demonstrate that it can link against the stub provided by the library for the local UT. This just simply adds a call to the "SAMPLE_Function" provided by sample_lib to demonstrate this.
1 parent 92311e7 commit 43ec0b7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ project(CFE_SAMPLE_APP C)
44
include_directories(fsw/mission_inc)
55
include_directories(fsw/platform_inc)
66

7+
# Include the public API from sample_lib to demonstrate how
8+
# to call library-provided functions
9+
include_directories(${sample_lib_MISSION_DIR}/fsw/public_inc)
10+
711
aux_source_directory(fsw/src APP_SRC_FILES)
812

913
# Create the app module

fsw/src/sample_app.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
#include "sample_app_version.h"
3333
#include "sample_app.h"
3434

35+
/* The sample_lib module provides the SAMPLE_Function() prototype */
36+
#include <sample_lib.h>
37+
3538
#include <string.h>
3639

3740
/*
@@ -439,6 +442,9 @@ void SAMPLE_ProcessCC( const SAMPLE_Process_t *Msg )
439442

440443
SAMPLE_GetCrc(TableName);
441444

445+
/* Invoke a function provided by SAMPLE_LIB */
446+
SAMPLE_Function();
447+
442448
return;
443449

444450
} /* End of SAMPLE_ProcessCC */

0 commit comments

Comments
 (0)