From fa9f55f41a8ae18bdf1771756981b2928fe9fb82 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 3 Apr 2024 12:35:24 -0400 Subject: [PATCH] Fix #2543, consistent TIME values for TBL structures Use the CFE_TIME_SysTime_t type more consistently across TBL where time is being stored. Avoid using seconds/subseconds directly. This also adds an initializer value for CFE_TIME_SysTime_t that has seconds/subseconds as zero. --- .../core_api/fsw/inc/cfe_tbl_api_typedefs.h | 7 ++- .../core_api/fsw/inc/cfe_time_api_typedefs.h | 9 ++++ modules/tbl/config/default_cfe_tbl_msgdefs.h | 4 +- modules/tbl/eds/cfe_tbl.xml | 9 +--- modules/tbl/fsw/src/cfe_tbl_api.c | 20 ++++----- modules/tbl/fsw/src/cfe_tbl_internal.c | 28 +++++------- modules/tbl/fsw/src/cfe_tbl_task.h | 43 +++++++++---------- modules/tbl/fsw/src/cfe_tbl_task_cmds.c | 25 ++++------- modules/tbl/ut-coverage/tbl_UT.c | 5 +-- 9 files changed, 63 insertions(+), 87 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_tbl_api_typedefs.h b/modules/core_api/fsw/inc/cfe_tbl_api_typedefs.h index 4a9caf06c..da162a73c 100644 --- a/modules/core_api/fsw/inc/cfe_tbl_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_tbl_api_typedefs.h @@ -108,10 +108,9 @@ typedef enum CFE_TBL_SrcEnum /** \brief Table Info */ typedef struct CFE_TBL_Info { - size_t Size; /**< \brief Size, in bytes, of Table */ - uint32 NumUsers; /**< \brief Number of Apps with access to the table */ - uint32 FileCreateTimeSecs; /**< \brief File creation time from last file loaded into table */ - uint32 FileCreateTimeSubSecs; /**< \brief File creation time from last file loaded into table */ + size_t Size; /**< \brief Size, in bytes, of Table */ + uint32 NumUsers; /**< \brief Number of Apps with access to the table */ + CFE_TIME_SysTime_t FileTime; /**< \brief File creation time from last file loaded into table */ uint32 Crc; /**< \brief Most recently calculated CRC by TBL services on table contents */ CFE_TIME_SysTime_t TimeOfLastUpdate; /**< \brief Time when Table was last updated */ bool TableLoadedOnce; /**< \brief Flag indicating whether table has been loaded once or not */ diff --git a/modules/core_api/fsw/inc/cfe_time_api_typedefs.h b/modules/core_api/fsw/inc/cfe_time_api_typedefs.h index 548a84db1..b417865c7 100644 --- a/modules/core_api/fsw/inc/cfe_time_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_time_api_typedefs.h @@ -44,6 +44,15 @@ #define CFE_TIME_PRINTED_STRING_SIZE \ 24 /**< \brief Required size of buffer to be passed into #CFE_TIME_Print (includes null terminator) */ +/** + * A general-purpose initializer for CFE_TIME_SysTime_t values. + * + * Represents "time zero" in the CFE_TIME_SysTime_t domain. This + * can be used as a general purpose initializer for instantiations + * of the CFE_TIME_SysTime_t type. + */ +#define CFE_TIME_ZERO_VALUE ((CFE_TIME_SysTime_t) {0, 0}) + /*****************************************************************************/ /* ** Type Definitions diff --git a/modules/tbl/config/default_cfe_tbl_msgdefs.h b/modules/tbl/config/default_cfe_tbl_msgdefs.h index 7bd8fd04b..727124d8f 100644 --- a/modules/tbl/config/default_cfe_tbl_msgdefs.h +++ b/modules/tbl/config/default_cfe_tbl_msgdefs.h @@ -251,9 +251,7 @@ typedef struct CFE_TBL_TblRegPacket_Payload \brief Ptr to Owner App's function that validates tbl contents */ CFE_TIME_SysTime_t TimeOfLastUpdate; /**< \cfetlmmnemonic \TBL_TIMELASTUPD \brief Time when Table was last updated */ - uint32 FileCreateTimeSecs; /**< \cfetlmmnemonic \TBL_FILECSECONDS - \brief File creation time from last file loaded into table */ - uint32 FileCreateTimeSubSecs; /**< \cfetlmmnemonic \TBL_FILECSUBSECONDS + CFE_TIME_SysTime_t FileTime; /**< \cfetlmmnemonic \TBL_FILETIME \brief File creation time from last file loaded into table */ bool TableLoadedOnce; /**< \cfetlmmnemonic \TBL_LOADEDONCE \brief Flag indicating whether table has been loaded once or not */ diff --git a/modules/tbl/eds/cfe_tbl.xml b/modules/tbl/eds/cfe_tbl.xml index 1024f7e0c..815ab8186 100644 --- a/modules/tbl/eds/cfe_tbl.xml +++ b/modules/tbl/eds/cfe_tbl.xml @@ -292,14 +292,9 @@ \cfetlmmnemonic \TBL_TIMELASTUPD - + - \cfetlmmnemonic \TBL_FILECSECONDS - - - - - \cfetlmmnemonic \TBL_FILECSUBSECONDS + \cfetlmmnemonic \TBL_FILETIME diff --git a/modules/tbl/fsw/src/cfe_tbl_api.c b/modules/tbl/fsw/src/cfe_tbl_api.c index 1082f0a92..0d90f3c8c 100644 --- a/modules/tbl/fsw/src/cfe_tbl_api.c +++ b/modules/tbl/fsw/src/cfe_tbl_api.c @@ -425,8 +425,8 @@ CFE_Status_t CFE_TBL_Load(CFE_TBL_Handle_t TblHandle, CFE_TBL_SrcEnum_t SrcType, snprintf(RegRecPtr->Buffers[0].DataSource, sizeof(RegRecPtr->Buffers[0].DataSource), "Addr 0x%08lX", (unsigned long)SrcDataPtr); - RegRecPtr->Buffers[0].FileCreateTimeSecs = 0; - RegRecPtr->Buffers[0].FileCreateTimeSubSecs = 0; + + RegRecPtr->Buffers[0].FileTime = CFE_TIME_ZERO_VALUE; CFE_EVS_SendEventWithAppID(CFE_TBL_LOAD_SUCCESS_INF_EID, CFE_EVS_EventType_DEBUG, CFE_TBL_Global.TableTaskAppId, "Successfully loaded '%s' from '%s'", RegRecPtr->Name, @@ -484,8 +484,8 @@ CFE_Status_t CFE_TBL_Load(CFE_TBL_Handle_t TblHandle, CFE_TBL_SrcEnum_t SrcType, snprintf(WorkingBufferPtr->DataSource, sizeof(WorkingBufferPtr->DataSource), "Addr 0x%08lX", (unsigned long)SrcDataPtr); - WorkingBufferPtr->FileCreateTimeSecs = 0; - WorkingBufferPtr->FileCreateTimeSubSecs = 0; + + WorkingBufferPtr->FileTime = CFE_TIME_ZERO_VALUE; /* Compute the CRC on the specified table buffer */ WorkingBufferPtr->Crc = @@ -1111,10 +1111,9 @@ CFE_Status_t CFE_TBL_GetInfo(CFE_TBL_Info_t *TblInfoPtr, const char *TblName) TblInfoPtr->TableLoadedOnce = RegRecPtr->TableLoadedOnce; /* Return information on last load and update */ - TblInfoPtr->TimeOfLastUpdate = RegRecPtr->TimeOfLastUpdate; - TblInfoPtr->FileCreateTimeSecs = RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].FileCreateTimeSecs; - TblInfoPtr->FileCreateTimeSubSecs = RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].FileCreateTimeSubSecs; - TblInfoPtr->Crc = RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].Crc; + TblInfoPtr->TimeOfLastUpdate = RegRecPtr->TimeOfLastUpdate; + TblInfoPtr->FileTime = RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].FileTime; + TblInfoPtr->Crc = RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].Crc; strncpy(TblInfoPtr->LastFileLoaded, RegRecPtr->LastFileLoaded, sizeof(TblInfoPtr->LastFileLoaded) - 1); TblInfoPtr->LastFileLoaded[sizeof(TblInfoPtr->LastFileLoaded) - 1] = 0; @@ -1148,7 +1147,6 @@ CFE_Status_t CFE_TBL_DumpToBuffer(CFE_TBL_Handle_t TblHandle) int32 Status; CFE_TBL_RegistryRec_t *RegRecPtr = NULL; CFE_TBL_DumpControl_t *DumpCtrlPtr = NULL; - CFE_TIME_SysTime_t DumpTime; CFE_ES_AppId_t ThisAppId; Status = CFE_TBL_TxnStartFromHandle(&Txn, TblHandle, CFE_TBL_TxnContext_ACCESSOR_APP); @@ -1178,9 +1176,7 @@ CFE_Status_t CFE_TBL_DumpToBuffer(CFE_TBL_Handle_t TblHandle) memcpy(DumpCtrlPtr->DumpBufferPtr->BufferPtr, RegRecPtr->Buffers[0].BufferPtr, DumpCtrlPtr->Size); /* Save the current time so that the header in the dump file can have the correct time */ - DumpTime = CFE_TIME_GetTime(); - DumpCtrlPtr->DumpBufferPtr->FileCreateTimeSecs = DumpTime.Seconds; - DumpCtrlPtr->DumpBufferPtr->FileCreateTimeSubSecs = DumpTime.Subseconds; + DumpCtrlPtr->DumpBufferPtr->FileTime = CFE_TIME_GetTime(); /* Disassociate the dump request from the table */ RegRecPtr->DumpControlIndex = CFE_TBL_NO_DUMP_PENDING; diff --git a/modules/tbl/fsw/src/cfe_tbl_internal.c b/modules/tbl/fsw/src/cfe_tbl_internal.c index 269173705..0c6cdc147 100644 --- a/modules/tbl/fsw/src/cfe_tbl_internal.c +++ b/modules/tbl/fsw/src/cfe_tbl_internal.c @@ -562,8 +562,8 @@ int32 CFE_TBL_LoadFromFile(const char *AppName, CFE_TBL_LoadBuff_t *WorkingBuffe WorkingBufferPtr->DataSource[sizeof(WorkingBufferPtr->DataSource) - 1] = '\0'; /* Save file creation time for later storage into Registry */ - WorkingBufferPtr->FileCreateTimeSecs = StdFileHeader.TimeSeconds; - WorkingBufferPtr->FileCreateTimeSubSecs = StdFileHeader.TimeSubSeconds; + WorkingBufferPtr->FileTime.Seconds = StdFileHeader.TimeSeconds; + WorkingBufferPtr->FileTime.Subseconds = StdFileHeader.TimeSubSeconds; /* Compute the CRC on the specified table buffer */ WorkingBufferPtr->Crc = @@ -651,10 +651,7 @@ int32 CFE_TBL_UpdateInternal(CFE_TBL_Handle_t TblHandle, CFE_TBL_RegistryRec_t * RegRecPtr->LastFileLoaded[sizeof(RegRecPtr->LastFileLoaded) - 1] = 0; /* Save the file creation time from the loaded file into the Table Registry */ - RegRecPtr->Buffers[0].FileCreateTimeSecs = - CFE_TBL_Global.LoadBuffs[RegRecPtr->LoadInProgress].FileCreateTimeSecs; - RegRecPtr->Buffers[0].FileCreateTimeSubSecs = - CFE_TBL_Global.LoadBuffs[RegRecPtr->LoadInProgress].FileCreateTimeSubSecs; + RegRecPtr->Buffers[0].FileTime = CFE_TBL_Global.LoadBuffs[RegRecPtr->LoadInProgress].FileTime; /* Save the previously computed CRC into the new buffer */ RegRecPtr->Buffers[0].Crc = CFE_TBL_Global.LoadBuffs[RegRecPtr->LoadInProgress].Crc; @@ -992,9 +989,7 @@ void CFE_TBL_UpdateCriticalTblCDS(CFE_TBL_RegistryRec_t *RegRecPtr) if (CritRegRecPtr != NULL) { /* Save information related to the source of the data stored in the table in Critical Table Registry */ - CritRegRecPtr->FileCreateTimeSecs = RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].FileCreateTimeSecs; - CritRegRecPtr->FileCreateTimeSubSecs = - RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].FileCreateTimeSubSecs; + CritRegRecPtr->FileTime = RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].FileTime; strncpy(CritRegRecPtr->LastFileLoaded, RegRecPtr->LastFileLoaded, sizeof(CritRegRecPtr->LastFileLoaded) - 1); CritRegRecPtr->LastFileLoaded[sizeof(CritRegRecPtr->LastFileLoaded) - 1] = '\0'; @@ -1290,16 +1285,14 @@ CFE_Status_t CFE_TBL_RestoreTableDataFromCDS(CFE_TBL_RegistryRec_t *RegRecPtr, c sizeof(WorkingBufferPtr->DataSource) - 1); WorkingBufferPtr->DataSource[sizeof(WorkingBufferPtr->DataSource) - 1] = '\0'; - WorkingBufferPtr->FileCreateTimeSecs = CritRegRecPtr->FileCreateTimeSecs; - WorkingBufferPtr->FileCreateTimeSubSecs = CritRegRecPtr->FileCreateTimeSubSecs; + WorkingBufferPtr->FileTime = CritRegRecPtr->FileTime; strncpy(RegRecPtr->LastFileLoaded, CritRegRecPtr->LastFileLoaded, sizeof(RegRecPtr->LastFileLoaded) - 1); RegRecPtr->LastFileLoaded[sizeof(RegRecPtr->LastFileLoaded) - 1] = '\0'; - RegRecPtr->TimeOfLastUpdate.Seconds = CritRegRecPtr->TimeOfLastUpdate.Seconds; - RegRecPtr->TimeOfLastUpdate.Subseconds = CritRegRecPtr->TimeOfLastUpdate.Subseconds; - RegRecPtr->TableLoadedOnce = CritRegRecPtr->TableLoadedOnce; + RegRecPtr->TimeOfLastUpdate = CritRegRecPtr->TimeOfLastUpdate; + RegRecPtr->TableLoadedOnce = CritRegRecPtr->TableLoadedOnce; /* Compute the CRC on the specified table buffer */ WorkingBufferPtr->Crc = @@ -1344,13 +1337,12 @@ void CFE_TBL_RegisterWithCriticalTableRegistry(CFE_TBL_CritRegRec_t *CritRegRecP CritRegRecPtr->CDSHandle = RegRecPtr->CDSHandle; strncpy(CritRegRecPtr->Name, TblName, sizeof(CritRegRecPtr->Name) - 1); CritRegRecPtr->Name[sizeof(CritRegRecPtr->Name) - 1] = '\0'; - CritRegRecPtr->FileCreateTimeSecs = 0; - CritRegRecPtr->FileCreateTimeSubSecs = 0; CritRegRecPtr->LastFileLoaded[0] = '\0'; - CritRegRecPtr->TimeOfLastUpdate.Seconds = 0; - CritRegRecPtr->TimeOfLastUpdate.Subseconds = 0; CritRegRecPtr->TableLoadedOnce = false; + CritRegRecPtr->FileTime = CFE_TIME_ZERO_VALUE; + CritRegRecPtr->TimeOfLastUpdate = CFE_TIME_ZERO_VALUE; + CFE_ES_CopyToCDS(CFE_TBL_Global.CritRegHandle, CFE_TBL_Global.CritReg); } else diff --git a/modules/tbl/fsw/src/cfe_tbl_task.h b/modules/tbl/fsw/src/cfe_tbl_task.h index 710b7efcb..a97269776 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task.h +++ b/modules/tbl/fsw/src/cfe_tbl_task.h @@ -132,13 +132,12 @@ typedef struct */ typedef struct { - void * BufferPtr; /**< \brief Pointer to Load Buffer */ - uint32 FileCreateTimeSecs; /**< \brief File creation time from last file loaded into table */ - uint32 FileCreateTimeSubSecs; /**< \brief File creation time from last file loaded into table */ - uint32 Crc; /**< \brief Last calculated CRC for this buffer's contents */ - bool Taken; /**< \brief Flag indicating whether buffer is in use */ - bool Validated; /**< \brief Flag indicating whether the buffer has been successfully validated */ - char DataSource[OS_MAX_PATH_LEN]; /**< \brief Source of data put into buffer (filename or memory address) */ + void * BufferPtr; /**< \brief Pointer to Load Buffer */ + CFE_TIME_SysTime_t FileTime; /**< \brief Time stamp from last file loaded into table */ + uint32 Crc; /**< \brief Last calculated CRC for this buffer's contents */ + bool Taken; /**< \brief Flag indicating whether buffer is in use */ + bool Validated; /**< \brief Flag indicating whether the buffer has been successfully validated */ + char DataSource[OS_MAX_PATH_LEN]; /**< \brief Source of data put into buffer (filename or memory address) */ } CFE_TBL_LoadBuff_t; /** @@ -209,10 +208,9 @@ typedef struct */ typedef struct { - CFE_ES_CDSHandle_t CDSHandle; /**< \brief Handle to Critical Data Store for Critical Tables */ - uint32 FileCreateTimeSecs; /**< \brief File creation time from last file loaded into table */ - uint32 FileCreateTimeSubSecs; /**< \brief File creation time from last file loaded into table */ - CFE_TIME_SysTime_t TimeOfLastUpdate; /**< \brief Time when Table was last updated */ + CFE_ES_CDSHandle_t CDSHandle; /**< \brief Handle to Critical Data Store for Critical Tables */ + CFE_TIME_SysTime_t FileTime; /**< \brief File creation time from last file loaded into table */ + CFE_TIME_SysTime_t TimeOfLastUpdate; /**< \brief Time when Table was last updated */ char LastFileLoaded[OS_MAX_PATH_LEN]; /**< \brief Filename of last file loaded into table */ char Name[CFE_TBL_MAX_FULL_NAME_LEN]; /**< \brief Processor specific table name */ bool TableLoadedOnce; /**< \brief Flag indicating whether table has been loaded once or not */ @@ -240,18 +238,17 @@ typedef struct */ typedef struct { - CFE_ES_MemOffset_t Size; /**< \brief Size, in bytes, of Table */ - CFE_TIME_SysTime_t TimeOfLastUpdate; /**< \brief Time when Table was last updated */ - uint32 NumUsers; /**< \brief Number of applications that are sharing the table */ - int32 LoadInProgress; /**< \brief Flag identifies inactive buffer and whether load in progress */ - uint32 FileCreateTimeSecs; /**< \brief File creation time from last file loaded into table */ - uint32 FileCreateTimeSubSecs; /**< \brief File creation time from last file loaded into table */ - uint32 Crc; /**< \brief Most recent CRC computed by TBL Services on table contents */ - bool ValidationFunc; /**< \brief Flag indicating whether table has an associated Validation func*/ - bool TableLoadedOnce; /**< \brief Flag indicating whether table has been loaded once or not */ - bool LoadPending; /**< \brief Flag indicating an inactive buffer is ready to be copied */ - bool DumpOnly; /**< \brief Flag indicating Table is NOT to be loaded */ - bool DoubleBuffered; /**< \brief Flag indicating Table has a dedicated inactive buffer */ + CFE_ES_MemOffset_t Size; /**< \brief Size, in bytes, of Table */ + CFE_TIME_SysTime_t TimeOfLastUpdate; /**< \brief Time when Table was last updated */ + uint32 NumUsers; /**< \brief Number of applications that are sharing the table */ + int32 LoadInProgress; /**< \brief Flag identifies inactive buffer and whether load in progress */ + CFE_TIME_SysTime_t FileTime; /**< \brief File creation time from last file loaded into table */ + uint32 Crc; /**< \brief Most recent CRC computed by TBL Services on table contents */ + bool ValidationFunc; /**< \brief Flag indicating whether table has an associated Validation func*/ + bool TableLoadedOnce; /**< \brief Flag indicating whether table has been loaded once or not */ + bool LoadPending; /**< \brief Flag indicating an inactive buffer is ready to be copied */ + bool DumpOnly; /**< \brief Flag indicating Table is NOT to be loaded */ + bool DoubleBuffered; /**< \brief Flag indicating Table has a dedicated inactive buffer */ char Name[CFE_TBL_MAX_FULL_NAME_LEN]; /**< \brief Processor specific table name */ char LastFileLoaded[OS_MAX_PATH_LEN]; /**< \brief Filename of last file loaded into table */ char OwnerAppName[OS_MAX_API_NAME]; /**< \brief Application Name of App that Registered Table */ diff --git a/modules/tbl/fsw/src/cfe_tbl_task_cmds.c b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c index 832f05045..e2cd7019a 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task_cmds.c +++ b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c @@ -96,8 +96,7 @@ int32 CFE_TBL_SendHkCmd(const CFE_TBL_SendHkCmd_t *data) /* is the time of the actual capturing of the data, NOT the time when it was written to the file */ if (Status == CFE_TBL_INC_CMD_CTR) { - DumpTime.Seconds = DumpCtrlPtr->DumpBufferPtr->FileCreateTimeSecs; - DumpTime.Subseconds = DumpCtrlPtr->DumpBufferPtr->FileCreateTimeSubSecs; + DumpTime = DumpCtrlPtr->DumpBufferPtr->FileTime; OsStatus = OS_OpenCreate(&FileDescriptor, DumpCtrlPtr->DumpBufferPtr->DataSource, OS_FILE_FLAG_NONE, OS_READ_WRITE); @@ -287,12 +286,9 @@ void CFE_TBL_GetTblRegData(void) CFE_TBL_Global.TblRegPacket.Payload.LoadPending = RegRecPtr->LoadPending; CFE_TBL_Global.TblRegPacket.Payload.DumpOnly = RegRecPtr->DumpOnly; CFE_TBL_Global.TblRegPacket.Payload.DoubleBuffered = RegRecPtr->DoubleBuffered; - CFE_TBL_Global.TblRegPacket.Payload.FileCreateTimeSecs = - RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].FileCreateTimeSecs; - CFE_TBL_Global.TblRegPacket.Payload.FileCreateTimeSubSecs = - RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].FileCreateTimeSubSecs; - CFE_TBL_Global.TblRegPacket.Payload.Crc = RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].Crc; - CFE_TBL_Global.TblRegPacket.Payload.Critical = RegRecPtr->CriticalTable; + CFE_TBL_Global.TblRegPacket.Payload.FileTime = RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].FileTime; + CFE_TBL_Global.TblRegPacket.Payload.Crc = RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].Crc; + CFE_TBL_Global.TblRegPacket.Payload.Critical = RegRecPtr->CriticalTable; CFE_SB_MessageStringSet(CFE_TBL_Global.TblRegPacket.Payload.Name, RegRecPtr->Name, sizeof(CFE_TBL_Global.TblRegPacket.Payload.Name), sizeof(RegRecPtr->Name)); @@ -444,8 +440,8 @@ int32 CFE_TBL_LoadCmd(const CFE_TBL_LoadCmd_t *data) memcpy(WorkingBufferPtr->DataSource, LoadFilename, OS_MAX_PATH_LEN); /* Save file creation time for later storage into Registry */ - WorkingBufferPtr->FileCreateTimeSecs = StdFileHeader.TimeSeconds; - WorkingBufferPtr->FileCreateTimeSubSecs = StdFileHeader.TimeSubSeconds; + WorkingBufferPtr->FileTime.Seconds = StdFileHeader.TimeSeconds; + WorkingBufferPtr->FileTime.Subseconds = StdFileHeader.TimeSubSeconds; /* Compute the CRC on the specified table buffer */ WorkingBufferPtr->Crc = CFE_ES_CalculateCRC( @@ -1053,12 +1049,9 @@ bool CFE_TBL_DumpRegistryGetter(void *Meta, uint32 RecordNum, void **Buffer, siz StatePtr->DumpRecord.LoadPending = RegRecPtr->LoadPending; StatePtr->DumpRecord.DumpOnly = RegRecPtr->DumpOnly; StatePtr->DumpRecord.DoubleBuffered = RegRecPtr->DoubleBuffered; - StatePtr->DumpRecord.FileCreateTimeSecs = - RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].FileCreateTimeSecs; - StatePtr->DumpRecord.FileCreateTimeSubSecs = - RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].FileCreateTimeSubSecs; - StatePtr->DumpRecord.Crc = RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].Crc; - StatePtr->DumpRecord.CriticalTable = RegRecPtr->CriticalTable; + StatePtr->DumpRecord.FileTime = RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].FileTime; + StatePtr->DumpRecord.Crc = RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].Crc; + StatePtr->DumpRecord.CriticalTable = RegRecPtr->CriticalTable; /* Convert LoadInProgress flag into more meaningful information */ /* When a load is in progress, identify which buffer is being used as the inactive buffer */ diff --git a/modules/tbl/ut-coverage/tbl_UT.c b/modules/tbl/ut-coverage/tbl_UT.c index 02f00f93f..2d8ce6802 100644 --- a/modules/tbl/ut-coverage/tbl_UT.c +++ b/modules/tbl/ut-coverage/tbl_UT.c @@ -1327,8 +1327,6 @@ void Test_CFE_TBL_SendHkCmd(void) CFE_TBL_RegistryRec_t RegRecPtr; uint8 Buff; void * BuffPtr = &Buff; - uint32 Secs = 0; - uint32 SubSecs = 0; int32 LoadInProg = 0; UtPrintf("Begin Test Housekeeping Command"); @@ -1347,8 +1345,7 @@ void Test_CFE_TBL_SendHkCmd(void) DumpBuffPtr->Taken = true; DumpBuffPtr->Validated = true; DumpBuffPtr->BufferPtr = BuffPtr; - DumpBuffPtr->FileCreateTimeSecs = Secs; - DumpBuffPtr->FileCreateTimeSubSecs = SubSecs; + DumpBuffPtr->FileTime = CFE_TIME_ZERO_VALUE; strncpy(DumpBuffPtr->DataSource, "hkSource", sizeof(DumpBuffPtr->DataSource) - 1); DumpBuffPtr->DataSource[sizeof(DumpBuffPtr->DataSource) - 1] = '\0'; CFE_TBL_Global.DumpControlBlocks[0].DumpBufferPtr = DumpBuffPtr;