Skip to content

Commit

Permalink
Fix nasa#2320, reorganize SB header files
Browse files Browse the repository at this point in the history
Organize SB header file contents according to the convention
  • Loading branch information
jphickey committed May 3, 2023
1 parent ca1cf87 commit a10d382
Show file tree
Hide file tree
Showing 13 changed files with 1,042 additions and 352 deletions.
32 changes: 32 additions & 0 deletions modules/sb/arch_build.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
###########################################################
#
# SB Core Module 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 SB configuration
set(SB_PLATFORM_CONFIG_FILE_LIST
cfe_sb_internal_cfg.h
cfe_sb_msgids.h
cfe_sb_platform_cfg.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(SB_CFGFILE ${SB_PLATFORM_CONFIG_FILE_LIST})
get_filename_component(CFGKEY "${SB_CFGFILE}" NAME_WE)
if (DEFINED SB_CFGFILE_SRC_${CFGKEY})
set(DEFAULT_SOURCE "${SB_CFGFILE_SRC_${CFGKEY}}")
else()
set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SB_CFGFILE}")
endif()
generate_config_includefile(
FILE_NAME "${SB_CFGFILE}"
FALLBACK_FILE ${DEFAULT_SOURCE}
)
endforeach()
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@
#ifndef CFE_SB_EXTERN_TYPEDEFS_H
#define CFE_SB_EXTERN_TYPEDEFS_H

/* This header may be generated from an EDS file,
* tools are available and the feature is enabled */
#ifdef CFE_EDS_ENABLED_BUILD

/* Use the EDS generated version of these types */
#include "cfe_sb_eds_typedefs.h"

#else
/* Use the local definitions of these types */

#include "common_types.h"
#include "cfe_mission_cfg.h"
#include "cfe_resourceid_typedef.h"
Expand Down Expand Up @@ -135,6 +125,4 @@ typedef struct
currently unused */
} CFE_SB_Qos_t;

#endif /* CFE_EDS_ENABLED_BUILD */

#endif /* CFE_SB_EXTERN_TYPEDEFS_H */

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions modules/sb/config/default_cfe_sb_interface_cfg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/************************************************************************
* 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 WARRANTISB OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
************************************************************************/

/**
* @file
* CFE Software Bus (CFE_SB) 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 CFE_SB_INTERFACE_CFG_H
#define CFE_SB_INTERFACE_CFG_H

/**
** \cfesbcfg Maximum SB Message Size
**
** \par Description:
** The following definition dictates the maximum message size allowed on
** the software bus. SB checks the pkt length field in the header of all
** messages sent. If the pkt length field indicates the message is larger
** than this define, SB sends an event and rejects the send.
**
** \par Limits
** This parameter has a lower limit of 6 (CCSDS primary header size). There
** are no restrictions on the upper limit however, the maximum message size is
** system dependent and should be verified. Total message size values that are
** checked against this configuration are defined by a 16 bit data word.
*/
#define CFE_MISSION_SB_MAX_SB_MSG_SIZE 32768

/**
** \cfesbcfg Maximum Number of pipes that SB command/telemetry messages may hold
**
** \par Description:
** Dictates the maximum number of unique Pipes the SB message definitions will hold.
**
** This affects the layout of command/telemetry messages but does not affect run
** time behavior or internal allocation.
**
** \par Limits
** All CPUs within the same SB domain (mission) must share the same definition
** Note this affects the size of messages, so it must not cause any message
** to exceed the max length.
**
*/
#define CFE_MISSION_SB_MAX_PIPES 64

#endif
Loading

0 comments on commit a10d382

Please sign in to comment.