Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #245, #1944, Message ID type improvements #1975

Merged
merged 3 commits into from
Dec 6, 2021

Commits on Sep 22, 2021

  1. Fix nasa#1945, add CFE_SB_ValueToMsgId/MsgIdToValue wrappers

    Correct code that was not correctly using the CFE_SB_ValueToMsgId or
    CFE_SB_MsgIdToValue conversion wrappers where required to do so. This
    should be used whenever the value is intentionally converted to/from
    an integer.  The CFE_SB_MsgId_t type should not be assumed to be
    an integer in nature.
    jphickey committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    168181f View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2021

  1. Fix nasa#1944, use 0 as the invalid CFE_SB_MsgId_t value

    Historically the CFE_SB_MSG_ID_INVALID constant was defined as 0xFFFFFFFF/-1,
    where 0 was considered valid.
    
    Although 0 is indeed valid for the first word of a CCSDS primary spacepacket header,
    it is not actually valid for use with SB.  Because SB is now more decoupled from CCSDS
    header definitions, there are a number of advantages to using 0 instead of -1, as
    it is more passively safe:
    
    - Objects which are cleared as part of normal BSS clearing will be set invalid
    - Objects which are memset to zero will be set invalid
    
    In contrast, when the invalid value is nonzero, objects which are memset/cleared
    are valid by default, and must be actively set invalid to be safe.
    jphickey committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    7320f2f View commit details
    Browse the repository at this point in the history
  2. Fix nasa#245, use type safe value for CFE_SB_MsgId_t

    This makes CFE_SB_MsgId_t to be a safe wrapper around CFE_SB_MsgId_Atom_t,
    such that the values cannot be silently/implicitly interchanged with other
    integers.
    
    This enforces that the MsgId/Value conversion helpers must be used when
    conversion to/from integers is intended.
    jphickey committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    6cf6d4c View commit details
    Browse the repository at this point in the history