Skip to content

Commit

Permalink
Fix #370, rename MAX CDS name macro to FULL_NAME_LEN
Browse files Browse the repository at this point in the history
Simple replacement of CFE_MISSION_ES_CDS_MAX_NAME_LEN with
CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN, to differentiate it
from CFE_MISSION_ES_CDS_MAX_NAME_LENGTH - which is the CDS
name without the app name.
  • Loading branch information
jphickey committed Oct 27, 2020
1 parent d21d94a commit f9f18a7
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmake/sample_defs/sample_mission_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@
** This value should be kept as a multiple of 4, to maintain alignment of
** any possible neighboring fields without implicit padding.
*/
#define CFE_MISSION_ES_CDS_MAX_NAME_LEN (CFE_MISSION_ES_CDS_MAX_NAME_LENGTH + CFE_MISSION_MAX_API_LEN + 4)
#define CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN (CFE_MISSION_ES_CDS_MAX_NAME_LENGTH + CFE_MISSION_MAX_API_LEN + 4)



Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/es/cfe_es_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,7 @@ int32 CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *CDSHandlePtr, CFE_ES_CDS_Offset_t B
CFE_ES_ResourceID_t ThisAppId;

char AppName[OS_MAX_API_NAME] = {"UNKNOWN"};
char CDSName[CFE_MISSION_ES_CDS_MAX_NAME_LEN] = {""};
char CDSName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN] = {""};

/* Initialize output to safe value, in case this fails */
*CDSHandlePtr = CFE_ES_RESOURCEID_UNDEFINED;
Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/es/cfe_es_cds.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ typedef struct
CFE_ES_ResourceID_t BlockID; /**< Abstract ID associated with this CDS block */
CFE_ES_CDS_Offset_t BlockOffset; /**< Start offset of the block in CDS memory */
CFE_ES_CDS_Offset_t BlockSize; /**< Size, in bytes, of the CDS memory block */
char Name[CFE_MISSION_ES_CDS_MAX_NAME_LEN];
char Name[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN];
bool Table; /**< \brief Flag that indicates whether CDS contains a Critical Table */
} CFE_ES_CDS_RegRec_t;

Expand Down
4 changes: 2 additions & 2 deletions fsw/cfe-core/src/es/cfe_es_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -1680,10 +1680,10 @@ int32 CFE_ES_DeleteCDSCmd(const CFE_ES_DeleteCDS_t *data)
{
int32 Status;
const CFE_ES_DeleteCDSCmd_Payload_t *cmd = &data->Payload;
char LocalCdsName[CFE_MISSION_ES_CDS_MAX_NAME_LEN];
char LocalCdsName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN];

CFE_SB_MessageStringGet(LocalCdsName, (char *)cmd->CdsName, NULL,
CFE_MISSION_ES_CDS_MAX_NAME_LEN, sizeof(cmd->CdsName));
CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN, sizeof(cmd->CdsName));

Status = CFE_ES_DeleteCDS(LocalCdsName, false);

Expand Down
4 changes: 2 additions & 2 deletions fsw/cfe-core/src/es/cfe_es_verify.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@
#if ((CFE_MISSION_ES_CDS_MAX_NAME_LENGTH % 4) != 0)
#error CFE_MISSION_ES_CDS_MAX_NAME_LENGTH must be a multiple of 4
#endif
#if ((CFE_MISSION_ES_CDS_MAX_NAME_LEN % 4) != 0)
#error CFE_MISSION_ES_CDS_MAX_NAME_LEN must be a multiple of 4
#if ((CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN % 4) != 0)
#error CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN must be a multiple of 4
#endif


Expand Down
4 changes: 2 additions & 2 deletions fsw/cfe-core/src/inc/cfe_es_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ typedef struct CFE_ES_SetMaxPRCount
**/
typedef struct CFE_ES_DeleteCDSCmd_Payload
{
char CdsName[CFE_MISSION_ES_CDS_MAX_NAME_LEN]; /**< \brief ASCII text string containing name of CDS to delete */
char CdsName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN]; /**< \brief ASCII text string containing name of CDS to delete */

} CFE_ES_DeleteCDSCmd_Payload_t;

Expand Down Expand Up @@ -1477,7 +1477,7 @@ typedef struct CFE_ES_CDSRegDumpRec
CFE_ES_CDSHandle_t Handle; /**< \brief Handle of CDS */
CFE_ES_CDS_Offset_t Size; /**< \brief Size, in bytes, of the CDS memory block */
bool Table; /**< \brief Flag that indicates whether CDS contains a Critical Table */
char Name[CFE_MISSION_ES_CDS_MAX_NAME_LEN]; /**< \brief Processor Unique Name of CDS */
char Name[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN]; /**< \brief Processor Unique Name of CDS */
uint8 ByteAlignSpare[3]; /**< \brief Spare bytes to ensure structure size is multiple of 4 bytes */
} CFE_ES_CDSRegDumpRec_t;

Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/unit-test/es_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -5394,7 +5394,7 @@ void TestCDS()
{
uint32 CdsSize;
uint8 *CdsPtr;
char CDSName[CFE_MISSION_ES_CDS_MAX_NAME_LEN + 4];
char CDSName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN + 4];
CFE_ES_CDSHandle_t CDSHandle;
CFE_ES_CDS_RegRec_t *UtCDSRegRecPtr;
uint32 i;
Expand Down

0 comments on commit f9f18a7

Please sign in to comment.