Skip to content

Commit

Permalink
Merge pull request nasa#1243 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
cFE Integration candidate: 2021-03-23
  • Loading branch information
astrogeco authored Mar 22, 2021
2 parents fa10af7 + 313bcc0 commit 98bc158
Show file tree
Hide file tree
Showing 24 changed files with 84 additions and 36 deletions.
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Contributing Guide

Please see our [top-level contributing guide](https://github.com/nasa/cFS/blob/main/CONTRIBUTING.md) for more information on how to contribute.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ The detailed cFE user's guide can be viewed at <https://github.com/nasa/cFS/blob

## Version History

### Development Build: v6.8.0-rc1+dev436

- Adds a local definition of SOFTWARE_BIG/LITTLE_BIT_ORDER directly inside cfe_endian.h to provide a compatible symbol for apps that still require this. This allows CFE to build and run successfully when OSAL stops providing this in `common_types.h`.
- Removes incorrect statements from Application Developers Guide
- Fixes truncation handling on vsnprintf error by adding a cast to avoid implicit conversion
- Clarify the documentation on SB MsgId regarding requirements for command and telemetry messages
- Avoids undefined behavior and resolves static analysis warnings by casting isspace input to unsigned char.
- Updates message module and msgid v1, CFE_MSG_SetMsgId, to use mask instead of cast to alter value. Resolves static analysis warning.
- Updates CFE_ES_FileWriteByteCntErr to report status, not a size_t actual since OS_write returns int32. Use int16 for local type from CFE_TBL_FindTableInRegistry since it's an index, not a status.
- Replaces <> with " in local #includes
- Adds CONTRIBUING.md that links to the main cFS contributing guide.
- See <https://github.com/nasa/cFE/pull/1243>

### Development Build: v6.8.0-rc1+dev412

- Apply standard code style and format
Expand Down
4 changes: 2 additions & 2 deletions cmake/target/inc/target_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#ifndef TARGET_CONFIG_H_
#define TARGET_CONFIG_H_

#include <common_types.h>
#include <cfe_psp_configdata.h>
#include "common_types.h"
#include "cfe_psp_configdata.h"

/**
* Prototype for the main system entry function implemented in CFE ES
Expand Down
9 changes: 6 additions & 3 deletions docs/cFE Application Developers Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,12 @@ deciding on whether to create multiple Applications versus a single
Application with multiple Tasks, the Application Developer should keep
in mind these facts:

- Child Tasks can only execute at a priority equal to or less than the
priority of the Application's Main Task.
- When the Application exits it is the responsiabilty of the
Main Task to safely stop all of its Child Tasks.

- If the Main Task of an Application is stopped, either through
detection of an exception or via command, all Child Tasks are also
stopped.
forcibly stopped in an unsafe manner.

Child Tasks can be useful in both "Software Only" and "Hardware Servicing"
applications.
Expand Down Expand Up @@ -1393,6 +1393,9 @@ on the Software Bus. Depending on the implementation, different
ranges and values are supported, and the values effect the message
header differently.

If you are using the default, MsgID maps directly to the CCSDS Stream ID.
When using the default, for commands use 0x18xx and telemetry use 0x08xx

### 6.1.2 Pipes

The destinations to which SB Messages are sent are called *pipes*. These
Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_assert/inc/cfe_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/************************************************************************
** Includes
*************************************************************************/
#include <common_types.h>
#include "common_types.h"

/************************************************************************
** Type Definitions
Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_assert/src/cfe_assert_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* Includes
*/

#include <cfe.h>
#include "cfe.h"

#include "cfe_assert.h"

Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_assert/src/cfe_assert_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <string.h>
#include <stdbool.h>

#include <cfe.h>
#include "cfe.h"

#include "utbsp.h"
#include "uttest.h"
Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_testcase/src/cfe_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* Includes
*/

#include <cfe.h>
#include "cfe.h"

#include "uttest.h"
#include "utassert.h"
Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_testrunner/inc/cfe_testrunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/************************************************************************
** Includes
*************************************************************************/
#include <common_types.h>
#include "common_types.h"

/************************************************************************
** Type Definitions
Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_testrunner/src/cfe_testrunner_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* Includes
*/

#include <cfe.h>
#include "cfe.h"

#include "cfe_testrunner.h"

Expand Down
24 changes: 24 additions & 0 deletions modules/core_api/fsw/inc/cfe_endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,30 @@
*/
#include "common_types.h"

/*
* SOFTWARE_BIG/LITTLE_BIT_ORDER COMPATIBILITY MACRO -
*
* This is provided only for backward compatibilty. Do not write any new code that
* uses this macro.
*/
#if !defined(SOFTWARE_BIG_BIT_ORDER) && !defined(SOFTWARE_LITTLE_BIT_ORDER)

#if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || defined(__BIG_ENDIAN__) || defined(__ARMEB__) || \
defined(__THUMBEB__) || defined(__AARCH64EB__) || defined(_MIBSEB) || defined(__MIBSEB) || defined(__MIBSEB__)
/* It is a big-endian target architecture */
#define SOFTWARE_BIG_BIT_ORDER
#elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || defined(__LITTLE_ENDIAN__) || defined(__ARMEL__) || \
defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__) || \
defined(__i386) || defined(__i386__) || defined(__i686) || defined(__i686__) || defined(__x86_64) || \
defined(__x86_64__)
/* It is a little-endian target architecture */
#define SOFTWARE_LITTLE_BIT_ORDER
#else
#error Unknown byte order on this platform
#endif

#endif /* !defined(SOFTWARE_BIG_BIT_ORDER) && !defined(SOFTWARE_LITTLE_BIT_ORDER) */

/* Macro to convert 16/32 bit types from platform "endianness" to Big Endian */
#ifdef SOFTWARE_BIG_BIT_ORDER
#define CFE_MAKE_BIG16(n) (n)
Expand Down
4 changes: 2 additions & 2 deletions modules/core_api/fsw/inc/cfe_tbl_filedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
#ifndef _cfe_tbl_filedef_
#define _cfe_tbl_filedef_

#include <cfe_mission_cfg.h>
#include <common_types.h>
#include "cfe_mission_cfg.h"
#include "common_types.h"
#include "cfe_tbl_extern_typedefs.h" /* for "CFE_TBL_FileHdr_t" definition */
#include "cfe_fs_extern_typedefs.h" /* for "CFE_FS_HDR_DESC_MAX_LEN" definition */

Expand Down
2 changes: 1 addition & 1 deletion modules/core_api/fsw/inc/cfe_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/

/* Development Build Macro Definitions */
#define CFE_BUILD_NUMBER 412 /*!< Development Build: Number of commits since baseline */
#define CFE_BUILD_NUMBER 436 /*!< Development Build: Number of commits since baseline */
#define CFE_BUILD_BASELINE \
"v6.8.0-rc1" /*!< Development Build: git tag that is the base for the current development \
*/
Expand Down
8 changes: 4 additions & 4 deletions modules/core_private/fsw/inc/cfe_es_erlog_typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
#ifndef CFE_ES_ERLOG_TYPEDEF_H_
#define CFE_ES_ERLOG_TYPEDEF_H_

#include <common_types.h>
#include <cfe_platform_cfg.h>
#include "common_types.h"
#include "cfe_platform_cfg.h"

#include <cfe_time_extern_typedefs.h> /* Needed for CFE_TIME_SysTime_t */
#include <cfe_es_extern_typedefs.h> /* Needed for CFE_ES_AppId_t */
#include "cfe_time_extern_typedefs.h" /* Needed for CFE_TIME_SysTime_t */
#include "cfe_es_extern_typedefs.h" /* Needed for CFE_ES_AppId_t */

#define CFE_ES_ERLOG_DESCRIPTION_MAX_LENGTH 80

Expand Down
2 changes: 1 addition & 1 deletion modules/core_private/fsw/inc/cfe_es_perfdata_typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#ifndef CFE_ES_PERFDATA_TYPEDEF_H_
#define CFE_ES_PERFDATA_TYPEDEF_H_

#include <common_types.h>
#include "common_types.h"
#include "cfe_mission_cfg.h" /* Required for CFE_MISSION_ES_PERF_MAX_IDS */
#include "cfe_platform_cfg.h" /* Required for CFE_PLATFORM_ES_PERF_DATA_BUFFER_SIZE */

Expand Down
2 changes: 1 addition & 1 deletion modules/core_private/fsw/inc/cfe_es_resetdata_typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#ifndef CFE_ES_RESETDATA_TYPEDEF_H_
#define CFE_ES_RESETDATA_TYPEDEF_H_

#include <common_types.h>
#include "common_types.h"

#include "cfe_time_resetvars_typedef.h" /* Required for CFE_TIME_ResetVars_t definition */
#include "cfe_es_erlog_typedef.h" /* Required for CFE_ES_ERLog_t definition */
Expand Down
4 changes: 2 additions & 2 deletions modules/core_private/fsw/inc/cfe_evs_log_typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#ifndef CFE_EVS_LOG_TYPEDEF_H_
#define CFE_EVS_LOG_TYPEDEF_H_

#include <common_types.h>
#include <cfe_platform_cfg.h>
#include "common_types.h"
#include "cfe_platform_cfg.h"

#include "cfe_evs_msg.h" /* Required for CFE_EVS_LongEventTlm_t definition */

Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_syslog.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ void CFE_ES_SysLog_vsnprintf(char *Buffer, size_t BufferSize, const char *SpecSt
*
* Strip off all trailing whitespace, and add back a single newline
*/
while (StringLen > 0 && isspace((int)Buffer[StringLen - 1]))
while (StringLen > 0 && isspace((unsigned char)Buffer[StringLen - 1]))
{
--StringLen;
}
Expand Down
6 changes: 3 additions & 3 deletions modules/es/fsw/src/cfe_es_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -1990,12 +1990,12 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistryCmd_t *data)
/* a byte count discrepancy has been*/
/* detected during the file write */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void CFE_ES_FileWriteByteCntErr(const char *Filename, size_t Requested, size_t Actual)
void CFE_ES_FileWriteByteCntErr(const char *Filename, size_t Requested, int32 Status)
{

CFE_EVS_SendEvent(CFE_ES_FILEWRITE_ERR_EID, CFE_EVS_EventType_ERROR,
"File write,byte cnt err,file %s,request=%u,actual=%u", Filename, (unsigned int)Requested,
(unsigned int)Actual);
"File write,byte cnt err,file %s,request=%u,status=0x%08x", Filename, (unsigned int)Requested,
(unsigned int)Status);

} /* End of CFE_ES_FileWriteByteCntErr() */

Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistryCmd_t *data);
*/
bool CFE_ES_ValidateHandle(CFE_ES_MemHandle_t Handle);
bool CFE_ES_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength);
void CFE_ES_FileWriteByteCntErr(const char *Filename, size_t Requested, size_t Actual);
void CFE_ES_FileWriteByteCntErr(const char *Filename, size_t Requested, int32 Status);

/*************************************************************************/

Expand Down
7 changes: 5 additions & 2 deletions modules/evs/fsw/src/cfe_evs_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,11 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1
ExpandedLength =
vsnprintf((char *)LongEventTlm.Payload.Message, sizeof(LongEventTlm.Payload.Message), MsgSpec, ArgPtr);

/* Were any characters truncated in the buffer? */
if (ExpandedLength >= sizeof(LongEventTlm.Payload.Message))
/*
* If vsnprintf is bigger than message size, mark with truncation character
* Note negative returns (error from vsnprintf) will just leave the message as-is
*/
if (ExpandedLength >= (int)sizeof(LongEventTlm.Payload.Message))
{
/* Mark character before zero terminator to indicate truncation */
LongEventTlm.Payload.Message[sizeof(LongEventTlm.Payload.Message) - 2] = CFE_EVS_MSG_TRUNCATED;
Expand Down
5 changes: 3 additions & 2 deletions modules/msg/fsw/src/cfe_msg_msgid_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ int32 CFE_MSG_SetMsgId(CFE_MSG_Message_t *MsgPtr, CFE_SB_MsgId_t MsgId)
return CFE_MSG_BAD_ARGUMENT;
}

MsgPtr->CCSDS.Pri.StreamId[0] = (uint8)(msgidval >> 8);
MsgPtr->CCSDS.Pri.StreamId[1] = (uint8)(msgidval);
/* Shift and mask bytes to be endian agnostic */
MsgPtr->CCSDS.Pri.StreamId[0] = (msgidval >> 8) & 0xFF;
MsgPtr->CCSDS.Pri.StreamId[1] = msgidval & 0xFF;

return CFE_SUCCESS;
}
9 changes: 5 additions & 4 deletions modules/tbl/fsw/src/cfe_tbl_task_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ int32 CFE_TBL_LoadCmd(const CFE_TBL_LoadCmd_t *data)
CFE_TBL_File_Hdr_t TblFileHeader;
osal_id_t FileDescriptor;
int32 Status;
int16 RegIndex;
CFE_TBL_RegistryRec_t * RegRecPtr;
CFE_TBL_LoadBuff_t * WorkingBufferPtr;
char LoadFilename[OS_MAX_PATH_LEN];
Expand All @@ -379,17 +380,17 @@ int32 CFE_TBL_LoadCmd(const CFE_TBL_LoadCmd_t *data)
if (Status == CFE_SUCCESS)
{
/* Locate specified table in registry */
Status = CFE_TBL_FindTableInRegistry(TblFileHeader.TableName);
RegIndex = CFE_TBL_FindTableInRegistry(TblFileHeader.TableName);

if (Status == CFE_TBL_NOT_FOUND)
if (RegIndex == CFE_TBL_NOT_FOUND)
{
CFE_EVS_SendEvent(CFE_TBL_NO_SUCH_TABLE_ERR_EID, CFE_EVS_EventType_ERROR,
"Unable to locate '%s' in Table Registry", TblFileHeader.TableName);
}
else
{
/* Translate the registry index into a record pointer */
RegRecPtr = &CFE_TBL_Global.Registry[Status];
RegRecPtr = &CFE_TBL_Global.Registry[RegIndex];

if (RegRecPtr->DumpOnly)
{
Expand Down Expand Up @@ -1321,7 +1322,7 @@ int32 CFE_TBL_DeleteCDSCmd(const CFE_TBL_DeleteCDSCmd_t *data)
char TableName[CFE_TBL_MAX_FULL_NAME_LEN];
CFE_TBL_CritRegRec_t * CritRegRecPtr = NULL;
uint32 i;
uint32 RegIndex;
int16 RegIndex;
int32 Status;

/* Make sure all strings are null terminated before attempting to process them */
Expand Down
2 changes: 1 addition & 1 deletion modules/tbl/ut-coverage/tbl_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -2589,7 +2589,7 @@ void Test_CFE_TBL_Manage(void)
{
int32 RtnCode;
bool EventsCorrect;
int32 RegIndex;
int16 RegIndex;
CFE_TBL_RegistryRec_t * RegRecPtr;
CFE_TBL_LoadBuff_t * WorkingBufferPtr;
UT_Table1_t TestTable1;
Expand Down

0 comments on commit 98bc158

Please sign in to comment.