You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Documentation does not clearly state that CFE_SB_GetMsgTime() and CFE_SB_SetMsgTime() are only useful if the message header is big enough. Basically, the CFE_SB_CMD_HDR_SIZE does not have this field and so it would return 0.
Describe the solution you'd like
Amend the documentation to let others know that those functions are not used when the cmdHeader[CFE_SB_CMD_HDR_SIZE]
Describe alternatives you've considered
Actually it would probably be better if there was some kind of assert or check to inform the programmer that the function probably shouldn't be used since returning 0 is really returning nothing.
Maybe?
Additional context
Documentation in cFS Application Developers Guide.doc pg. 57:
Before sending an SB Message to the SB, the Application can update the SB Message Header. The most common update is to put the current time in the SB Message. This is accomplished with one of two SB API functions. The most commonly used function would be CFE_SB_TimeStampMsg(). This API would insert the current time, in the mission defined format with the mission defined epoch, into the SB Message Header. The other SB API that can modify the SB Message Header time is CFE_SB_SetMsgTime(). This API call sets the time in the SB Message Header to the time specified during the call. This is useful when the Application wishes to time tag a series of SB Messages with the same time.
Other fields of the SB Message Header can be modified by an Application prior to sending the SB Message. These fields, and the associated APIs, are listed in the following table:
I didn't see anywhere that it said if the message is a Command Msg, i.e., CFE_SB_CMD_HDR_SIZE then it will not have a timestamp and therefore these functions return 0.
Is your feature request related to a problem? Please describe.
Documentation does not clearly state that
CFE_SB_GetMsgTime()
andCFE_SB_SetMsgTime()
are only useful if the message header is big enough. Basically, theCFE_SB_CMD_HDR_SIZE
does not have this field and so it would return 0.Describe the solution you'd like
Amend the documentation to let others know that those functions are not used when the
cmdHeader[CFE_SB_CMD_HDR_SIZE]
Describe alternatives you've considered
Actually it would probably be better if there was some kind of assert or check to inform the programmer that the function probably shouldn't be used since returning 0 is really returning nothing.
Maybe?
cFE/fsw/cfe-core/src/es/cfe_es_erlog.c
Line 59 in 405eaac
from
https://github.com/nasa/osal/blob/d0f1a397fa3559d3ac0c923b3c2ac7ed5004bd5a/src/os/inc/common_types.h#L44
Additional context
Documentation in
cFS Application Developers Guide.doc
pg. 57:I didn't see anywhere that it said if the message is a Command Msg, i.e.,
CFE_SB_CMD_HDR_SIZE
then it will not have a timestamp and therefore these functions return 0.Code:
cFE/fsw/cfe-core/src/sb/cfe_sb_util.c
Lines 277 to 305 in f125638
Just went down a rabbit hole trying to figure out why the message header sizes didn't match in my test cases.
Requester Info
Philip Cooksey at NASA Ames
The text was updated successfully, but these errors were encountered: