Skip to content

Commit

Permalink
Fix nasa#30, Update config files to match naming convention
Browse files Browse the repository at this point in the history
Updates BP config file structure to adhere to the naming/content
conventions prescribed in the CFE documentation.  This is primarily
moving content between headers, not changing the content itself.
  • Loading branch information
jphickey committed May 31, 2023
1 parent b7be6c4 commit f21dec5
Show file tree
Hide file tree
Showing 27 changed files with 445 additions and 240 deletions.
9 changes: 4 additions & 5 deletions .github/buildconfig/rx/tables/bp_flowtable.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@
*
*************************************************************************/


/************************************************************************
** Includes
*************************************************************************/

#include <stdint.h>

#include "cfe.h"
#include "bp_cfg.h"
#include "bp_flow.h"
#include "bp_tbl.h"
#include "bp_platform_cfg.h"
#include "bplib.h"
#include "cfe_tbl_filedef.h"

Expand All @@ -32,13 +31,13 @@ CFE_TBL_FileDef_t CFE_TBL_FileDef =
"BP.FlowTable",
"Configuration of bundle flows",
"bp_flowtable.tbl",
sizeof(BP_FlowTbl_t)
sizeof(BP_FlowTable_t)
};

/*
** Table contents
*/
BP_FlowTbl_t BP_FlowTable =
BP_FlowTable_t BP_FlowTable =
{
.LocalNodeIpn = 13,
.Flows =
Expand Down
9 changes: 4 additions & 5 deletions .github/buildconfig/tx/tables/bp_flowtable.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@
*
*************************************************************************/


/************************************************************************
** Includes
*************************************************************************/

#include <stdint.h>

#include "cfe.h"
#include "bp_cfg.h"
#include "bp_flow.h"
#include "bp_tbl.h"
#include "bp_platform_cfg.h"
#include "bplib.h"
#include "cfe_tbl_filedef.h"

Expand All @@ -32,13 +31,13 @@ CFE_TBL_FileDef_t CFE_TBL_FileDef =
"BP.FlowTable",
"Configuration of bundle flows",
"bp_flowtable.tbl",
sizeof(BP_FlowTbl_t)
sizeof(BP_FlowTable_t)
};

/*
** Table contents
*/
BP_FlowTbl_t BP_FlowTable =
BP_FlowTable_t BP_FlowTable =
{
.LocalNodeIpn = 12,
.Flows =
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

project(CFS_BP C)

include_directories(fsw/mission_inc)
include_directories(fsw/platform_inc)
include_directories(fsw/custom)
include_directories(fsw/src)

Expand All @@ -30,6 +28,8 @@ set(APP_TABLE_FILES
add_cfe_app(bp ${APP_SRC_FILES})
add_cfe_tables(bp ${APP_TABLE_FILES})

target_include_directories(bp PUBLIC fsw/inc)

# Indicate that this app depends on BPLIB
add_cfe_app_dependency(bp bplib iodriver)

Expand Down
39 changes: 39 additions & 0 deletions arch_build.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
###########################################################
#
# BP 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 BP configuration
set(BP_PLATFORM_CONFIG_FILE_LIST
bp_internal_cfg.h
bp_platform_cfg.h
bp_msgids.h
)

if (CFE_EDS_ENABLED_BUILD)

# In an EDS-based build, msgids come generated from the EDS tool
set(BP_CFGFILE_SRC_bp_msgids "${CMAKE_CURRENT_LIST_DIR}/config/bp_eds_msg_topicids.h")

endif(CFE_EDS_ENABLED_BUILD)

# Create wrappers around the all the config header files
# This makes them individually overridable by the missions, without modifying
# the distribution default copies
foreach(BP_CFGFILE ${BP_PLATFORM_CONFIG_FILE_LIST})
get_filename_component(CFGKEY "${BP_CFGFILE}" NAME_WE)
if (DEFINED BP_CFGFILE_SRC_${CFGKEY})
set(DEFAULT_SOURCE "${BP_CFGFILE_SRC_${CFGKEY}}")
else()
set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${BP_CFGFILE}")
endif()
generate_config_includefile(
FILE_NAME "${BP_CFGFILE}"
FALLBACK_FILE ${DEFAULT_SOURCE}
)
endforeach()
27 changes: 15 additions & 12 deletions fsw/src/bp_msgdefs.h → config/default_bp_fcncodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,21 @@
*
*/

#ifndef BP_MSGDEFS_H
#define BP_MSGDEFS_H

/*************************************************************************
* Includes
**************************************************************************/

#include "cfe.h"
/**
* @file
* Specification for the Bundle Protocol (BP) 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 BP_FCNCODES_H
#define BP_FCNCODES_H

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

/* BP_CMD_MID */
#define BP_NOOP_CC 0
Expand All @@ -54,4 +57,4 @@
#define BP_WAKEUP_CC 0
#define BP_WAKEUP_PROCESS_CC 1

#endif /* BP_MSGDEFS_H */
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,8 @@
*
*/

#ifndef BP_PLATFORM_CFG_H
#define BP_PLATFORM_CFG_H

#include "bp_perfids.h"

/* By default override the semaphore array size to match the number of
* CFDP channels. The out-of-the-box behavior of the BP app is to integrate
* with the CF task and throttle CFDP. */
#define BP_NUM_SEM_THROTTLES 2

/* Depending on the epoch being used by time services, this value needs to
* be changed to reflect the number of seconds from the epoch to J2000. */
#define BP_CFE_SECS_AT_2000 630720013
#ifndef BP_INTERFACE_CFG_H
#define BP_INTERFACE_CFG_H

/* Name of the flash storage service used in the flow table and in the
* custome storage configuration module */
Expand All @@ -44,4 +33,60 @@
* custome storage configuration module */
#define BP_FILE_STORE "FILE"

#endif /* BP_PLATFORM_CFG_H */
/*
* Maximum size of a flow name in table and message structs
*/

#define BP_FLOW_NAME_SIZE 8

/*
* Maximum size of a storage service name in table and message structs
*/
#define BP_STORE_NAME_SIZE 8

/*
* Maximum number of statically allocated flow control structures
*/
#define BP_MAX_FLOWS 8

/*
* Maximum number of statically allocated I/O control structures
*/
#define BP_MAX_IO_DESC BP_MAX_FLOWS

/*
* Maximum size of the bundle supported by the application
*/
#define BP_MAX_BUNDLE_SIZE 4096

/*
* Maximum size of CCSDS packet supported by the application
*/
#define BP_MAX_PACKET_SIZE 4096

/*
* Maximum string length of per flow software bus pipe name
*/
#define BP_PIPE_NAME_SIZE CFE_MISSION_MAX_API_LEN

/*
* Maximum string length of throttle semaphore name
*/
#define BP_SEM_NAME_SIZE CFE_MISSION_MAX_API_LEN

/*
* Maximum number of packets per flow that can be subscribed to
*/
#define BP_PKTTBL_MAX_ROWS 4

/*
* CFDP class 1 entity id used for direct file transfer
*/
#define BP_FILE_CFDP_ENTITY_ID 0x0101

/*
* CCSDS message id used to encapsulate CFDP class 1 PDUs
*/
#define BP_FILE_CFDP_TLM_MID 0x0B26

#endif /* BP_INTERFACE_CFG_H */
Loading

0 comments on commit f21dec5

Please sign in to comment.