From d24fba8d082f5c8f4785b7dc9d3a99f8212018ae Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 31 Jan 2024 21:10:02 -0500 Subject: [PATCH 1/2] Fix #173, more complete definition of READ_UPLINK Add this command to EDS and implement the other hooks per the patterns --- config/default_ci_lab_msgstruct.h | 5 +++++ eds/ci_lab.xml | 12 +++++++++++- fsw/src/ci_lab_cmds.c | 8 ++++++++ fsw/src/ci_lab_cmds.h | 15 +++++++++++++++ fsw/src/ci_lab_dispatch.c | 3 +-- fsw/src/ci_lab_eds_dispatch.c | 24 +++++++++++++++++------- 6 files changed, 57 insertions(+), 10 deletions(-) diff --git a/config/default_ci_lab_msgstruct.h b/config/default_ci_lab_msgstruct.h index 9680039..8c874a9 100644 --- a/config/default_ci_lab_msgstruct.h +++ b/config/default_ci_lab_msgstruct.h @@ -63,6 +63,11 @@ typedef struct CFE_MSG_CommandHeader_t CommandHeader; } CI_LAB_SendHkCmd_t; +typedef struct +{ + CFE_MSG_CommandHeader_t CommandHeader; +} CI_LAB_ReadUplinkCmd_t; + typedef struct { CFE_MSG_TelemetryHeader_t TelemetryHeader; diff --git a/eds/ci_lab.xml b/eds/ci_lab.xml index 52c4d80..2fbc822 100644 --- a/eds/ci_lab.xml +++ b/eds/ci_lab.xml @@ -45,6 +45,9 @@ + + + @@ -78,27 +81,34 @@ - + + + + + + + + diff --git a/fsw/src/ci_lab_cmds.c b/fsw/src/ci_lab_cmds.c index 2a02fe8..e19d9fc 100644 --- a/fsw/src/ci_lab_cmds.c +++ b/fsw/src/ci_lab_cmds.c @@ -75,3 +75,11 @@ CFE_Status_t CI_LAB_SendHkCmd(const CI_LAB_SendHkCmd_t *cmd) CFE_SB_TransmitMsg(CFE_MSG_PTR(CI_LAB_Global.HkTlm.TelemetryHeader), true); return CFE_SUCCESS; } + +CFE_Status_t CI_LAB_ReadUplinkCmd(const CI_LAB_ReadUplinkCmd_t *cmd) +{ + /* Any occurrence of this request will cause CI to read ONLY on this request thereafter */ + CI_LAB_Global.Scheduled = true; + CI_LAB_ReadUpLink(); + return CFE_SUCCESS; +} \ No newline at end of file diff --git a/fsw/src/ci_lab_cmds.h b/fsw/src/ci_lab_cmds.h index b399ee4..a26ff76 100644 --- a/fsw/src/ci_lab_cmds.h +++ b/fsw/src/ci_lab_cmds.h @@ -59,4 +59,19 @@ CFE_Status_t CI_LAB_ResetCountersCmd(const CI_LAB_ResetCountersCmd_t *cmd); */ CFE_Status_t CI_LAB_SendHkCmd(const CI_LAB_SendHkCmd_t *cmd); +/** + * @brief Read Uplink command packets + * + * This allows servicing of the CI_LAB uplink to be scheduled in a designated timeslot. + * + * For backward compatibility, CI_LAB will service the uplink periodically by default, + * using a local timeout. However, if this message is sent by the system scheduler, + * CI_LAB will stop servicing based on the timeout and ONLY based on that command. + * + * @param cmd Input message pointer + * @returns CFE Status code + * @retval #CFE_SUCCESS on successful processing + */ +CFE_Status_t CI_LAB_ReadUplinkCmd(const CI_LAB_ReadUplinkCmd_t *cmd); + #endif diff --git a/fsw/src/ci_lab_dispatch.c b/fsw/src/ci_lab_dispatch.c index 174b00c..6cd94a0 100644 --- a/fsw/src/ci_lab_dispatch.c +++ b/fsw/src/ci_lab_dispatch.c @@ -123,8 +123,7 @@ void CI_LAB_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr) break; case CI_LAB_READ_UPLINK_MID: - CI_LAB_Global.Scheduled = true; - CI_LAB_ReadUpLink(); + CI_LAB_ReadUplinkCmd((const CI_LAB_ReadUplinkCmd_t *)SBBufPtr); break; default: diff --git a/fsw/src/ci_lab_eds_dispatch.c b/fsw/src/ci_lab_eds_dispatch.c index fbe7383..18c0d67 100644 --- a/fsw/src/ci_lab_eds_dispatch.c +++ b/fsw/src/ci_lab_eds_dispatch.c @@ -40,14 +40,24 @@ /* * Define a lookup table for CI lab command codes */ -static const CI_LAB_Application_Component_Telecommand_DispatchTable_t CI_LAB_TC_DISPATCH_TABLE = { +/* clang-format off */ +static const CI_LAB_Application_Component_Telecommand_DispatchTable_t CI_LAB_TC_DISPATCH_TABLE = +{ .CMD = - { - .NoopCmd_indication = CI_LAB_NoopCmd, - .ResetCountersCmd_indication = CI_LAB_ResetCountersCmd, - - }, - .SEND_HK = {.indication = CI_LAB_SendHkCmd}}; + { + .NoopCmd_indication = CI_LAB_NoopCmd, + .ResetCountersCmd_indication = CI_LAB_ResetCountersCmd, + }, + .SEND_HK = + { + .indication = CI_LAB_SendHkCmd + }, + .READ_UPLINK = + { + .indication = CI_LAB_ReadUplinkCmd + } +}; +/* clang-format on */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/ /* Name: CI_LAB_TaskPipe */ From 0f80b884e8e054abd499adfcbcf10fdf7cb87dd7 Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 2 Feb 2024 08:26:16 -0500 Subject: [PATCH 2/2] Updating documentation and version numbers for equuleus-rc1+dev57 --- CHANGELOG.md | 4 ++++ fsw/src/ci_lab_version.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09c3dbf..11c6900 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Development Build: equuleus-rc1+dev57 +- more complete definition of READ_UPLINK +- See + ## Development Build: equuleus-rc1+dev51 - Support scheduled uplink check - updating ci_lab to use new versioning system diff --git a/fsw/src/ci_lab_version.h b/fsw/src/ci_lab_version.h index 0836192..9f9c1bf 100644 --- a/fsw/src/ci_lab_version.h +++ b/fsw/src/ci_lab_version.h @@ -25,7 +25,7 @@ /* Development Build Macro Definitions */ -#define CI_LAB_BUILD_NUMBER 51 /*!< Development Build: Number of commits since baseline */ +#define CI_LAB_BUILD_NUMBER 57 /*!< Development Build: Number of commits since baseline */ #define CI_LAB_BUILD_BASELINE "equuleus-rc1" /*!< Development Build: git tag that is the base for the current development */ #define CI_LAB_BUILD_DEV_CYCLE "equuleus-rc2" /**< @brief Development: Release name for current development cycle */ #define CI_LAB_BUILD_CODENAME "Equuleus" /**< @brief: Development: Code name for the current build */