Skip to content

Commit

Permalink
Merge pull request nasa#174 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
to_lab Integration candidate: Caelum-rc4+dev65
  • Loading branch information
dzbaker committed Dec 5, 2023
2 parents 2d7e01c + c2ff4b8 commit ec09026
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Development Build: v2.5.0-rc4:dev71
- Add timeout and packet limit on sending telemetry
- See <https://github.com/nasa/to_lab/pull/173>

## Development Build: v2.5.0-rc4+dev66
- reorganize source files
- Apply consistent Event ID names to common events
Expand Down
13 changes: 13 additions & 0 deletions config/default_to_lab_internal_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,21 @@

/*****************************************************************************/

/**
* @brief Main loop task delay
*/
#define TO_LAB_TASK_MSEC 500 /* run at 2 Hz */

/**
* @brief Telemetry pipe timeout
*/
#define TO_LAB_TLM_PIPE_TIMEOUT CFE_SB_POLL

/**
* @brief Maximum number of telemetry packets to send each wakeup
*/
#define TO_LAB_MAX_TLM_PKTS OS_QUEUE_MAX_DEPTH

/**
* Depth of pipe for commands to the TO_LAB application itself
*/
Expand Down
9 changes: 6 additions & 3 deletions fsw/src/to_lab_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void TO_LAB_AppMain(void)
{
CFE_ES_PerfLogExit(TO_LAB_MAIN_TASK_PERF_ID);

OS_TaskDelay(TO_LAB_TASK_MSEC); /*2 Hz*/
OS_TaskDelay(TO_LAB_TASK_MSEC);

CFE_ES_PerfLogEntry(TO_LAB_MAIN_TASK_PERF_ID);

Expand Down Expand Up @@ -263,6 +263,7 @@ void TO_LAB_forward_telemetry(void)
CFE_SB_Buffer_t *SBBufPtr;
const void * NetBufPtr;
size_t NetBufSize;
uint32 PktCount = 0;

OS_SocketAddrInit(&d_addr, OS_SocketDomain_INET);
OS_SocketAddrSetPort(&d_addr, TO_LAB_TLM_PORT);
Expand All @@ -271,7 +272,7 @@ void TO_LAB_forward_telemetry(void)

do
{
CfeStatus = CFE_SB_ReceiveBuffer(&SBBufPtr, TO_LAB_Global.Tlm_pipe, CFE_SB_POLL);
CfeStatus = CFE_SB_ReceiveBuffer(&SBBufPtr, TO_LAB_Global.Tlm_pipe, TO_LAB_TLM_PIPE_TIMEOUT);

if ((CfeStatus == CFE_SUCCESS) && (TO_LAB_Global.suppress_sendto == false))
{
Expand Down Expand Up @@ -304,7 +305,9 @@ void TO_LAB_forward_telemetry(void)
}
}
/* If CFE_SB_status != CFE_SUCCESS, then no packet was received from CFE_SB_ReceiveBuffer() */
} while (CfeStatus == CFE_SUCCESS);

PktCount++;
} while (CfeStatus == CFE_SUCCESS && PktCount < TO_LAB_MAX_TLM_PKTS);
}

/************************/
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 @@ -24,7 +24,7 @@
#define TO_LAB_VERSION_H

/* Development Build Macro Definitions */
#define TO_LAB_BUILD_NUMBER 66 /*!< Development Build: Number of commits since baseline */
#define TO_LAB_BUILD_NUMBER 71 /*!< Development Build: Number of commits since baseline */
#define TO_LAB_BUILD_BASELINE \
"v2.5.0-rc4" /*!< Development Build: git tag that is the base for the current development */

Expand Down

0 comments on commit ec09026

Please sign in to comment.