Skip to content

Commit 146fa01

Browse files
author
Jacob Hageman
committed
WIP #777, last round
1 parent fbc3925 commit 146fa01

23 files changed

+154
-1257
lines changed

docs/cFE Application Developers Guide.md

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,18 +1319,18 @@ SB Messages by allocating sufficient memory, calling the SB API to
13191319
initialize the contents of the SB Message and then storing any
13201320
appropriate data into the structure.
13211321

1322-
The Software Bus API hides the details of the message structure,
1323-
providing routines such as CFE_SB_GetMsgTime and CFE_SB_SetMsgTime
1322+
The Message API hides the details of the message structure,
1323+
providing routines such as CFE_MSG_GetMsgTime and CFE_MSG_SetMsgTime
13241324
in order to get and set a message time. The current version of the cFE
13251325
supports only CCSDS, however, the implementation of the message
13261326
structure can be changed without affecting cFS Applications.
13271327

1328-
In the CCSDS implementation of the Software Bus, the upper 3 most
1329-
significant bits of the 16 bit Message ID Number **shall be zero
1330-
(b'000').** The Software Bus ignores the upper 3 most significant bits
1331-
defined by CCSDS as the Version Number. A non-zero value in the Version
1332-
Number (3 bits) could result in duplicate Message IDs being defined. For
1333-
example, x01FF and x81FF are the same Message ID to the Software Bus.
1328+
See the implementation documentation for specific formats,
1329+
fields, and bit values. The message ID (MsgId) is an abstract
1330+
concept that is implementation depended, used for routing messages
1331+
on the Software Bus. Depending on the implementation, different
1332+
ranges and values are supported, and the values effect the message
1333+
header differently.
13341334

13351335
##### 6.1.2 Pipes
13361336

@@ -1705,54 +1705,59 @@ It is important to note that some SB API calls assume the presence of a
17051705
particular header type and will not work properly if the other header type
17061706
is present instead. The following section provides more detail.
17071707

1708-
##### 6.5.2 Modifying Software Bus Message Header Information
1708+
##### 6.5.2 Setting Message Header Information
17091709

1710-
Before sending an SB Message to the SB, the Application can update the
1711-
SB Message Header. The following table summarizes the functions that
1712-
can be used to modify SB Message Header fields. Note that some of these
1710+
Before sending a Message to the SB, the Application can set fields in the
1711+
Message Header. The following table summarizes the functions that
1712+
can be used to modify Message Header fields. Note that some of these
17131713
functions are only applicable to a specific header type. Additional
17141714
information on modifying specific header types is provided in the following
17151715
subsections.
17161716

1717-
| **SB Message Header Field** | **SB API for Modifying the Header Field** | **Applicability** |
1718-
| ---------------------------:| -----------------------------------------:| -------------------:|
1719-
| Message ID | CFE_SB_SetMsgId | Command & Telemetry |
1720-
| Total Message Length | CFE_SB_SetTotalMsgLength | Command & Telemetry |
1721-
| User Data Message Length | CFE_SB_SetUserDataLength | Command & Telemetry |
1722-
| Command Code | CFE_SB_SetCmdCode | Command Only |
1723-
| Checksum | CFE_SB_GenerateChecksum | Command Only |
1724-
| Time | CFE_SB_TimeStampMsg | Telemetry Only |
1725-
| Time | CFE_SB_SetMsgTime | Telemetry Only |
1726-
1727-
Applications shall always use these functions to manipulate the SB
1728-
Message Header. The structure of the SB Message Header may change from
1717+
| **SB Message Header Field** | **API for Modifying the Header Field** | **Applicability** |
1718+
| ---------------------------:| --------------------------------------:| -------------------:|
1719+
| Message ID | CFE_MSG_SetMsgId | Command & Telemetry |
1720+
| Total Message Length | CFE_MSG_SetSize | Command & Telemetry |
1721+
| Command Code | CFE_MSG_SetFcnCode | Command Only |
1722+
| Checksum | CFE_MSG_GenerateChecksum | Command Only |
1723+
| Time | CFE_SB_TimeStampMsg | Telemetry Only |
1724+
| Time | CFE_MSG_SetMsgTime | Telemetry Only |
1725+
1726+
Applications shall always use these functions to manipulate the
1727+
Message Header. The structure of the Message Header may change from
17291728
one deployment to the next. By using these functions, Applications are
1730-
guaranteed to work regardless of the structure of the SB Message Header.
1729+
guaranteed to work regardless of the structure of the Message Header.
17311730

1732-
##### 6.5.2.1 Modifying SB Command Message Header Information
1731+
Although CFE_SB_SetUserDataLength APIs is available,
1732+
it is based on assumptions about the defintion of "User Data" and is
1733+
really just a best guess since the packet structure is dependent on implementation.
1734+
The preference is to use CFE_MSG_SetSize and actual packet structure
1735+
information when available.
1736+
1737+
##### 6.5.2.1 Modifying Command Message Header Information
17331738
The most common update for command messages is to set the command code.
1734-
This is done through the CFE_SB_SetCmdCode() API call. This code is used
1739+
This is done through the CFE_MSG_SetFcnCode() API call. This code is used
17351740
to distinguish between multiple commands that share a Message ID. It is
17361741
common practice for an application to have a single "CMD_MID" to capture
17371742
all commands and then to differentiate those commands using a command code.
17381743

1739-
##### 6.5.2.2 Modifying SB Telemetry Message Header Information
1744+
##### 6.5.2.2 Modifying Telemetry Message Header Information
17401745
The most common update for telemetry messages is to put the current time in
1741-
the SB Message. This is accomplished with one of two SB API functions. The
1746+
the Message. This is accomplished with one of two API functions. The
17421747
most commonly used function would be CFE_SB_TimeStampMsg(). This API would
17431748
insert the current time, in the mission defined format with the mission
1744-
defined epoch, into the SB Message Header. The other SB API that can modify
1745-
the SB Message Header time is CFE_SB_SetMsgTime(). This API call sets the
1746-
time in the SB Message Header to the time specified during the call. This is
1747-
useful when the Application wishes to time tag a series of SB Messages with
1749+
defined epoch, into the Message Header. The other API that can modify
1750+
the Message Header time is CFE_MSG_SetMsgTime(). This API call sets the
1751+
time in the Message Header to the time specified during the call. This is
1752+
useful when the Application wishes to time tag a series of Messages with
17481753
the same time.
17491754

1750-
##### 6.5.3 Reading Software Bus Message Header Information
1755+
##### 6.5.3 Reading Message Header Information
17511756

1752-
There are several SB APIs available for extracting the SB Message Header
1757+
There are several APIs available for extracting the Message Header
17531758
Fields. These APIs shall always be used by Applications to ensure the
17541759
Applications are portable to future missions. The following table
1755-
identifies the fields of the SB Message Header and the appropriate API
1760+
identifies the fields of the Message Header and the appropriate API
17561761
for extracting that field from the header:
17571762

17581763
| **SB Message Header Field** | **API for Reading the Header Field** | **Applicability** |
@@ -1762,12 +1767,12 @@ for extracting that field from the header:
17621767
| Total Message Length | CFE_MSG_GetSize | Command & Telemetry |
17631768
| Command Code | CFE_MSG_GetFcnCode | Command Only |
17641769

1765-
There are other APIs based on selected implementation, and the full list is
1770+
There are other APIs based on selected implementation. The full list is
17661771
available in the user's guide.
17671772

17681773
There is another API that automatically calculates the checksum for the packet
17691774
and compares it to the checksum in the header. The API is called
1770-
CFE_SB_ValidateChecksum() and it simply returns a success or failure
1775+
CFE_MSG_ValidateChecksum() and it simply returns a success or failure
17711776
indication.
17721777

17731778
Although CFE_SB_GetUserDataLength and CFE_SB_GetUserData APIs are available,

fsw/cfe-core/src/evs/cfe_evs_utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1
428428
LongEventTlm.Payload.PacketID.ProcessorID = CFE_PSP_GetProcessorId();
429429

430430
/* Set the packet timestamp */
431-
CFE_SB_SetMsgTime((CFE_MSG_Message_t *) &LongEventTlm, *TimeStamp);
431+
CFE_MSG_SetMsgTime((CFE_MSG_Message_t *) &LongEventTlm, *TimeStamp);
432432

433433
/* Write event to the event log */
434434
EVS_AddLog(&LongEventTlm);
@@ -451,7 +451,7 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1
451451
*/
452452
CFE_MSG_Init(&ShortEventTlm.TlmHeader.BaseMsg, CFE_SB_ValueToMsgId(CFE_EVS_SHORT_EVENT_MSG_MID),
453453
sizeof(ShortEventTlm));
454-
CFE_SB_SetMsgTime((CFE_MSG_Message_t *) &ShortEventTlm, *TimeStamp);
454+
CFE_MSG_SetMsgTime((CFE_MSG_Message_t *) &ShortEventTlm, *TimeStamp);
455455
ShortEventTlm.Payload.PacketID = LongEventTlm.Payload.PacketID;
456456
CFE_SB_SendMsg((CFE_MSG_Message_t *) &ShortEventTlm);
457457
}

fsw/cfe-core/src/inc/cfe_error.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ typedef int32 CFE_Status_t;
856856
/**
857857
* @brief Wrong Message Type
858858
*
859-
* This error code will be returned when a request such as #CFE_SB_SetMsgTime
859+
* This error code will be returned when a request such as #CFE_MSG_SetMsgTime
860860
* is made on a packet that does not include a field for msg time.
861861
*
862862
*/

0 commit comments

Comments
 (0)