Skip to content

Commit

Permalink
Merge pull request #178 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
ci_lab Integration candidate: Equuleus-rc1+dev7
  • Loading branch information
dzbaker authored Mar 12, 2024
2 parents deb5759 + 48ec3d1 commit 8c43b9e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 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: equuleus-rc1+dev61
- apply name changes to EDS dispatcher
- See <https://github.com/nasa/ci_lab/pull/177>

## Development Build: equuleus-rc1+dev57
- more complete definition of READ_UPLINK
- See <https://github.com/nasa/ci_lab/pull/174>
Expand Down
33 changes: 17 additions & 16 deletions fsw/src/ci_lab_eds_decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "cfe_mission_eds_parameters.h"
#include "cfe_mission_eds_interface_parameters.h"

#include "cfe_hdr_eds_datatypes.h"

/*
* ---------------------------------------
Expand All @@ -48,10 +49,10 @@
*/
CFE_Status_t CI_LAB_GetInputBuffer(void **BufferOut, size_t *SizeOut)
{
static CFE_HDR_CommandHeader_PackedBuffer_t InputBuffer;
static EdsPackedBuffer_CFE_HDR_CommandHeader_t InputBuffer;

*BufferOut = &InputBuffer;
*SizeOut = sizeof(InputBuffer);
*SizeOut = sizeof(InputBuffer);

return CFE_SUCCESS;
}
Expand Down Expand Up @@ -81,8 +82,8 @@ CFE_Status_t CI_LAB_DecodeInputMessage(void *SourceBuffer, size_t SourceSize, CF

do
{
EdsId = EDSLIB_MAKE_ID(EDS_INDEX(CFE_HDR), CFE_HDR_CommandHeader_DATADICTIONARY);
EdsStatus = EdsLib_DataTypeDB_GetTypeInfo(EDS_DB, EdsId, &CmdHdrInfo);
EdsId = EDSLIB_MAKE_ID(EDS_INDEX(CFE_HDR), CFE_HDR_CommandHeader_DATADICTIONARY);
EdsStatus = EdsLib_DataTypeDB_GetTypeInfo(EDS_DB, EdsId, &CmdHdrInfo);
if (EdsStatus != EDSLIB_SUCCESS)
{
OS_printf("EdsLib_DataTypeDB_GetTypeInfo(): %d\n", (int)EdsStatus);
Expand All @@ -93,28 +94,28 @@ CFE_Status_t CI_LAB_DecodeInputMessage(void *SourceBuffer, size_t SourceSize, CF
BitSize = 8 * SourceSize;
if (BitSize < CmdHdrInfo.Size.Bits)
{
OS_printf("CI_LAB: Size mismatch, BitSize=%lu (packet) / %lu (min)\n",
(unsigned long)BitSize, (unsigned long)CmdHdrInfo.Size.Bits);
OS_printf("CI_LAB: Size mismatch, BitSize=%lu (packet) / %lu (min)\n", (unsigned long)BitSize,
(unsigned long)CmdHdrInfo.Size.Bits);

ResultStatus = CFE_STATUS_WRONG_MSG_LENGTH;
break;
}

/* Now get a SB Buffer, as a place to put the decoded data */
IngestBufPtr = CFE_SB_AllocateMessageBuffer(sizeof(CFE_HDR_CommandHeader_Buffer_t));
IngestBufPtr = CFE_SB_AllocateMessageBuffer(sizeof(EdsNativeBuffer_CFE_HDR_CommandHeader_t));
if (IngestBufPtr == NULL)
{
CFE_EVS_SendEvent(CI_LAB_INGEST_ALLOC_ERR_EID, CFE_EVS_EventType_ERROR,
"CI_LAB: buffer allocation failed\n");
"CI_LAB: buffer allocation failed\n");

ResultStatus = CFE_SB_BUF_ALOC_ERR;
break;
}

/* Packet is in external wire-format byte order - unpack it and copy */
EdsId = EDSLIB_MAKE_ID(EDS_INDEX(CFE_HDR), CFE_HDR_CommandHeader_DATADICTIONARY);
EdsId = EDSLIB_MAKE_ID(EDS_INDEX(CFE_HDR), CFE_HDR_CommandHeader_DATADICTIONARY);
EdsStatus = EdsLib_DataTypeDB_UnpackPartialObject(EDS_DB, &EdsId, IngestBufPtr, SourceBuffer,
sizeof(CFE_HDR_CommandHeader_t), BitSize, 0);
sizeof(EdsDataType_CFE_HDR_CommandHeader_t), BitSize, 0);
if (EdsStatus != EDSLIB_SUCCESS)
{
OS_printf("EdsLib_DataTypeDB_UnpackPartialObject(1): %d\n", (int)EdsStatus);
Expand All @@ -125,16 +126,17 @@ CFE_Status_t CI_LAB_DecodeInputMessage(void *SourceBuffer, size_t SourceSize, CF
CFE_MissionLib_Get_PubSub_Parameters(&PubSubParams, &IngestBufPtr->Msg.BaseMsg);
CFE_MissionLib_UnmapListenerComponent(&ListenerParams, &PubSubParams);

EdsStatus = CFE_MissionLib_GetArgumentType(&CFE_SOFTWAREBUS_INTERFACE, CFE_SB_Telecommand_Interface_ID,
ListenerParams.Telecommand.TopicId, 1, 1, &EdsId);
EdsStatus = CFE_MissionLib_GetArgumentType(&CFE_SOFTWAREBUS_INTERFACE, EDS_INTERFACE_ID(CFE_SB_Telecommand),
ListenerParams.Telecommand.TopicId, 1, 1, &EdsId);
if (EdsStatus != CFE_MISSIONLIB_SUCCESS)
{
OS_printf("CFE_MissionLib_GetArgumentType(): %d\n", (int)EdsStatus);
break;
}

EdsStatus = EdsLib_DataTypeDB_UnpackPartialObject(EDS_DB, &EdsId, IngestBufPtr, SourceBuffer,
sizeof(CFE_HDR_CommandHeader_Buffer_t), BitSize, sizeof(CFE_HDR_CommandHeader_t));
sizeof(EdsNativeBuffer_CFE_HDR_CommandHeader_t), BitSize,
sizeof(EdsDataType_CFE_HDR_CommandHeader_t));
if (EdsStatus != EDSLIB_SUCCESS)
{
OS_printf("EdsLib_DataTypeDB_UnpackPartialObject(2): %d\n", (int)EdsStatus);
Expand All @@ -143,7 +145,7 @@ CFE_Status_t CI_LAB_DecodeInputMessage(void *SourceBuffer, size_t SourceSize, CF

/* Verify that the checksum and basic fields are correct, and recompute the length entry */
EdsStatus = EdsLib_DataTypeDB_VerifyUnpackedObject(EDS_DB, EdsId, IngestBufPtr, SourceBuffer,
EDSLIB_DATATYPEDB_RECOMPUTE_LENGTH);
EDSLIB_DATATYPEDB_RECOMPUTE_LENGTH);
if (EdsStatus != EDSLIB_SUCCESS)
{
OS_printf("EdsLib_DataTypeDB_VerifyUnpackedObject(): %d\n", (int)EdsStatus);
Expand All @@ -152,8 +154,7 @@ CFE_Status_t CI_LAB_DecodeInputMessage(void *SourceBuffer, size_t SourceSize, CF

/* Finally - at this point, we should have a fully decoded buffer */
ResultStatus = CFE_SUCCESS;
}
while(false);
} while (false);

if (ResultStatus != CFE_SUCCESS && IngestBufPtr != NULL)
{
Expand Down
5 changes: 2 additions & 3 deletions fsw/src/ci_lab_eds_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* Define a lookup table for CI lab command codes
*/
/* clang-format off */
static const CI_LAB_Application_Component_Telecommand_DispatchTable_t CI_LAB_TC_DISPATCH_TABLE =
static const EdsDispatchTable_CI_LAB_Application_CFE_SB_Telecommand_t CI_LAB_TC_DISPATCH_TABLE =
{
.CMD =
{
Expand Down Expand Up @@ -78,8 +78,7 @@ void CI_LAB_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr)

CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MsgId);

Status = CI_LAB_Application_Component_Telecommand_Dispatch(CFE_SB_Telecommand_indication_Command_ID, SBBufPtr,
&CI_LAB_TC_DISPATCH_TABLE);
Status = EdsDispatch_CI_LAB_Application_Telecommand(SBBufPtr, &CI_LAB_TC_DISPATCH_TABLE);

if (Status != CFE_SUCCESS)
{
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/ci_lab_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

/* Development Build Macro Definitions */

#define CI_LAB_BUILD_NUMBER 57 /*!< Development Build: Number of commits since baseline */
#define CI_LAB_BUILD_NUMBER 61 /*!< 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 */
Expand Down

0 comments on commit 8c43b9e

Please sign in to comment.