Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into jph-techdev-scriptengine
Browse files Browse the repository at this point in the history
  • Loading branch information
jphickey committed Apr 15, 2024
2 parents 64678f8 + 41018a8 commit 3b66f0c
Show file tree
Hide file tree
Showing 47 changed files with 2,527 additions and 710 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## Development Build: equuleus-rc1+dev36
- updating sample_app to use new versioning system
- See <https://github.com/nasa/sample_app/pull/226>

## Development Build: v1.3.0-rc4+dev69
- define msgids via topicids
- See <https://github.com/nasa/sample_app/pull/220>

## Development Build: v1.3.0-rc4+dev65
- bring sample_app fully into compliance
- Rename CommandCode variable to FcnCode
- Add check for success of CFE_TBL_Load() during Initialization
- See <https://github.com/nasa/sample_app/pull/212>, <https://github.com/nasa/sample_app/pull/187>, and <https://github.com/nasa/sample_app/pull/190>

## Development Build: v1.3.0-rc4+dev56
- Apply consistent Event ID names to common events
- Remove component-specific cFE header #includes
- Refactor SAMPLE_APP_Init/Process to remove multiple returns
- Add test for missing branch in SAMPLE_APP_Process()
- Zero out global data structure during initialization
- Move cmds and utils into separate files
- organize source files according to current patterns
- See <https://github.com/nasa/sample_app/pull/189>, <https://github.com/nasa/sample_app/pull/195>, <https://github.com/nasa/sample_app/pull/198>, <https://github.com/nasa/sample_app/pull/200>, <https://github.com/nasa/sample_app/pull/201>, <https://github.com/nasa/sample_app/pull/205>, and <https://github.com/nasa/sample_app/pull/208>

## Development Build: v1.3.0-rc4+dev39
- update cmake recipe
- See <https://github.com/nasa/sample_app/pull/203>

## Development Build: v1.3.0-rc4+dev35
- Remove redundant comments
- Create CHANGELOG.md
Expand Down
25 changes: 18 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
project(CFE_SAMPLE_APP C)

include_directories(fsw/mission_inc)
include_directories(fsw/platform_inc)

# Create the app module
add_cfe_app(sample_app
set(APP_SRC_FILES
fsw/src/sample_app.c
fsw/src/sample_app_dispatch.c
fsw/src/sample_app_cmds.c
fsw/src/sample_app_utils.c
)

if (CFE_EDS_ENABLED_BUILD)
list(APPEND APP_SRC_FILES
fsw/src/sample_app_eds_dispatch.c
)
else()
list(APPEND APP_SRC_FILES
fsw/src/sample_app_dispatch.c
)
endif()

# Create the app module
add_cfe_app(sample_app ${APP_SRC_FILES})

target_include_directories(sample_app PUBLIC fsw/inc)
# Include the public API from sample_lib to demonstrate how
# to call library-provided functions
add_cfe_app_dependency(sample_app sample_lib scriptengine)

# Add table
add_cfe_tables(sampleAppTable fsw/tables/sample_app_tbl.c)
add_cfe_tables(sample_app fsw/tables/sample_app_tbl.c)

# If UT is enabled, then add the tests from the subdirectory
# Note that this is an app, and therefore does not provide
Expand Down
33 changes: 33 additions & 0 deletions arch_build.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
###########################################################
#
# SAMPLE_APP platform build setup
#
# This file is evaluated as part of the "prepare" stage
# and can be used to set up prerequisites for the build,
# such as generating header files
#
###########################################################

# The list of header files that control the SAMPLE_APP configuration
set(SAMPLE_APP_PLATFORM_CONFIG_FILE_LIST
sample_app_internal_cfg.h
sample_app_platform_cfg.h
sample_app_perfids.h
sample_app_msgids.h
)

# Create wrappers around the all the config header files
# This makes them individually overridable by the missions, without modifying
# the distribution default copies
foreach(SAMPLE_APP_CFGFILE ${SAMPLE_APP_PLATFORM_CONFIG_FILE_LIST})
get_filename_component(CFGKEY "${SAMPLE_APP_CFGFILE}" NAME_WE)
if (DEFINED SAMPLE_APP_CFGFILE_SRC_${CFGKEY})
set(DEFAULT_SOURCE GENERATED_FILE "${SAMPLE_APP_CFGFILE_SRC_${CFGKEY}}")
else()
set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SAMPLE_APP_CFGFILE}")
endif()
generate_config_includefile(
FILE_NAME "${SAMPLE_APP_CFGFILE}"
${DEFAULT_SOURCE}
)
endforeach()
43 changes: 43 additions & 0 deletions config/default_sample_app_fcncodes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
*
* Copyright (c) 2020 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
************************************************************************/

/**
* @file
* Specification for the SAMPLE_APP command function codes
*
* @note
* This file should be strictly limited to the command/function code (CC)
* macro definitions. Other definitions such as enums, typedefs, or other
* macros should be placed in the msgdefs.h or msg.h files.
*/
#ifndef SAMPLE_APP_FCNCODES_H
#define SAMPLE_APP_FCNCODES_H

/************************************************************************
* Macro Definitions
************************************************************************/

/*
** Sample App command codes
*/
#define SAMPLE_APP_NOOP_CC 0
#define SAMPLE_APP_RESET_COUNTERS_CC 1
#define SAMPLE_APP_PROCESS_CC 2
#define SAMPLE_APP_DISPLAY_PARAM_CC 3

#endif
44 changes: 44 additions & 0 deletions config/default_sample_app_interface_cfg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
*
* Copyright (c) 2020 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
************************************************************************/

/**
* @file
* SAMPLE_APP Application Public Definitions
*
* This provides default values for configurable items that affect
* the interface(s) of this module. This includes the CMD/TLM message
* interface, tables definitions, and any other data products that
* serve to exchange information with other entities.
*
* @note This file may be overridden/superceded by mission-provided defintions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
#ifndef SAMPLE_APP_INTERFACE_CFG_H
#define SAMPLE_APP_INTERFACE_CFG_H

/**
* \brief Length of string buffer in the Display Value command
*
* The Display Value command offers an example of how to use command
* parameters of different types. This macro controls the length
* of the string parameter.
*/
#define SAMPLE_APP_STRING_VAL_LEN 10

#endif
44 changes: 44 additions & 0 deletions config/default_sample_app_internal_cfg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
*
* Copyright (c) 2020 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
************************************************************************/

/**
* @file
* SAMPLE_APP Application Private Config Definitions
*
* This provides default values for configurable items that are internal
* to this module and do NOT affect the interface(s) of this module. Changes
* to items in this file only affect the local module and will be transparent
* to external entities that are using the public interface(s).
*
* @note This file may be overridden/superceded by mission-provided defintions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
#ifndef SAMPLE_APP_INTERNAL_CFG_H
#define SAMPLE_APP_INTERNAL_CFG_H

/***********************************************************************/
#define SAMPLE_APP_PIPE_DEPTH 32 /* Depth of the Command Pipe for Application */

#define SAMPLE_APP_NUMBER_OF_TABLES 1 /* Number of Example Table(s) */

#define SAMPLE_APP_TABLE_OUT_OF_RANGE_ERR_CODE -1

#define SAMPLE_APP_TBL_ELEMENT_1_MAX 10

#endif
36 changes: 36 additions & 0 deletions config/default_sample_app_mission_cfg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
*
* Copyright (c) 2020 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
************************************************************************/

/**
* @file
*
* SAMPLE_APP Application Mission Configuration Header File
*
* This is a compatibility header for the "mission_cfg.h" file that has
* traditionally provided public config definitions for each CFS app.
*
* @note This file may be overridden/superceded by mission-provided defintions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
#ifndef SAMPLE_APP_MISSION_CFG_H
#define SAMPLE_APP_MISSION_CFG_H

#include "sample_app_interface_cfg.h"

#endif
38 changes: 38 additions & 0 deletions config/default_sample_app_msg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
*
* Copyright (c) 2020 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
************************************************************************/

/**
* @file
* Specification for the SAMPLE_APP command and telemetry
* message data types.
*
* This is a compatibility header for the "sample_app_msg.h" file that has
* traditionally provided the message definitions for cFS apps.
*
* @note This file may be overridden/superceded by mission-provided defintions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
#ifndef SAMPLE_APP_MSG_H
#define SAMPLE_APP_MSG_H

#include "sample_app_mission_cfg.h"
#include "sample_app_msgdefs.h"
#include "sample_app_msgstruct.h"

#endif
51 changes: 51 additions & 0 deletions config/default_sample_app_msgdefs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
*
* Copyright (c) 2020 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
************************************************************************/

/**
* @file
* Specification for the SAMPLE_APP command and telemetry
* message constant definitions.
*
* For SAMPLE_APP this is only the function/command code definitions
*/
#ifndef SAMPLE_APP_MSGDEFS_H
#define SAMPLE_APP_MSGDEFS_H

#include "common_types.h"
#include "sample_app_fcncodes.h"

typedef struct SAMPLE_APP_DisplayParam_Payload
{
uint32 ValU32; /**< 32 bit unsigned integer value */
int16 ValI16; /**< 16 bit signed integer value */
char ValStr[SAMPLE_APP_STRING_VAL_LEN]; /**< An example string */
} SAMPLE_APP_DisplayParam_Payload_t;

/*************************************************************************/
/*
** Type definition (Sample App housekeeping)
*/

typedef struct SAMPLE_APP_HkTlm_Payload
{
uint8 CommandErrorCounter;
uint8 CommandCounter;
uint8 spare[2];
} SAMPLE_APP_HkTlm_Payload_t;

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,16 @@

/**
* @file
*
* Define Sample App Message IDs
*
* \note The Sample App assumes default configuration which uses V1 of message id implementation
* SAMPLE_APP Application Message IDs
*/

#ifndef SAMPLE_APP_MSGIDS_H
#define SAMPLE_APP_MSGIDS_H

#include "cfe_msgids.h"
#include "cfe_core_api_base_msgids.h"
#include "sample_app_topicids.h"

#define SAMPLE_APP_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MID(CFE_MISSION_SAMPLE_APP_CMD_TOPICID)
#define SAMPLE_APP_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MID(CFE_MISSION_SAMPLE_APP_SEND_HK_TOPICID)
#define SAMPLE_APP_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MID(CFE_MISSION_SAMPLE_APP_HK_TLM_TOPICID)
#define SAMPLE_APP_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_SAMPLE_APP_CMD_TOPICID)
#define SAMPLE_APP_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_SAMPLE_APP_SEND_HK_TOPICID)
#define SAMPLE_APP_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_SAMPLE_APP_HK_TLM_TOPICID)

#endif /* SAMPLE_APP_MSGIDS_H */
#endif
Loading

0 comments on commit 3b66f0c

Please sign in to comment.