GithubHelp home page GithubHelp logo

nasa / bp Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 3.0 131 KB

The Bundle Protocol Core Flight System Application (BP) License: Apache-2.0

License: Apache License 2.0

CMake 2.27% C 97.73%

bp's Introduction

https://nasa.gov/ nasa | Twitter nasa | LinkedIn



Hi 👋, welcome to the NASA org on github.com!

Github.com/nasa has one of the largest collections of NASA open-source code repositories. Members of the NASA org can find instructions for github.com/nasa in http://nasa.github.io/.

🔭 Additional open-source code repositories resides in a variety of locations other than github.com/nasa. To discover code across all of these locations, we suggest you use code.nasa.gov & software.nasa.gov. These are two different sites holding metadata that describe code projects. Any code released through the NASA Software Release Authority process should be cataloged on those sites.

Is a page with short descriptions of all of NASA's open-source code. Code.nasa.gov feeds into code.gov, which covers open-source and government-source code from many different U.S. governmental agencies. To assist in discovery, code projects described on code.nasa.gov have both human and A.I.-generated tags. These can be useful for finding related code projects.

Contains metadata descriptions for all code projects in code.nasa.gov as well as government-source code projects only sharable with other government agencies. It is part of the large https://technology.nasa.gov/ that also includes patents and spinoffs. To help discoverability, software.nasa.gov puts each code project into one fo the following categories: Business Systems and Project Management, System Testing, Operations, Design and Integration Tools, Vehicle Management (Space/Air/Ground), Data Servers Processing and Handling, Propulsion, Structures and Mechanisms, Crew and Life Support, Data and Image Processing, Materials and Processes, Electronics and Electrical Power, Environmental Science (Earth, Air, Space, Exoplanet), Autonomous Systems, and Aeronautics.



NOTE - PROFILE READMES CURRENTLY DON'T WORK FOR ORG PROFILES ONLY USER PROFILES :(

https://github.community/t/readme-for-organization-front-page/2920

bp's People

Contributors

dzbaker avatar jphickey avatar thnkslprpt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bp's Issues

Add Static Analysis workflow

Is your feature request related to a problem? Please describe.
BP app currently does not have any static analysis checks on PRs

Describe the solution you'd like
Add a workflow that executes the cFS static analysis on BP app (reuse cFS workflow)

Requester Info
Joseph Hickey, Vantage Systems, Inc.

Redundant comments (/* end of function */, /* end if */ etc.) and clean up empty lines.

Checklist

  • I reviewed the Contributing Guide.
  • I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug
Copy of nasa/to_lab#68 and nasa/sample_app#111
There are quite a few redundant comments in the code, such as:

  • /* end of function */-type comments
  • #endif /* BP_IO_H */-type comments
  • function header comments which include the function name

Expected behavior
Remove redundant comments to reduce clutter and inconsistency in the code, and improve readability.

Reporter Info
@thnkslprpt

BP test workflow stopped working

Describe the bug
Github workflow does not successfully merge the iodriver patch as expected.

For example, see recent manual run that I attempted: https://github.com/nasa/bp/actions/runs/3969253764

To Reproduce
Just run the workflow

Expected behavior
Should pass

System observed on:
Github hosted runner

Additional context
This appears to be related to the checkout. When checking out in a workflow, it appears the script does a shallow clone, effectively only copying the HEAD version. However, in the BP workflow, it also needs to merge a patch for the iodriver module. This is a PSP module that facilitates passing data between two cFS instances.

In this case, the NASA PSP module received updates to its main branch since the script was originally written. Due to the shallow clone nature, it now sees the two histories as being unrelated, because there is no common ancestor. Although there is a common ancestor -- it just was not cloned into the work area.

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

Update workflows for latest CFE framework

Describe the bug
The BP app build and workflows need some updates to match the way the newest cFE (equuleus) implements tables. For example, the include paths in the workflows are using the old-style target refs, which do not work anymore.

To Reproduce
Execute BP workflows

Expected behavior
Workflows should run successfully

System observed on:
Github hosted workflow environment

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

Numerous cppcheck warnings reported

Describe the bug
Executing "cppcheck" against the current main branch reports many warnings:

severity location error id issue
style fsw/src/bp_app.c:769 funcArgNamesDifferent Function 'BP_ProcessPkt' argument 1 names different: declaration 'MsgBufPtr' definition 'MessagePtr'.
style fsw/src/bp_app.c:105 unreadVariable Variable 'Mask' is assigned a value that is never used.
style fsw/src/bp_flow.c:788 duplicateCondition The if condition is the same as the previous if condition
warning fsw/src/bp_flow.c:1254 nullPointer Possible null pointer dereference: PrevFlowPtr
style fsw/src/bp_flow.c:545 funcArgNamesDifferent Function 'BP_FlowLoad' argument 1 names different: declaration 'FlowTableFileName' definition 'flow_table_filename'.
style fsw/src/bp_flow.c:679 funcArgNamesDifferent Function 'BP_FlowEnable' argument 1 names different: declaration 'Flow' definition 'fh'.
style fsw/src/bp_flow.c:823 funcArgNamesDifferent Function 'BP_FlowDisable' argument 1 names different: declaration 'Flow' definition 'fh'.
style fsw/src/bp_flow.c:898 funcArgNamesDifferent Function 'BP_FlowSetTimeout' argument 1 names different: declaration 'Flow' definition 'fh'.
style fsw/src/bp_flow.c:898 funcArgNamesDifferent Function 'BP_FlowSetTimeout' argument 2 names different: declaration 'Timeout' definition 'timeout'.
style fsw/src/bp_flow.c:928 funcArgNamesDifferent Function 'BP_FlowRevertTimeout' argument 1 names different: declaration 'Flow' definition 'fh'.
style fsw/src/bp_flow.c:944 funcArgNamesDifferent Function 'BP_FlowSetPriority' argument 1 names different: declaration 'Flow' definition 'fh'.
style fsw/src/bp_flow.c:944 funcArgNamesDifferent Function 'BP_FlowSetPriority' argument 2 names different: declaration 'Priority' definition 'priority'.
style fsw/src/bp_flow.c:970 funcArgNamesDifferent Function 'BP_FlowRevertPriority' argument 1 names different: declaration 'Flow' definition 'fh'.
style fsw/src/bp_flow.c:986 funcArgNamesDifferent Function 'BP_FlowIsEnabled' argument 1 names different: declaration 'Flow' definition 'fh'.
style fsw/src/bp_flow.c:1002 funcArgNamesDifferent Function 'BP_FlowGetStats' argument 1 names different: declaration 'Flow' definition 'fh'.
style fsw/src/bp_flow.c:1002 funcArgNamesDifferent Function 'BP_FlowGetStats' argument 2 names different: declaration 'Stat' definition 'stat'.
style fsw/src/bp_flow.c:1051 funcArgNamesDifferent Function 'BP_FlowClearStats' argument 1 names different: declaration 'Flow' definition 'fh'.
style fsw/src/bp_flow.c:1081 funcArgNamesDifferent Function 'BP_FlowGetHandle' argument 1 names different: declaration 'Name' definition 'name'.
style fsw/src/bp_flow.c:1112 funcArgNamesDifferent Function 'BP_FlowGetName' argument 1 names different: declaration 'Flow' definition 'fh'.
style fsw/src/bp_flow.c:1131 funcArgNamesDifferent Function 'BP_FlowFlush' argument 1 names different: declaration 'Flow' definition 'fh'.
style fsw/src/bp_flow.c:1155 funcArgNamesDifferent Function 'BP_FlowPause' argument 1 names different: declaration 'Flow' definition 'fh'.
style fsw/src/bp_flow.c:1182 funcArgNamesDifferent Function 'BP_FlowResume' argument 1 names different: declaration 'Flow' definition 'fh'.
style fsw/src/bp_flow.c:1286 funcArgNamesDifferent Function 'BP_FlowDirectStore' argument 1 names different: declaration 'Flow' definition 'fh'.
style fsw/src/bp_flow.c:1286 funcArgNamesDifferent Function 'BP_FlowDirectStore' argument 2 names different: declaration 'Buffer' definition 'buffer'.
style fsw/src/bp_flow.c:1286 funcArgNamesDifferent Function 'BP_FlowDirectStore' argument 3 names different: declaration 'Len' definition 'len'.
style fsw/src/bp_flow.c:1324 funcArgNamesDifferent Function 'BP_FlowDirectConfig' argument 1 names different: declaration 'Flow' definition 'fh'.
style fsw/src/bp_flow.c:1324 funcArgNamesDifferent Function 'BP_FlowDirectConfig' argument 2 names different: declaration 'Mode' definition 'mode'.
style fsw/src/bp_flow.c:1324 funcArgNamesDifferent Function 'BP_FlowDirectConfig' argument 3 names different: declaration 'Option' definition 'opt'.
style fsw/src/bp_flow.c:1324 funcArgNamesDifferent Function 'BP_FlowDirectConfig' argument 4 names different: declaration 'Value' definition 'val'.
style fsw/src/bp_flow.c:1324 constParameter Parameter 'val' can be declared with const
style fsw/src/bp_flow.c:58 unusedStructMember union member 'BP_SbIOBuffer_t::PacketSpace' is never used.
style fsw/src/bp_flow.c:393 unreadVariable Variable 'Status' is assigned a value that is never used.
style fsw/src/bp_io.c:213 funcArgNamesDifferent Function 'BP_IOOpen' argument 1 names different: declaration 'IOParm' definition 'CfgStr'.
style fsw/src/bp_io.c:213 funcArgNamesDifferent Function 'BP_IOOpen' argument 3 names different: declaration 'ioh' definition 'Descriptor'.
style fsw/src/bp_io.c:294 funcArgNamesDifferent Function 'BP_IOGetStats' argument 2 names different: declaration 'Stats' definition 'stats'.

35 error(s) reported

Expected behavior
Should run cleanly

System observed on:
Ubuntu 22.04 (cppcheck 2.7)

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

Compile warning with optimized build

Describe the bug
When building with full optimizations (-O3), gcc reports the following warning:

/home/joe/code/cfecfs/github/apps/bp/fsw/src/bp_cla_bundle_io.c: In function ‘BP_CLA_InputTask’:
/home/joe/code/cfecfs/github/apps/bp/fsw/src/bp_cla_bundle_io.c:355:12: error: ‘Status’ may be used uninitialized [-Werror=maybe-uninitialized]
  355 |         if (Status != BP_TIMEOUT)
      |            ^
/home/joe/code/cfecfs/github/apps/bp/fsw/src/bp_cla_bundle_io.c:333:41: note: ‘Status’ was declared here
  333 |     int32                               Status;
      |                                         ^~~~~~
/home/joe/code/cfecfs/github/apps/bp/fsw/src/bp_cla_bundle_io.c: In function ‘BP_CLA_ProcessBundleInput’:
/home/joe/code/cfecfs/github/apps/bp/fsw/src/bp_cla_bundle_io.c:355:12: error: ‘Status’ may be used uninitialized [-Werror=maybe-uninitialized]
  355 |         if (Status != BP_TIMEOUT)
      |            ^
cc1: all warnings being treated as errors

To Reproduce
Build with CMAKE_BUILD_TYPE=Release

Expected behavior
Should compile cleanly

System observed on:
Ubuntu 22.04

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

BP needs updates to work with development version of bplib (v7)

The BPv7 (in-development) version of bplib changes some operational paradigms and the CFS BP app will need updates accordingly:

  • bplib_send() and bplib_recv() for application data, which are similar to socket I/O
  • bplib_cla_ingress() and bplib_cla_egress() for bundles
  • Configuration of IPN routing
  • Decoupling of bundle interfaces from app data interfaces

The last point is significant - where BP assumes that a single configured "flow" constitutes 4 sub flows: rx data, tx data, and rx bundles, and tx bundles. With the routing in the development bplib, this is no longer the case. The application data interfaces are separately instantiated from the CLA bundle interfaces, thus BP needs two different configurations for these.

Replace calls to bplib_os_mem functions with updated API

The bplib_os_memused and bplib_os_memhigh functions were no longer accurate for the current version of bplib, as the entire memory pool is allocated upfront. These would therefore always return the total pool size, the portion of the pool that was actually being used.

In nasa/bplib#167, a proper config/query API was added, which allows configuration and status items to be accessed in a generalized fashion. This API should replace the calls to bplib_os_mem functions.

Missing Macro definitions in bp_flowtable.c

Describe the bug
Missing Macro definition for BP_COS_NORMAL and BP_COS_BULK.

To Reproduce
Build cFS with bp/bplib

Expected behavior
Compile error, BP_COS_NORMAL, BP_COS_BULK not defined

System observed on:
OS: Ubuntu 22.04 LTS

Reporter Info
George Lan. MCSG Technologies

BP fails to build due to iodriver symbol naming

Describe the bug
The version of "iodriver" that was merged into the PSP mainline had some symbol naming changes vs. the prototype that BP was using. When compiled against PSP mainline headers, BP fails to compile.

To Reproduce
Compile BP with latest PSP mainline

Expected behavior
Should compile successfully.

System observed on:
Debian

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

Add coverage test framework for BP App

All CFS software needs to have coverage testing, but this is not yet implemented for BP.

Initially, the first enhancement would be to add the coverage framework only, with empty tests, such that the coverage test shows lines and functions NOT being covered (as opposed to showing nothing at all).

After this is in place, test cases can be gradually added to achieve the desired coverage (ideally 100% of lines, functions, and branches)

Inconsistent MsgID formatting in events

Current calls to CFE_EVS_SendEvent in BP APP use inconsistent formatting for MsgID values. They should use unsigned long type and the corresponding %lX printf conversion.

bp_flowtable.c doesn't compile. CF_SPACE_TO_GND_PDU_MID0 need to be defined.

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Code snips
If applicable, add references to the software.

System observed on:

  • Hardware
  • OS: [e.g. Linux 4.4]
  • Versions [e.g. cFE 6.6, OSAL 4.2, PSP 1.3 for mcp750, any related apps]

Additional context
Add any other context about the problem here.

Reporter Info
Full name and company/organization if applicable

Add EDS file for BP App

Is your feature request related to a problem? Please describe.
EDS files can serve as a single source of truth for CMD and TLM definitions. These should be part of every CFS app.

Describe the solution you'd like
Add EDS file for BP

Requester Info
Joseph Hickey, Vantage Systems, Inc.

Typo in default_bp_platform_cfg.h header file

Describe the bug
Typo in default_bp_platform_cfg.h, which breaks the build.

To Reproduce
Build cFS with bp/bplib

Expected behavior
Compile error, "hs_interface_cfg.h" can not be found

System observed on:
Ubuntu 22.04 LTS

MsgIds in tables and files should be via "value" (integer)

Is your feature request related to a problem? Please describe.
Most CFS apps that use tables put the MsgID "value" (plain integer) into their respective tables.

Describe the solution you'd like
For now, make BP consistent by putting the value, rather than the actual MsgId.

Describe alternatives you've considered
Ideally this should be the full MsgId, but that should be updated across CFE.

Additional context
Just looking for consistency at first, not the ideal solution.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

Add workflow for EDS build

Is your feature request related to a problem? Please describe.
An EDS file was recently added for BP. However, the current BP actions/test workflows use the only standard CFS logic and thus does not validate the EDS accuracy or compatibility.

Describe the solution you'd like
Add a workflow that actively uses the EDS XML file and EDS-based message definitions and passing. This will ensure that all these files are correct and working as expected.

Describe alternatives you've considered
N/A

Additional context
Right now the EDS logic is not really covered by any automatic actions or workflows, thus is at a higher risk of breakage in future PRs.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

Define and use Topic IDs instead of fixed Msg IDs

Is your feature request related to a problem? Please describe.
The "topic ID" concept allows MsgID values to be assigned using a logical pattern for multiple CPUs. This is much more flexible for an out-of-the-box config than fixed MsgIDs.

Describe the solution you'd like
Define application msgids based on the topic ID and conversion macro.

Additional context
This won't change the message IDs for the default case, just makes them easier to manage for various use cases.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

Add cFS build and run test workflow

Is your feature request related to a problem? Please describe.
There is currently no automated verification workflow for BP.

Describe the solution you'd like
Add a github workflow that builds and runs BP as part of cFS, similar to what other cFS apps do.

Additional context
May also require CF app for CFDP protocol engine

Requester Info
Joseph Hickey, Vantage Systems, Inc.

Release Build Error

Describe the bug
There is an error in release build.

To Reproduce
make BUILDTYPE=release OMIT_DEPRECATED=true prep
make

Code Snips
/cFS/apps/bp/fsw/src/bp_cla_bundle_io.c:360:34: error: ‘Status’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
CFE_EVS_SendEvent(BP_LIB_PROC_ERR_EID, CFE_EVS_EventType_ERROR,

System observed on:
CentOS 7

Reporter Info
George Lan
MCSG Technologies

Split command handlers from app and implement "dispatcher" pattern

Is your feature request related to a problem? Please describe.
The current CFS code style recommendations call for:

  • a separate .c file for command handlers, named "cmd.c"
  • a separate .c file for dispatching pipe buffers to command handlers, named "dispatch.c"

Describe the solution you'd like
In BP, these are all mixed into "bp_app.c" and should be split up according to the recommended pattern.

Additional context
Gradually all CFS apps should transition to this structure, all new/updated apps should implement it for consistency.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

Update header file naming based on documented convention

Is your feature request related to a problem? Please describe.
Header file names need to be adjusted to match the convention described in nasa/cFE#2306

Describe the solution you'd like
Rename the files

Additional context
Improving consistency between CFS apps for file names and content

Requester Info
Joseph Hickey, Vantage Systems, Inc.

Rename SCH_LAB table

Describe the bug
The table for SCH_LAB has (externally) changed names in the upstream main branch, this updates the BP workflow to match

To Reproduce
Run workflows against main line

Expected behavior
Should pass

Additional context
Simple name change

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

Add "Payload" sub structure for HK

Is your feature request related to a problem? Please describe.
To comply with CFE/CFS typical patterns, the HK TLM structure should put its information in a sub-struct called "Payload" (as opposed to having fields at the top level)

Describe the solution you'd like
Move items into Payload sub-struct

Describe alternatives you've considered
N/A

Additional context
Does not change content - This naming convention / sub-structure is necessary to work with some tools

Requester Info
Joseph Hickey, Vantage Systems, Inc.

Remove storage name macros

Is your feature request related to a problem? Please describe.
The following macro names aren't really useful going forward:

BP_FLASH_STORE
BP_RAM_STORE
BP_FILE_STORE

Describe the solution you'd like
Remove these macros and refs to them (only used in the default flowtable)

Additional context
Storage service is defined in the flowtable as a string, thus doesn't really need to depend on a header file or any other predefined value. This is the advantage of strings (and seems like the intent here) is that matching/checking can be done at runtime, as opposed to compile time.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

Inconsistent Event ID naming

Checklist

  • I reviewed the Contributing Guide.
  • I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug
Copy of nasa/cFE#2175
After finding that there were 9 different Event IDs to indicate the same thing (Invalid Message ID) in nasa/CF#262, I scrubbed the other common commands (e.g. Task Initialisation [INIT], NOOP, Reset Counters etc.) and found the same issue there - almost every component/app had their own variation of the Event ID name for the exact same event.

Expected behavior
Apply consistent Event ID names to the events which are common to all/most components and apps.

Code snips
Invalid Message ID:
CFE_EVS_ERR_MSGID_EID
CFE_SB_BAD_MSGID_EID
CFE_TIME_ID_ERR_EID
CS_MID_ERR_EID
TO_LAB_MSGID_ERR_EID
SAMPLE_APP_INVALID_MSGID_ERR_EID
BP_INVALID_MID_ERR_EID
SCH_MD_ERR_EID
CI_LAB_COMMAND_ERR_EID

Initialization:
CFE_TIME_INIT_EID
CFE_TBL_INIT_INF_EID
CFE_EVS_STARTUP_EID
CF_EID_INF_INIT
BP_INIT_APP_INFO_EID
SCH_INITSTATS_INF_EID
CI_LAB_STARTUP_INF_EID

NOOP:
CFE_TIME_NOOP_EID
CFE_TBL_NOOP_INF_EID
CFE_SB_CMD0_RCVD_EID
CF_EID_INF_CMD_NOOP
FM_NOOP_CMD_EID
CI_LAB_COMMANDNOP_INF_EID

Reset Counters:
CFE_TIME_RESET_EID
CFE_TBL_RESET_INF_EID
CFE_EVS_RSTCNT_EID
CFE_SB_CMD1_RCVD_EID
CF_EID_INF_CMD_RESET
SC_RESET_DEB_EID
HS_RESET_DBG_EID
FM_RESET_CMD_EID
HK_RESET_CNTRS_CMD_EID
MD_RESET_CNTRS_DBG_EID
CI_LAB_COMMANDRST_INF_EID

etc.

Reporter Info
Avi Weiss @thnkslprpt

cFS v6.7 ACS counter

I ran an experiment where I played back an old ACS packet into cFS and nothing happened; the scheduler was configured to send the bp wakeup command at 1 Hz. Under what conditions does the BP app increment the ACS counter? For example, does the ACS have to be associated with a bundle that's actively being transferred?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.