diff --git a/cmake/sample_defs/sample_mission_cfg.h b/cmake/sample_defs/sample_mission_cfg.h index 6043ecb32..e736261ef 100644 --- a/cmake/sample_defs/sample_mission_cfg.h +++ b/cmake/sample_defs/sample_mission_cfg.h @@ -67,26 +67,6 @@ #undef MESSAGE_FORMAT_IS_CCSDS_VER_2 - -/** \name Packet timestamp format identifiers */ -/** \{ */ -#define CFE_MISSION_SB_TIME_32_16_SUBS 1 /**< \brief 32 bits seconds + 16 bits subseconds (units = 2^^-16) */ -#define CFE_MISSION_SB_TIME_32_32_SUBS 2 /**< \brief 32 bits seconds + 32 bits subseconds (units = 2^^-32) */ -#define CFE_MISSION_SB_TIME_32_32_M_20 3 /**< \brief 32 bits seconds + 20 bits microsecs + 12 bits reserved */ -/** \} */ - -/** -** \cfemissioncfg Packet Timestamp Format Selection -** -** \par Description: -** Defines the size, format and contents of the telemetry packet timestamp. -** -** \par Limits -** Must be defined as one of the supported formats listed above -*/ -#define CFE_MISSION_SB_PACKET_TIME_FORMAT CFE_MISSION_SB_TIME_32_16_SUBS - - /** ** \cfesbcfg Maximum SB Message Size ** @@ -699,10 +679,6 @@ #ifndef CFE_OMIT_DEPRECATED_6_6 #define CFE_SPACECRAFT_ID CFE_MISSION_SPACECRAFT_ID -#define CFE_SB_TIME_32_16_SUBS CFE_MISSION_SB_TIME_32_16_SUBS -#define CFE_SB_TIME_32_32_SUBS CFE_MISSION_SB_TIME_32_32_SUBS -#define CFE_SB_TIME_32_32_M_20 CFE_MISSION_SB_TIME_32_32_M_20 -#define CFE_SB_PACKET_TIME_FORMAT CFE_MISSION_SB_PACKET_TIME_FORMAT #define CFE_SB_MAX_SB_MSG_SIZE CFE_MISSION_SB_MAX_SB_MSG_SIZE #define CFE_TIME_CFG_DEFAULT_TAI CFE_MISSION_TIME_CFG_DEFAULT_TAI #define CFE_TIME_CFG_DEFAULT_UTC CFE_MISSION_TIME_CFG_DEFAULT_UTC diff --git a/fsw/cfe-core/src/sb/cfe_sb_verify.h b/fsw/cfe-core/src/sb/cfe_sb_verify.h index 311e8f6ba..3b4c3c23f 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_verify.h +++ b/fsw/cfe-core/src/sb/cfe_sb_verify.h @@ -80,12 +80,9 @@ #error CFE_PLATFORM_SB_BUF_MEMORY_BYTES cannot be greater than UINT32_MAX (4 Gigabytes)! #endif -#ifndef CFE_MISSION_SB_PACKET_TIME_FORMAT - #error CFE_MISSION_SB_PACKET_TIME_FORMAT must be defined! -#elif ((CFE_MISSION_SB_PACKET_TIME_FORMAT != CFE_MISSION_SB_TIME_32_16_SUBS) && \ - (CFE_MISSION_SB_PACKET_TIME_FORMAT != CFE_MISSION_SB_TIME_32_32_SUBS) && \ - (CFE_MISSION_SB_PACKET_TIME_FORMAT != CFE_MISSION_SB_TIME_32_32_M_20)) - #error CFE_MISSION_SB_PACKET_TIME_FORMAT must be CFE_MISSION_SB_TIME_32_16_SUBS or CFE_MISSION_SB_TIME_32_32_SUBS or CFE_MISSION_SB_TIME_32_32_M_20! +#if ((CFE_MISSION_SB_PACKET_TIME_FORMAT == CFE_MISSION_SB_TIME_32_32_SUBS) || \ + (CFE_MISSION_SB_PACKET_TIME_FORMAT == CFE_MISSION_SB_TIME_32_32_M_20)) + #error Legacy CFE_MISSION_SB_PACKET_TIME_FORMAT implementations no longer supported in core #endif #if CFE_MISSION_SB_MAX_SB_MSG_SIZE < 6 diff --git a/modules/msg/CMakeLists.txt b/modules/msg/CMakeLists.txt index 1d6f2e04c..d1abfb5eb 100644 --- a/modules/msg/CMakeLists.txt +++ b/modules/msg/CMakeLists.txt @@ -21,7 +21,7 @@ set(${DEP}_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_msgid_shared.c ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_sechdr_checksum.c ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_sechdr_fc.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_sechdr_time_old.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_sechdr_time.c ) # Source selection for if CCSDS extended header is included, and MsgId version use diff --git a/modules/msg/mission_inc/default_cfe_msg_sechdr.h b/modules/msg/mission_inc/default_cfe_msg_sechdr.h index d4d7a678a..92edcea2c 100644 --- a/modules/msg/mission_inc/default_cfe_msg_sechdr.h +++ b/modules/msg/mission_inc/default_cfe_msg_sechdr.h @@ -38,22 +38,6 @@ * Defines */ -/* These go away w/ single framework implementation */ -/* CCSDS_TIME_SIZE is specific to the selected CFE_SB time format */ -#if (CFE_MISSION_SB_PACKET_TIME_FORMAT == CFE_MISSION_SB_TIME_32_16_SUBS) -/* 32 bits seconds + 16 bits subseconds */ -#define CCSDS_TIME_SIZE 6 -#elif (CFE_MISSION_SB_PACKET_TIME_FORMAT == CFE_MISSION_SB_TIME_32_32_SUBS) -/* 32 bits seconds + 32 bits subseconds */ -#define CCSDS_TIME_SIZE 8 -#elif (CFE_MISSION_SB_PACKET_TIME_FORMAT == CFE_MISSION_SB_TIME_32_32_M_20) -/* 32 bits seconds + 20 bits microsecs + 12 bits reserved */ -#define CCSDS_TIME_SIZE 8 -#else -/* unknown format */ -#error unable to define CCSDS_TIME_SIZE! -#endif - /* * Type Definitions */ @@ -86,7 +70,7 @@ typedef struct typedef struct { - uint8 Time[CCSDS_TIME_SIZE]; /**< \brief Time sized for selected format */ + uint8 Time[6]; /**< \brief Time, big endian: 4 byte seconds, 2 byte subseconds */ } CFE_MSG_TelemetrySecondaryHeader_t; diff --git a/modules/msg/src/cfe_msg_sechdr_time_old.c b/modules/msg/src/cfe_msg_sechdr_time_old.c deleted file mode 100644 index 7b1a5b16b..000000000 --- a/modules/msg/src/cfe_msg_sechdr_time_old.c +++ /dev/null @@ -1,137 +0,0 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - -/****************************************************************************** - * Time field access functions - */ -#include "cfe_msg_api.h" -#include "cfe_msg_priv.h" -#include "cfe_error.h" -#include - -/****************************************************************************** - * Set message time - See API and header file for details - */ -int32 CFE_MSG_SetMsgTime(CFE_MSG_Message_t *MsgPtr, CFE_TIME_SysTime_t NewTime) -{ - - uint32 status; - CFE_MSG_Type_t type; - bool hassechdr = false; - CFE_MSG_TelemetryHeader_t *tlm = (CFE_MSG_TelemetryHeader_t *)MsgPtr; - -/* declare format specific vars */ -#if (CFE_MISSION_SB_PACKET_TIME_FORMAT == CFE_MISSION_SB_TIME_32_16_SUBS) - uint16 LocalSubs16; -#elif (CFE_MISSION_SB_PACKET_TIME_FORMAT == CFE_MISSION_SB_TIME_32_32_M_20) - uint32 LocalSubs32; -#endif - - if (MsgPtr == NULL) - { - return CFE_MSG_BAD_ARGUMENT; - } - - /* Ignore return, pointer already checked */ - CFE_MSG_GetHasSecondaryHeader(MsgPtr, &hassechdr); - - status = CFE_MSG_GetType(MsgPtr, &type); - if (status != CFE_SUCCESS || type != CFE_MSG_Type_Tlm || !hassechdr) - { - return CFE_MSG_WRONG_MSG_TYPE; - } - - memcpy(&tlm->Sec.Time[0], &NewTime.Seconds, 4); - -#if (CFE_MISSION_SB_PACKET_TIME_FORMAT == CFE_MISSION_SB_TIME_32_16_SUBS) - - /* convert time from CFE_TIME_SysTime_t format to packet format */ - LocalSubs16 = (uint16)(NewTime.Subseconds >> 16); - memcpy(&tlm->Sec.Time[4], &LocalSubs16, 2); - -#elif (CFE_MISSION_SB_PACKET_TIME_FORMAT == CFE_MISSION_SB_TIME_32_32_SUBS) - - /* no conversion necessary -- packet format = CFE_TIME_SysTime_t format */ - memcpy(&tlm->Sec.Time[4], &NewTime.Subseconds, 4); - -#elif (CFE_MISSION_SB_PACKET_TIME_FORMAT == CFE_MISSION_SB_TIME_32_32_M_20) - - /* convert time from CFE_TIME_SysTime_t format to packet format */ - LocalSubs32 = CFE_TIME_Sub2MicroSecs(NewTime.Subseconds) << 12; - memcpy(&tlm->Sec.Time[4], &LocalSubs32, 4); - -#endif - - return CFE_SUCCESS; -} - -/****************************************************************************** - * Get message time - See API and header file for details - */ -int32 CFE_MSG_GetMsgTime(const CFE_MSG_Message_t *MsgPtr, CFE_TIME_SysTime_t *Time) -{ - - uint32 status; - CFE_MSG_Type_t type; - bool hassechdr = false; - CFE_MSG_TelemetryHeader_t *tlm = (CFE_MSG_TelemetryHeader_t *)MsgPtr; - -#if (CFE_MISSION_SB_PACKET_TIME_FORMAT == CFE_MISSION_SB_TIME_32_16_SUBS) - uint16 LocalSubs16; -#endif - - if (MsgPtr == NULL || Time == NULL) - { - return CFE_MSG_BAD_ARGUMENT; - } - - /* Ignore return, pointer already checked */ - CFE_MSG_GetHasSecondaryHeader(MsgPtr, &hassechdr); - - status = CFE_MSG_GetType(MsgPtr, &type); - if (status != CFE_SUCCESS || type != CFE_MSG_Type_Tlm || !hassechdr) - { - memset(Time, 0, sizeof(*Time)); - return CFE_MSG_WRONG_MSG_TYPE; - } - - memcpy(&Time->Seconds, &tlm->Sec.Time[0], 4); - -#if (CFE_MISSION_SB_PACKET_TIME_FORMAT == CFE_MISSION_SB_TIME_32_16_SUBS) - - memcpy(&LocalSubs16, &tlm->Sec.Time[4], 2); - /* convert packet data into CFE_TIME_SysTime_t format */ - Time->Subseconds = ((uint32)LocalSubs16) << 16; - -#elif (CFE_MISSION_SB_PACKET_TIME_FORMAT == CFE_MISSION_SB_TIME_32_32_SUBS) - - memcpy(&Time->Subseconds, &tlm->Sec.Time[4], 4); - /* no conversion necessary -- packet format = CFE_TIME_SysTime_t format */ - -#elif (CFE_MISSION_SB_PACKET_TIME_FORMAT == CFE_MISSION_SB_TIME_32_32_M_20) - - memcpy(&LocalSubs32, &tlm->Sec.Time[4], 4); - /* convert packet data into CFE_TIME_SysTime_t format */ - Time->Subseconds = CFE_TIME_Micro2SubSecs((LocalSubs32 >> 12)); - -#endif - - return CFE_SUCCESS; -}