Skip to content
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
11 changes: 9 additions & 2 deletions .github/workflows/codeql-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@ name: CodeQl Analysis

on:
push:
branches:
- dev
- main
pull_request:

types:
- opened
- reopened
- synchronize
workflow_dispatch:

jobs:
codeql:
name: Codeql Analysis
uses: nasa/cFS/.github/workflows/codeql-reusable.yml@main
with:
with:
component-path: apps/sample_app
prep: 'make prep; make -C build/tools/elf2cfetbl'
make: 'make -C build/native/default_cpu1/apps/sample_app'
6 changes: 4 additions & 2 deletions .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ name: Format Check

# Run on all push and pull requests
on:
push:
pull_request:
types:
- opened
- reopened
- synchronize

jobs:
format-check:
name: Run format check
uses: nasa/cFS/.github/workflows/format-check.yml@main

8 changes: 8 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ name: Static Analysis
# Run on all push and pull requests
on:
push:
branches:
- dev
- main
pull_request:
types:
- opened
- reopened
- synchronize
workflow_dispatch:

jobs:
static-analysis:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(APP_SRC_FILES
fsw/src/sample_app_utils.c
)

if (CFE_EDS_ENABLED_BUILD)
if (CFE_EDS_ENABLED)
list(APPEND APP_SRC_FILES
fsw/src/sample_app_eds_dispatch.c
)
Expand Down
20 changes: 4 additions & 16 deletions arch_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,12 @@

# 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_internal_cfg_values.h
sample_app_platform_cfg.h
sample_app_perfids.h
sample_app_msgids.h
sample_app_msgid_values.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()
generate_configfile_set(${SAMPLE_APP_PLATFORM_CONFIG_FILE_LIST})

45 changes: 45 additions & 0 deletions config/default_sample_app_fcncode_values.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/************************************************************************
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2023 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 CFE Executive Services (CFE_ES) 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 DEFAULT_SAMPLE_APP_FCNCODE_VALUES_H
#define DEFAULT_SAMPLE_APP_FCNCODE_VALUES_H

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

#define SAMPLE_APP_CCVAL(x) SAMPLE_APP_FunctionCode_##x

Check notice

Code scanning / CodeQL

Undisciplined macro Note

The macro SAMPLE_APP_CCVAL(x) uses token pasting and is not allowed.

enum SAMPLE_APP_FunctionCode_
{
SAMPLE_APP_FunctionCode_NOOP = 0,
SAMPLE_APP_FunctionCode_RESET_COUNTERS = 1,
SAMPLE_APP_FunctionCode_PROCESS = 2,
SAMPLE_APP_FunctionCode_DISPLAY_PARAM = 3,
};

#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2020 United States Government as represented by the
* Copyright (c) 2023 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
Expand All @@ -25,20 +25,14 @@
* 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
* @note This file may be overridden/superceded by mission-provided definitionsm
* 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
#ifndef DEFAULT_SAMPLE_APP_INTERFACE_CFG_H
#define DEFAULT_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
/* Use the default configuration value for all */
#define SAMPLE_APP_MISSION_CFGVAL(x) DEFAULT_SAMPLE_APP_MISSION_##x

Check notice

Code scanning / CodeQL

Undisciplined macro Note

The macro SAMPLE_APP_MISSION_CFGVAL(x) uses token pasting and is not allowed.

#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2020 United States Government as represented by the
* Copyright (c) 2023 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
Expand All @@ -25,21 +25,14 @@
* 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
* @note This file may be overridden/superceded by mission-provided definitions
* 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
#ifndef DEFAULT_SAMPLE_APP_INTERNAL_CFG_H
#define DEFAULT_SAMPLE_APP_INTERNAL_CFG_H

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

#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
/* Use the default configuration value for all */
#define SAMPLE_APP_PLATFORM_CFGVAL(x) DEFAULT_SAMPLE_APP_PLATFORM_##x

Check notice

Code scanning / CodeQL

Undisciplined macro Note

The macro SAMPLE_APP_PLATFORM_CFGVAL(x) uses token pasting and is not allowed.

#endif
10 changes: 5 additions & 5 deletions config/default_sample_app_mission_cfg.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2020 United States Government as represented by the
* Copyright (c) 2023 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
Expand All @@ -24,12 +24,12 @@
* 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
* @note This file may be overridden/superceded by mission-provided definitions
* 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
#ifndef DEFAULT_SAMPLE_APP_MISSION_CFG_H
#define DEFAULT_SAMPLE_APP_MISSION_CFG_H

#include "sample_app_interface_cfg.h"

Expand Down
10 changes: 5 additions & 5 deletions config/default_sample_app_msg.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2020 United States Government as represented by the
* Copyright (c) 2023 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
Expand All @@ -24,12 +24,12 @@
* 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
* @note This file may be overridden/superceded by mission-provided definitions
* 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
#ifndef DEFAULT_SAMPLE_APP_MSG_H
#define DEFAULT_SAMPLE_APP_MSG_H

#include "sample_app_mission_cfg.h"
#include "sample_app_msgdefs.h"
Expand Down
20 changes: 9 additions & 11 deletions config/default_sample_app_msgdefs.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2020 United States Government as represented by the
* Copyright (c) 2023 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
Expand All @@ -19,21 +19,19 @@
/**
* @file
* Specification for the SAMPLE_APP command and telemetry
* message constant definitions.
*
* For SAMPLE_APP this is only the function/command code definitions
* message payload and constant definitions.
*/
#ifndef SAMPLE_APP_MSGDEFS_H
#define SAMPLE_APP_MSGDEFS_H
#ifndef DEFAULT_SAMPLE_APP_MSGDEFS_H
#define DEFAULT_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 */
uint32 ValU32; /**< 32 bit unsigned integer value */
int16 ValI16; /**< 16 bit signed integer value */
char ValStr[SAMPLE_APP_MISSION_STRING_VAL_LEN]; /**< An example string */
} SAMPLE_APP_DisplayParam_Payload_t;

/*************************************************************************/
Expand All @@ -43,8 +41,8 @@ typedef struct SAMPLE_APP_DisplayParam_Payload

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

Expand Down
32 changes: 32 additions & 0 deletions config/default_sample_app_msgid_values.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/************************************************************************
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2023 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 Topic IDs
*/
#ifndef DEFAULT_SAMPLE_APP_MSGID_VALUES_H
#define DEFAULT_SAMPLE_APP_MSGID_VALUES_H

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

#define SAMPLE_APP_CMD_PLATFORM_MIDVAL(x) CFE_PLATFORM_CMD_TOPICID_TO_MIDV(SAMPLE_APP_MISSION_##x##_TOPICID)

Check notice

Code scanning / CodeQL

Undisciplined macro Note

The macro SAMPLE_APP_CMD_PLATFORM_MIDVAL(x) uses token pasting and is not allowed.
#define SAMPLE_APP_TLM_PLATFORM_MIDVAL(x) CFE_PLATFORM_TLM_TOPICID_TO_MIDV(SAMPLE_APP_MISSION_##x##_TOPICID)

Check notice

Code scanning / CodeQL

Undisciplined macro Note

The macro SAMPLE_APP_TLM_PLATFORM_MIDVAL(x) uses token pasting and is not allowed.

#endif
16 changes: 8 additions & 8 deletions config/default_sample_app_msgids.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2020 United States Government as represented by the
* Copyright (c) 2023 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
Expand All @@ -20,14 +20,14 @@
* @file
* SAMPLE_APP Application Message IDs
*/
#ifndef SAMPLE_APP_MSGIDS_H
#define SAMPLE_APP_MSGIDS_H
#ifndef DEFAULT_SAMPLE_APP_MSGIDS_H
#define DEFAULT_SAMPLE_APP_MSGIDS_H

#include "cfe_core_api_base_msgids.h"
#include "sample_app_topicids.h"
#include "sample_app_msgid_values.h"

#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)
#define SAMPLE_APP_CMD_MID SAMPLE_APP_CMD_PLATFORM_MIDVAL(CMD)
#define SAMPLE_APP_SEND_HK_MID SAMPLE_APP_CMD_PLATFORM_MIDVAL(SEND_HK)
#define SAMPLE_APP_HK_TLM_MID SAMPLE_APP_TLM_PLATFORM_MIDVAL(HK_TLM)

#endif
8 changes: 4 additions & 4 deletions config/default_sample_app_msgstruct.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2020 United States Government as represented by the
* Copyright (c) 2023 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
Expand All @@ -25,8 +25,8 @@
* Constants and enumerated types related to these message structures
* are defined in sample_app_msgdefs.h.
*/
#ifndef SAMPLE_APP_MSGSTRUCT_H
#define SAMPLE_APP_MSGSTRUCT_H
#ifndef DEFAULT_SAMPLE_APP_MSGSTRUCT_H
#define DEFAULT_SAMPLE_APP_MSGSTRUCT_H

/************************************************************************
* Includes
Expand Down
Loading
Loading