Skip to content

Commit

Permalink
Merge branch 'nasa:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
dzbaker authored Dec 26, 2023
2 parents 014c9d5 + 1e83c77 commit 92edb74
Show file tree
Hide file tree
Showing 30 changed files with 1,445 additions and 288 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'
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## Development Build: v2.5.0-rc4_dev81
- define msgids via topicids
- See <https://github.com/nasa/ci_lab/pull/165>

## Development Build: v2.5.0-rc4+dev77
- Remove unused PDU related function codes
- Remove obsolete README comment
- Configurable timeouts and loops
- See <https://github.com/nasa/ci_lab/pull/157>, <https://github.com/nasa/ci_lab/pull/159>, and <https://github.com/nasa/ci_lab/pull/161>

## Development Build: v2.5.0-rc4+dev69
- add decode hooks
- Add version information to NOOP event
- See <https://github.com/nasa/ci_lab/pull/152> and <https://github.com/nasa/ci_lab/pull/153>

## Development Build: v2.5.0-rc4+dev51
- reorganize source files
- See <https://github.com/nasa/ci_lab/pull/148>

## Development Build: v2.5.0-rc4+dev47
- Create Workflow for IC Bundle Generation
- See <https://github.com/nasa/ci_lab/pull/143>

## Development Build: v2.5.0-rc4+dev43
- update cmake recipe
- See <https://github.com/nasa/ci_lab/pull/136>
Expand Down
19 changes: 15 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,23 @@ project(CFS_CI_LAB C)

set(APP_SRC_FILES
fsw/src/ci_lab_app.c
fsw/src/ci_lab_cmds.c
)

if (CFE_EDS_ENABLED_BUILD)
list(APPEND APP_SRC_FILES
fsw/src/ci_lab_eds_dispatch.c
fsw/src/ci_lab_eds_decode.c
)
else()
list(APPEND APP_SRC_FILES
fsw/src/ci_lab_dispatch.c
fsw/src/ci_lab_passthru_decode.c
)
endif()


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

target_include_directories(ci_lab PUBLIC
fsw/mission_inc
fsw/platform_inc
)
target_include_directories(ci_lab PUBLIC fsw/inc)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ci_lab is a simple command uplink application that accepts CCSDS telecommand pac

## Known issues

Dependence on cfe platform config header is undesirable, and the check is not endian safe. As a lab application, extensive testing is not performed prior to release and only minimal functionality is included.
As a lab application, extensive testing is not performed prior to release and only minimal functionality is included.

## Getting Help

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 @@
###########################################################
#
# CI_LAB 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 CI_LAB configuration
set(CI_LAB_PLATFORM_CONFIG_FILE_LIST
ci_lab_internal_cfg.h
ci_lab_platform_cfg.h
ci_lab_perfids.h
ci_lab_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(CI_LAB_CFGFILE ${CI_LAB_PLATFORM_CONFIG_FILE_LIST})
get_filename_component(CFGKEY "${CI_LAB_CFGFILE}" NAME_WE)
if (DEFINED CI_LAB_CFGFILE_SRC_${CFGKEY})
set(DEFAULT_SOURCE GENERATED_FILE "${CI_LAB_CFGFILE_SRC_${CFGKEY}}")
else()
set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${CI_LAB_CFGFILE}")
endif()
generate_config_includefile(
FILE_NAME "${CI_LAB_CFGFILE}"
${DEFAULT_SOURCE}
)
endforeach()
41 changes: 41 additions & 0 deletions config/default_ci_lab_fcncodes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/************************************************************************
* 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 CI_LAB 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 CI_LAB_FCNCODES_H
#define CI_LAB_FCNCODES_H

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

/*
** CI_LAB command codes
*/
#define CI_LAB_NOOP_CC 0
#define CI_LAB_RESET_COUNTERS_CC 1

#endif
50 changes: 50 additions & 0 deletions config/default_ci_lab_interface_cfg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/************************************************************************
* 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
* CI_LAB 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 CI_LAB_INTERFACE_CFG_H
#define CI_LAB_INTERFACE_CFG_H

/**
* @brief The base UDP port where CI_LAB will listen for incoming messages
*
* In order to allow multiple instances of CFE to run on the same host, the
* processor number - 1 is added to this value. This, if this is set to
* "1234", then the following ports will be used at runtime:
*
* Processor 1: port 1234
* Processor 2: port 1235
* Processor 3: port 1236
*
* And so forth for however many processor numbers exist in the system
*/
#define CI_LAB_BASE_UDP_PORT 1234

#endif
65 changes: 65 additions & 0 deletions config/default_ci_lab_internal_cfg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/************************************************************************
* 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
* CI_LAB 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 CI_LAB_INTERNAL_CFG_H
#define CI_LAB_INTERNAL_CFG_H

/**
* @brief The size of the input buffer
*
* This definition controls the maximum size message that can be ingested
* from the UDP socket
*/
#define CI_LAB_MAX_INGEST 768

/**
* @brief Number of packets to process per ingest cycle
*/
#define CI_LAB_MAX_INGEST_PKTS 10

/**
* @brief SB Receive timeout
*/
#define CI_LAB_SB_RECEIVE_TIMEOUT 500

/**
* @brief Uplink Receive timeout
*/
#define CI_LAB_UPLINK_RECEIVE_TIMEOUT OS_CHECK

/**
* @brief The depth of the command input pipe
*
* This controls the depth of the SB input pipe
*/
#define CI_LAB_PIPE_DEPTH 32

#endif
27 changes: 12 additions & 15 deletions fsw/src/ci_lab_events.h → config/default_ci_lab_mission_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,19 @@

/**
* @file
* Define CI Lab Events IDs
*
* CI_LAB 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 CI_LAB_EVENTS_H
#define CI_LAB_EVENTS_H
#ifndef CI_LAB_MISSION_CFG_H
#define CI_LAB_MISSION_CFG_H

#define CI_LAB_RESERVED_EID 0
#define CI_LAB_SOCKETCREATE_ERR_EID 1
#define CI_LAB_SOCKETBIND_ERR_EID 2
#define CI_LAB_STARTUP_INF_EID 3
#define CI_LAB_COMMAND_ERR_EID 4
#define CI_LAB_COMMANDNOP_INF_EID 5
#define CI_LAB_COMMANDRST_INF_EID 6
#define CI_LAB_INGEST_INF_EID 7
#define CI_LAB_INGEST_LEN_ERR_EID 8
#define CI_LAB_INGEST_ALLOC_ERR_EID 9
#define CI_LAB_INGEST_SEND_ERR_EID 10
#define CI_LAB_LEN_ERR_EID 16
#include "ci_lab_interface_cfg.h"

#endif
38 changes: 38 additions & 0 deletions config/default_ci_lab_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 CI_LAB command and telemetry
* message data types.
*
* This is a compatibility header for the "ci_lab_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 CI_LAB_MSG_H
#define CI_LAB_MSG_H

#include "ci_lab_interface_cfg.h"
#include "ci_lab_msgdefs.h"
#include "ci_lab_msgstruct.h"

#endif
47 changes: 47 additions & 0 deletions config/default_ci_lab_msgdefs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/************************************************************************
* 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 CI_LAB command and telemetry
* message constant definitions.
*
* For CI_LAB this is only the function/command code definitions
*/
#ifndef CI_LAB_MSGDEFS_H
#define CI_LAB_MSGDEFS_H

#include "ci_lab_fcncodes.h"

/*************************************************************************/
/*
** Payload definition (CI_LAB housekeeping)...
*/
typedef struct
{
uint8 CommandErrorCounter;
uint8 CommandCounter;
uint8 EnableChecksums;
uint8 SocketConnected;
uint8 Spare1[8];
uint32 IngestPackets;
uint32 IngestErrors;
uint32 Spare2;
} CI_LAB_HkTlm_Payload_t;

#endif
Loading

0 comments on commit 92edb74

Please sign in to comment.