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 #1667, CFE_SB_MsgHdrSize returns size_t #1674

Merged
merged 2 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/core_api/fsw/inc/cfe_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ void *CFE_SB_GetUserData(CFE_MSG_Message_t *MsgPtr);
** This must point to the first byte of the message header.
**
** \return The size (in bytes) of the user data in the software bus message.
** \retval 0 if an error occurs, such as if the MsgPtr argument is not valid.
**/
size_t CFE_SB_GetUserDataLength(const CFE_MSG_Message_t *MsgPtr);

Expand Down
3 changes: 2 additions & 1 deletion modules/sb/fsw/src/cfe_sb_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,8 @@ CFE_SB_DestinationD_t *CFE_SB_GetDestPtr(CFE_SBR_RouteId_t RouteId, CFE_SB_PipeI
** if SB messages are implemented as CCSDS packets, the size of the header
** is different for command vs. telemetry packets.
**
** \returns Estimated number of bytes in the message header for the given message
** \returns Estimated number of bytes in the message header for the given message.
** \retval 0 if an error occurs, such as if the MsgPtr argument is not valid or header type cannot be identified.
**/
size_t CFE_SB_MsgHdrSize(const CFE_MSG_Message_t *MsgPtr);

Expand Down
4 changes: 2 additions & 2 deletions modules/sb/fsw/src/cfe_sb_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ size_t CFE_SB_MsgHdrSize(const CFE_MSG_Message_t *MsgPtr)

if (MsgPtr == NULL)
{
return CFE_SB_BAD_ARGUMENT;
return size;
}

CFE_MSG_GetHasSecondaryHeader(MsgPtr, &hassechdr);
Expand Down Expand Up @@ -117,7 +117,7 @@ size_t CFE_SB_GetUserDataLength(const CFE_MSG_Message_t *MsgPtr)

if (MsgPtr == NULL)
{
return CFE_SB_BAD_ARGUMENT;
return TotalMsgSize;
}

CFE_MSG_GetSize(MsgPtr, &TotalMsgSize);
Expand Down