Skip to content

Commit

Permalink
Merge pull request nasa#38 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
Integration Candidate COMBINED 2020-04-29 and 2020-05-06
  • Loading branch information
astrogeco committed May 13, 2020
2 parents 545710c + 97d660a commit b59f32e
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 52 deletions.
63 changes: 41 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,52 @@

This repository contains NASA's Telemetry Output Lab (to_lab), which is a framework component of the Core Flight System.

This lab application is a non-flight utility to downlink telemetry from the cFS Bundle. It is intended to be located in the `apps/to_lab` subdirectory of a cFS Mission Tree. The Core Flight System is bundled at https://github.com/nasa/cFS (which includes to_lab as a submodule), which includes build and execution instructions.

to_lab is a simple telemetry downlink application that sends CCSDS telecommand packets over a UDP/IP port. The UDP port and IP address are specified in the "Enable Telemetry" command. It does not provide a full CCSDS Telecommand stack implementation.

To send telemtry to the "ground" or UDP/IP port, edit the subscription table in the platform include file: build/<cpuX>/inc/to_lab_sub_table.h. to_lab will subscribe to the packet IDs that are listed in this table and send the telemetry packets it receives to the UDP/IP port.

## Version Notes
- 2.3.2 DEVELOPMENT
- Use OSAL socket API instead of BSD Sockets
- Use global namespace to isolate variables
- Minor updates (see https://github.com/nasa/to_lab/pull/27)
- 2.3.1 DEVELOPMENT
- Fix for a clean build with OMIT_DEPRECATED
- Minor updates (see https://github.com/nasa/to_lab/pull/26)
- **2.3.0 OFFICIAL RELEASE**:
- Minor updates (see https://github.com/nasa/to_lab/pull/13)
- Not backwards compatible with OSAL 4.2.1
- Released as part of cFE 6.7.0, Apache 2.0
- **2.2.0a OFFICIAL RELEASE**:
- Released as part of cFE 6.6.0a, Apache 2.0
This lab application is a non-flight utility to downlink telemetry from the cFS Bundle. It is intended to be located in the `apps/to_lab` subdirectory of a cFS Mission Tree. The Core Flight System is bundled at <https://github.com/nasa/cFS> (which includes to_lab as a submodule), which includes build and execution instructions.

to_lab is a simple telemetry downlink application that sends CCSDS telecommand packets over a UDP/IP port. The UDP port and IP address are specified in the "Enable Telemetry" command. It does not provide a full CCSDS Telecommand stack implementation.

To send telemtry to the "ground" or UDP/IP port, edit the subscription table in the platform include file: fsw/platform_inc/to_lab_sub_table.h. to_lab will subscribe to the packet IDs that are listed in this table and send the telemetry packets it receives to the UDP/IP port.

## Version History

### Development Build: 2.3.3

- Apply the CFE_SB_MsgIdToValue() and CFE_SB_ValueToMsgId() routines where compatibility with an integer MsgId is necessary - syslog prints, events, compile-time MID #define values.
- Deprecates shell tlm subscription
- Changes to documentation
- See <https://github.com/nasa/to_lab/pull/38>

### Development Build: 2.3.2

- Use OSAL socket API instead of BSD Sockets

- Use global namespace to isolate variables

- Minor updates (see <https://github.com/nasa/to_lab/pull/27>)

### Development Build: 2.3.1

- Fix for a clean build with OMIT_DEPRECATED
- Minor updates (see <https://github.com/nasa/to_lab/pull/26>)

### _**OFFICIAL RELEASE: 2.3.0**_

- Minor updates (see <https://github.com/nasa/to_lab/pull/13>)

- Not backwards compatible with OSAL 4.2.1

- Released as part of cFE 6.7.0, Apache 2.0

### _**OFFICIAL RELEASE: 2.2.0a**_

- Released as part of cFE 6.6.0a, Apache 2.0

## Known issues

As a lab application, extensive testing is not performed prior to release and only minimal functionality is included.

## Getting Help

For best results, submit issues:questions or issues:help wanted requests at https://github.com/nasa/cFS.
For best results, submit issues:questions or issues:help wanted requests at <https://github.com/nasa/cFS>.

Official cFS page: http:https://cfs.gsfc.nasa.gov
Official cFS page: <http:https://cfs.gsfc.nasa.gov>
36 changes: 20 additions & 16 deletions fsw/platform_inc/to_lab_sub_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
static TO_subscription_t TO_SubTable[] =
{
/* CFS App Subscriptions */
{TO_LAB_HK_TLM_MID, {0,0}, 4},
{TO_LAB_DATA_TYPES_MID, {0,0}, 4},
{CI_LAB_HK_TLM_MID, {0,0}, 4},
{SAMPLE_APP_HK_TLM_MID, {0,0}, 4},
{CFE_SB_MSGID_WRAP_VALUE(TO_LAB_HK_TLM_MID), {0,0}, 4},
{CFE_SB_MSGID_WRAP_VALUE(TO_LAB_DATA_TYPES_MID), {0,0}, 4},
{CFE_SB_MSGID_WRAP_VALUE(CI_LAB_HK_TLM_MID), {0,0}, 4},
{CFE_SB_MSGID_WRAP_VALUE(SAMPLE_APP_HK_TLM_MID), {0,0}, 4},

#if 0
/* Add these if needed */
Expand All @@ -65,18 +65,22 @@ static TO_subscription_t TO_SubTable[] =
#endif

/* cFE Core subscriptions */
{CFE_ES_HK_TLM_MID, {0,0}, 4},
{CFE_EVS_HK_TLM_MID, {0,0}, 4},
{CFE_SB_HK_TLM_MID, {0,0}, 4},
{CFE_TBL_HK_TLM_MID, {0,0}, 4},
{CFE_TIME_HK_TLM_MID, {0,0}, 4},
{CFE_TIME_DIAG_TLM_MID, {0,0}, 4},
{CFE_SB_STATS_TLM_MID, {0,0}, 4},
{CFE_TBL_REG_TLM_MID, {0,0}, 4},
{CFE_EVS_LONG_EVENT_MSG_MID, {0,0}, 32},
{CFE_ES_SHELL_TLM_MID, {0,0}, 32},
{CFE_ES_APP_TLM_MID, {0,0}, 4},
{CFE_ES_MEMSTATS_TLM_MID, {0,0}, 4},
{CFE_SB_MSGID_WRAP_VALUE(CFE_ES_HK_TLM_MID), {0,0}, 4},
{CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_HK_TLM_MID), {0,0}, 4},
{CFE_SB_MSGID_WRAP_VALUE(CFE_SB_HK_TLM_MID), {0,0}, 4},
{CFE_SB_MSGID_WRAP_VALUE(CFE_TBL_HK_TLM_MID), {0,0}, 4},
{CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_HK_TLM_MID), {0,0}, 4},
{CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_DIAG_TLM_MID), {0,0}, 4},
{CFE_SB_MSGID_WRAP_VALUE(CFE_SB_STATS_TLM_MID), {0,0}, 4},
{CFE_SB_MSGID_WRAP_VALUE(CFE_TBL_REG_TLM_MID), {0,0}, 4},
{CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_LONG_EVENT_MSG_MID), {0,0}, 32},

#ifndef CFE_OMIT_DEPRECATED_6_7
{CFE_SB_MSGID_WRAP_VALUE(CFE_ES_SHELL_TLM_MID), {0,0}, 32},
#endif

{CFE_SB_MSGID_WRAP_VALUE(CFE_ES_APP_TLM_MID), {0,0}, 4},
{CFE_SB_MSGID_WRAP_VALUE(CFE_ES_MEMSTATS_TLM_MID), {0,0}, 4},

{TO_UNUSED, {0,0}, 0},
{TO_UNUSED, {0,0}, 0},
Expand Down
28 changes: 16 additions & 12 deletions fsw/src/to_lab_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void TO_LAB_init(void)
/* Subscriptions for TLM pipe*/
for (i=0; (i < (sizeof(TO_SubTable)/sizeof(TO_subscription_t))); i++)
{
if(TO_SubTable[i].Stream != TO_UNUSED )
if(CFE_SB_IsValidMsgId(TO_SubTable[i].Stream))
status = CFE_SB_SubscribeEx(TO_SubTable[i].Stream,
TO_LAB_Global.Tlm_pipe,
TO_SubTable[i].Flags,
Expand All @@ -223,7 +223,7 @@ void TO_LAB_init(void)
if (status != CFE_SUCCESS)
CFE_EVS_SendEvent(TO_SUBSCRIBE_ERR_EID,CFE_EVS_EventType_ERROR,
"L%d TO Can't subscribe to stream 0x%x status %i", __LINE__,
TO_SubTable[i].Stream,(int)status);
(unsigned int)CFE_SB_MsgIdToValue(TO_SubTable[i].Stream),(int)status);
}

/*
Expand Down Expand Up @@ -286,7 +286,7 @@ void TO_LAB_process_commands(void)

MsgId = CFE_SB_GetMsgId(MsgPtr);
/* For SB return statuses that imply a message: process it. */
switch (MsgId)
switch (CFE_SB_MsgIdToValue(MsgId))
{
case TO_LAB_CMD_MID:
TO_LAB_exec_local_command(MsgPtr);
Expand All @@ -298,7 +298,8 @@ void TO_LAB_process_commands(void)

default:
CFE_EVS_SendEvent(TO_MSGID_ERR_EID,CFE_EVS_EventType_ERROR,
"L%d TO: Invalid Msg ID Rcvd 0x%x",__LINE__,MsgId);
"L%d TO: Invalid Msg ID Rcvd 0x%x",__LINE__,
(unsigned int)CFE_SB_MsgIdToValue(MsgId));
break;
}
break;
Expand Down Expand Up @@ -483,11 +484,12 @@ int32 TO_LAB_AddPacket(const TO_LAB_AddPacket_t *data)
if(status != CFE_SUCCESS)
CFE_EVS_SendEvent(TO_ADDPKT_ERR_EID,CFE_EVS_EventType_ERROR,
"L%d TO Can't subscribe 0x%x status %i",__LINE__,
pCmd->Stream, (int)status);
(unsigned int)CFE_SB_MsgIdToValue(pCmd->Stream),
(int)status);
else
CFE_EVS_SendEvent(TO_ADDPKT_INF_EID,CFE_EVS_EventType_INFORMATION,
"L%d TO AddPkt 0x%x, QoS %d.%d, limit %d",__LINE__,
pCmd->Stream,
(unsigned int)CFE_SB_MsgIdToValue(pCmd->Stream),
pCmd->Flags.Priority,
pCmd->Flags.Reliability,
pCmd->BufLimit);
Expand All @@ -510,10 +512,12 @@ int32 TO_LAB_RemovePacket(const TO_LAB_RemovePacket_t *data)
if(status != CFE_SUCCESS)
CFE_EVS_SendEvent(TO_REMOVEPKT_ERR_EID,CFE_EVS_EventType_ERROR,
"L%d TO Can't Unsubscribe to Stream 0x%x on pipe %d, status %i",__LINE__,
pCmd->Stream, TO_LAB_Global.Tlm_pipe, (int)status);
(unsigned int)CFE_SB_MsgIdToValue(pCmd->Stream),
TO_LAB_Global.Tlm_pipe, (int)status);
else
CFE_EVS_SendEvent(TO_REMOVEPKT_INF_EID,CFE_EVS_EventType_INFORMATION,
"L%d TO RemovePkt 0x%x",__LINE__, pCmd->Stream);
"L%d TO RemovePkt 0x%x",__LINE__,
(unsigned int)CFE_SB_MsgIdToValue(pCmd->Stream));
++TO_LAB_Global.HkBuf.HkTlm.Payload.CommandCounter;
return CFE_SUCCESS;
} /* End of TO_LAB_RemovePacket() */
Expand All @@ -530,14 +534,14 @@ int32 TO_LAB_RemoveAll(const TO_LAB_RemoveAll_t *data)

for (i=0; (i < (sizeof(TO_SubTable)/sizeof(TO_subscription_t))); i++)
{
if (TO_SubTable[i].Stream != TO_UNUSED )
if (CFE_SB_IsValidMsgId(TO_SubTable[i].Stream))
{
status = CFE_SB_Unsubscribe(TO_SubTable[i].Stream, TO_LAB_Global.Tlm_pipe);

if(status != CFE_SUCCESS)
CFE_EVS_SendEvent(TO_REMOVEALLPTKS_ERR_EID,CFE_EVS_EventType_ERROR,
"L%d TO Can't Unsubscribe to stream 0x%x status %i", __LINE__,
TO_SubTable[i].Stream, (int)status);
(unsigned int)CFE_SB_MsgIdToValue(TO_SubTable[i].Stream), (int)status);
}
}

Expand All @@ -546,13 +550,13 @@ int32 TO_LAB_RemoveAll(const TO_LAB_RemoveAll_t *data)
if(status != CFE_SUCCESS)
CFE_EVS_SendEvent(TO_REMOVECMDTO_ERR_EID,CFE_EVS_EventType_ERROR,
"L%d TO Can't Unsubscribe to cmd stream 0x%x status %i", __LINE__,
TO_LAB_CMD_MID, (int)status);
(unsigned int)CFE_SB_MsgIdToValue(TO_LAB_CMD_MID), (int)status);

status = CFE_SB_Unsubscribe(TO_LAB_SEND_HK_MID, TO_LAB_Global.Cmd_pipe);
if (status != CFE_SUCCESS)
CFE_EVS_SendEvent(TO_REMOVEHKTO_ERR_EID,CFE_EVS_EventType_ERROR,
"L%d TO Can't Unsubscribe to cmd stream 0x%x status %i", __LINE__,
TO_LAB_CMD_MID, (int)status);
(unsigned int)CFE_SB_MsgIdToValue(TO_LAB_CMD_MID), (int)status);

CFE_EVS_SendEvent(TO_REMOVEALLPKTS_INF_EID,CFE_EVS_EventType_INFORMATION,
"L%d TO Unsubscribed to all Commands and Telemetry", __LINE__);
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/to_lab_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
/*****************************************************************************/

#define TO_TASK_MSEC 500 /* run at 2 Hz */
#define TO_UNUSED 0
#define TO_UNUSED CFE_SB_MSGID_RESERVED

#define cfgTLM_ADDR "192.168.1.81"
#define cfgTLM_PORT 1235
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/to_lab_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#define TO_LAB_MAJOR_VERSION 2
#define TO_LAB_MINOR_VERSION 3
#define TO_LAB_REVISION 2
#define TO_LAB_REVISION 3
#define TO_LAB_MISSION_REV 0


Expand Down

0 comments on commit b59f32e

Please sign in to comment.