F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Fw Namespace Reference

Namespaces

 DpCfg
 
 StringUtils
 

Classes

class  Active
 Active and inactive states. More...
 
class  ActiveComponentBase
 
class  ActiveComponentExitSerializableBuffer
 
class  AmpcsEvrLogPacket
 
class  AssertHook
 
class  Buffer
 
class  ByteArray
 A variable-length byte array. More...
 
class  CmdArgBuffer
 
class  CmdPacket
 
class  CmdResponse
 Enum representing a command response. More...
 
class  CmdStringArg
 
class  ComBuffer
 
class  ComPacket
 
class  ConstByteArray
 A variable-length byte array with constant access. More...
 
class  DeserialStatus
 Deserialization status. More...
 
class  Direction
 Direction states. More...
 
class  DpContainer
 A data product Container. More...
 
class  DpState
 
class  Enabled
 Enabled and disabled states. More...
 
class  ExternalSerializeBuffer
 External serialize buffer with no copy semantics. More...
 
class  ExternalSerializeBufferWithDataCopy
 
class  ExternalSerializeBufferWithMemberCopy
 
class  ExternalString
 A string backed by an external buffer. More...
 
class  FileNameString
 
class  FilePacket
 A file packet. More...
 
class  Health
 Health states. More...
 
class  InputBufferGetPort
 
class  InputBufferSendPort
 
class  InputCmdPort
 
class  InputCmdRegPort
 
class  InputCmdResponsePort
 
class  InputComPort
 
class  InputDpGetPort
 
class  InputDpRequestPort
 
class  InputDpResponsePort
 
class  InputDpSendPort
 
class  InputLogPort
 
class  InputLogTextPort
 
class  InputPortBase
 
class  InputPrmGetPort
 
class  InputPrmSetPort
 
class  InputSuccessConditionPort
 
class  InputTimeIntervalPort
 
class  InputTimePort
 
class  InputTlmGetPort
 
class  InputTlmPort
 
class  InternalInterfaceString
 
class  LogBuffer
 
class  Logger
 
class  Logic
 Logic states. More...
 
class  LogPacket
 
class  LogSeverity
 Enum representing event severity. More...
 
class  LogStringArg
 
class  MallocAllocator
 
class  MemAllocator
 
class  MmapAllocator
 
class  ObjBase
 Brief class description. More...
 
class  ObjectName
 
class  On
 On and off states. More...
 
class  Open
 Open and closed states. More...
 
class  OutputBufferGetPort
 
class  OutputBufferSendPort
 
class  OutputCmdPort
 
class  OutputCmdRegPort
 
class  OutputCmdResponsePort
 
class  OutputComPort
 
class  OutputDpGetPort
 
class  OutputDpRequestPort
 
class  OutputDpResponsePort
 
class  OutputDpSendPort
 
class  OutputLogPort
 
class  OutputLogTextPort
 
class  OutputPortBase
 
class  OutputPrmGetPort
 
class  OutputPrmSetPort
 
class  OutputSuccessConditionPort
 
class  OutputTimeIntervalPort
 
class  OutputTimePort
 
class  OutputTlmGetPort
 
class  OutputTlmPort
 
class  ParamBuffer
 
class  ParamString
 
class  ParamValid
 Enum representing parameter validity. More...
 
class  PassiveComponentBase
 
class  PolyType
 
class  PortBase
 
class  QueuedComponentBase
 
class  SerialBuffer
 A variable-length serializable buffer. More...
 
class  Serializable
 forward declaration More...
 
class  SerializableFile
 The type of a packet header. More...
 
class  Serialization
 
class  SerializeBufferBase
 
class  SerialStatus
 Serialization status. More...
 
class  SmSignalBuffer
 
class  String
 
class  StringBase
 
class  StringTemplate
 
class  Success
 Success/Failure. More...
 
class  TextLogString
 
class  Time
 
class  TimeInterval
 
class  TlmBuffer
 
class  TlmPacket
 
class  TlmString
 
class  TrapHandler
 
class  Wait
 Wait or don't wait for something. More...
 

Enumerations

enum  {
  FW_TYPEID_U8 = 10, FW_TYPEID_18 = 11, FW_TYPEID_U16 = 12, FW_TYPEID_I16 = 13,
  FW_TYPEID_U32 = 14, FW_TYPEID_I32 = 15, FW_TYPEID_U64 = 16, FW_TYPEID_I64 = 17,
  FW_TYPEID_F32 = 18, FW_TYPEID_F64 = 19, FW_TYPEID_BOOL = 20, FW_TYPEID_PTR = 21,
  FW_TYPEID_BUFF = 22, FW_TYPEID_POLY = 30, FW_TYPEID_CMD_BUFF = 40, FW_TYPEID_CMD_STR = 41,
  FW_TYPEID_TLM_BUFF = 42, FW_TYPEID_TLM_STR = 43, FW_TYPEID_LOG_BUFF = 44, FW_TYPEID_LOG_STR = 45,
  FW_TYPEID_PRM_BUFF = 46, FW_TYPEID_PRM_STR = 47, FW_TYPEID_FILE_BUFF = 48, FW_TYPEID_EIGHTY_CHAR_STRING = 50,
  FW_TYPEID_INTERNAL_INTERFACE_STRING = 51, FW_TYPEID_FIXED_LENGTH_STRING = 52, FW_TYPEID_OBJECT_NAME = 53, FW_TYPEID_FILE_NAME_STRING = 54
}
 
enum  FormatStatus {
  FormatStatus::SUCCESS, FormatStatus::OVERFLOWED, FormatStatus::INVALID_FORMAT_STRING, FormatStatus::SIZE_OVERFLOW,
  FormatStatus::OTHER_ERROR
}
 status of string format calls More...
 
enum  SerializeStatus {
  FW_SERIALIZE_OK, FW_SERIALIZE_FORMAT_ERROR, FW_SERIALIZE_NO_ROOM_LEFT, FW_DESERIALIZE_BUFFER_EMPTY,
  FW_DESERIALIZE_FORMAT_ERROR, FW_DESERIALIZE_SIZE_MISMATCH, FW_DESERIALIZE_TYPE_MISMATCH
}
 forward declaration for string More...
 

Functions

void defaultPrintAssert (const CHAR *msg)
 
void defaultReportAssert (FILE_NAME_ARG file, NATIVE_UINT_TYPE lineNo, NATIVE_UINT_TYPE numArgs, FwAssertArgType arg1, FwAssertArgType arg2, FwAssertArgType arg3, FwAssertArgType arg4, FwAssertArgType arg5, FwAssertArgType arg6, CHAR *destBuffer, NATIVE_INT_TYPE buffSize)
 
NATIVE_INT_TYPE defaultSwAssert (FILE_NAME_ARG file, NATIVE_UINT_TYPE lineNo, NATIVE_UINT_TYPE numArgs, FwAssertArgType arg1, FwAssertArgType arg2, FwAssertArgType arg3, FwAssertArgType arg4, FwAssertArgType arg5, FwAssertArgType arg6)
 
NATIVE_INT_TYPE SwAssert (FILE_NAME_ARG file, NATIVE_UINT_TYPE lineNo) CLANG_ANALYZER_NORETURN
 Assert with no arguments. More...
 
NATIVE_INT_TYPE SwAssert (FILE_NAME_ARG file, FwAssertArgType arg1, NATIVE_UINT_TYPE lineNo) CLANG_ANALYZER_NORETURN
 Assert with one argument. More...
 
NATIVE_INT_TYPE SwAssert (FILE_NAME_ARG file, FwAssertArgType arg1, FwAssertArgType arg2, NATIVE_UINT_TYPE lineNo) CLANG_ANALYZER_NORETURN
 Assert with two arguments. More...
 
NATIVE_INT_TYPE SwAssert (FILE_NAME_ARG file, FwAssertArgType arg1, FwAssertArgType arg2, FwAssertArgType arg3, NATIVE_UINT_TYPE lineNo) CLANG_ANALYZER_NORETURN
 Assert with three arguments. More...
 
NATIVE_INT_TYPE SwAssert (FILE_NAME_ARG file, FwAssertArgType arg1, FwAssertArgType arg2, FwAssertArgType arg3, FwAssertArgType arg4, NATIVE_UINT_TYPE lineNo) CLANG_ANALYZER_NORETURN
 Assert with four arguments. More...
 
NATIVE_INT_TYPE SwAssert (FILE_NAME_ARG file, FwAssertArgType arg1, FwAssertArgType arg2, FwAssertArgType arg3, FwAssertArgType arg4, FwAssertArgType arg5, NATIVE_UINT_TYPE lineNo) CLANG_ANALYZER_NORETURN
 Assert with five arguments. More...
 
NATIVE_INT_TYPE SwAssert (FILE_NAME_ARG file, FwAssertArgType arg1, FwAssertArgType arg2, FwAssertArgType arg3, FwAssertArgType arg4, FwAssertArgType arg5, FwAssertArgType arg6, NATIVE_UINT_TYPE lineNo) CLANG_ANALYZER_NORETURN
 Assert with six arguments. More...
 
FormatStatus stringFormat (char *destination, const FwSizeType maximumSize, const char *formatString,...)
 format a c-string More...
 
FormatStatus stringFormat (char *destination, const FwSizeType maximumSize, const char *formatString, va_list args)
 format a c-string More...
 

Variables

const Time ZERO_TIME = Time()
 
STATIC AssertHooks_assertHook = nullptr
 

Detailed Description

File: Logger.cpp Description: Framework logging implementation Author: mstarch

This file adds in support to the core 'Fw' package, to separate it from Os and other loggers, and allow the architect of the system to select which core framework logging should be used.

This class is a pure virtual base class for memory allocators in Fprime. The intent is to provide derived classes the get memory from different sources. The base class can be passed to classes so the allocator can be selected at the system level, and different allocators can be used by different components as appropriate.

The identifier can be used to look up a pre-allocated buffer by ID in an embedded system. Identifiers may be used only in a single call to an invocation. Some implementations of MemAllocator discard the identifier but components using the MemAllocator interface should not depend on the identifier to be discarded.

The size is the requested size of the memory. If the allocator cannot return the requested amount, it should return the actual amount and users should check.

The recoverable flag is intended to be used in embedded environments where memory can survive a processor reset and data can be recovered. The component using the allocator can then use the data. Any integrity checks are up to the user of the memory.

Fw/Types/StringUtils.hpp:

C-string helper utilities. Note: wherever possible, use Fw::StringBase and derived classes instead of raw C-strings.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FW_TYPEID_U8 

U8 serialized type id.

FW_TYPEID_18 

I8 serialized type id.

FW_TYPEID_U16 

U16 serialized type id.

FW_TYPEID_I16 

I16 serialized type id.

FW_TYPEID_U32 

U32 serialized type id.

FW_TYPEID_I32 

I32 serialized type id.

FW_TYPEID_U64 

U64 serialized type id.

FW_TYPEID_I64 

I64 serialized type id.

FW_TYPEID_F32 

F32 serialized type id.

FW_TYPEID_F64 

F64 serialized type id.

FW_TYPEID_BOOL 

boolean serialized type id

FW_TYPEID_PTR 

pointer serialized type id

FW_TYPEID_BUFF 

buffer serialized type id

FW_TYPEID_POLY 

PolyType serialized type id.

FW_TYPEID_CMD_BUFF 

Command Buffer type id.

FW_TYPEID_CMD_STR 

Command string type id.

FW_TYPEID_TLM_BUFF 

Telemetry Buffer type id.

FW_TYPEID_TLM_STR 

Telemetry string type id.

FW_TYPEID_LOG_BUFF 

Log Buffer type id.

FW_TYPEID_LOG_STR 

Log string type id.

FW_TYPEID_PRM_BUFF 

Parameter Buffer type id.

FW_TYPEID_PRM_STR 

Parameter string type id.

FW_TYPEID_FILE_BUFF 

File piece Buffer type id.

FW_TYPEID_EIGHTY_CHAR_STRING 

80 char string Buffer type id

FW_TYPEID_INTERNAL_INTERFACE_STRING 

interface string Buffer type id

FW_TYPEID_FIXED_LENGTH_STRING 

256 char string Buffer type id

FW_TYPEID_OBJECT_NAME 

ObjectName string Buffer type id.

FW_TYPEID_FILE_NAME_STRING 

FileName string Buffer type id.

Definition at line 21 of file SerIds.hpp.

◆ FormatStatus

enum Fw::FormatStatus
strong

status of string format calls

Enumerator
SUCCESS 

Format worked.

OVERFLOWED 

Format overflowed.

INVALID_FORMAT_STRING 

Format provided invalid format string.

SIZE_OVERFLOW 

FwSizeType overflowed the range of size_t.

OTHER_ERROR 

An error was returned from an underlying call.

Definition at line 18 of file format.hpp.

◆ SerializeStatus

forward declaration for string

Enumerator
FW_SERIALIZE_OK 

Serialization/Deserialization operation was successful.

FW_SERIALIZE_FORMAT_ERROR 

Data was the wrong format (e.g. wrong packet type)

FW_SERIALIZE_NO_ROOM_LEFT 

No room left in the buffer to serialize data.

FW_DESERIALIZE_BUFFER_EMPTY 

Deserialization buffer was empty when trying to read more data.

FW_DESERIALIZE_FORMAT_ERROR 

Deserialization data had incorrect values (unexpected data types)

FW_DESERIALIZE_SIZE_MISMATCH 

Data was left in the buffer, but not enough to deserialize.

FW_DESERIALIZE_TYPE_MISMATCH 

Deserialized type ID didn't match.

Definition at line 14 of file Serializable.hpp.

Function Documentation

◆ defaultPrintAssert()

void Fw::defaultPrintAssert ( const CHAR msg)

Definition at line 16 of file Assert.cpp.

◆ defaultReportAssert()

void Fw::defaultReportAssert ( FILE_NAME_ARG  file,
NATIVE_UINT_TYPE  lineNo,
NATIVE_UINT_TYPE  numArgs,
FwAssertArgType  arg1,
FwAssertArgType  arg2,
FwAssertArgType  arg3,
FwAssertArgType  arg4,
FwAssertArgType  arg5,
FwAssertArgType  arg6,
CHAR destBuffer,
NATIVE_INT_TYPE  buffSize 
)

Definition at line 22 of file Assert.cpp.

◆ defaultSwAssert()

NATIVE_INT_TYPE Fw::defaultSwAssert ( FILE_NAME_ARG  file,
NATIVE_UINT_TYPE  lineNo,
NATIVE_UINT_TYPE  numArgs,
FwAssertArgType  arg1,
FwAssertArgType  arg2,
FwAssertArgType  arg3,
FwAssertArgType  arg4,
FwAssertArgType  arg5,
FwAssertArgType  arg6 
)

Definition at line 110 of file Assert.cpp.

◆ stringFormat() [1/2]

Fw::FormatStatus Fw::stringFormat ( char *  destination,
const FwSizeType  maximumSize,
const char *  formatString,
  ... 
)

format a c-string

Format a string using printf family formatting semantics. Destination will be filled with the formatted string up to maximumSize - 1. This function will always terminate the string with a \0.

This function can return several error codes: OVERFLOWED: the complete string did not fit in the buffer with an appended null-terminator INVALID_FORMAT_STRING: the format string was null OTHER_ERROR: another error occurred in an underlying function call Otherwise SUCCESS is returned. destination may be modified even in the case of an error.

Parameters
destinationdestination to fill with the formatted string
maximumSizesize of the buffer represented by destination
formatStringformat string to fill
...variable arguments inputs
Returns
: SUCCESS on successful formatting, OVERFLOWED on overflow, and something else on any error

Definition at line 10 of file snprintf_format.cpp.

◆ stringFormat() [2/2]

Fw::FormatStatus Fw::stringFormat ( char *  destination,
const FwSizeType  maximumSize,
const char *  formatString,
va_list  args 
)

format a c-string

Format a string using printf family formatting semantics. Destination will be filled with the formatted string up to maximumSize - 1. This function will always terminate the string with a \0.

This function can return several error codes: OVERFLOWED: the complete string did not fit in the buffer with an appended null-terminator INVALID_FORMAT_STRING: the format string was null OTHER_ERROR: another error occurred in an underlying function call Otherwise SUCCESS is returned. destination may be modified even in the case of an error.

This version take a variable argument list

Parameters
destinationdestination to fill with the formatted string
maximumSizesize of the buffer represented by destination
formatStringformat string to fill
argsvariable arguments list
Returns
: SUCCESS on successful formatting, OVERFLOWED on overflow, and something else on any error

Definition at line 18 of file snprintf_format.cpp.

◆ SwAssert() [1/7]

NATIVE_INT_TYPE Fw::SwAssert ( FILE_NAME_ARG  file,
NATIVE_UINT_TYPE  lineNo 
)

Assert with no arguments.

Definition at line 131 of file Assert.cpp.

◆ SwAssert() [2/7]

NATIVE_INT_TYPE Fw::SwAssert ( FILE_NAME_ARG  file,
FwAssertArgType  arg1,
NATIVE_UINT_TYPE  lineNo 
)

Assert with one argument.

Definition at line 135 of file Assert.cpp.

◆ SwAssert() [3/7]

NATIVE_INT_TYPE Fw::SwAssert ( FILE_NAME_ARG  file,
FwAssertArgType  arg1,
FwAssertArgType  arg2,
NATIVE_UINT_TYPE  lineNo 
)

Assert with two arguments.

Definition at line 139 of file Assert.cpp.

◆ SwAssert() [4/7]

NATIVE_INT_TYPE Fw::SwAssert ( FILE_NAME_ARG  file,
FwAssertArgType  arg1,
FwAssertArgType  arg2,
FwAssertArgType  arg3,
NATIVE_UINT_TYPE  lineNo 
)

Assert with three arguments.

Definition at line 143 of file Assert.cpp.

◆ SwAssert() [5/7]

NATIVE_INT_TYPE Fw::SwAssert ( FILE_NAME_ARG  file,
FwAssertArgType  arg1,
FwAssertArgType  arg2,
FwAssertArgType  arg3,
FwAssertArgType  arg4,
NATIVE_UINT_TYPE  lineNo 
)

Assert with four arguments.

Definition at line 151 of file Assert.cpp.

◆ SwAssert() [6/7]

NATIVE_INT_TYPE Fw::SwAssert ( FILE_NAME_ARG  file,
FwAssertArgType  arg1,
FwAssertArgType  arg2,
FwAssertArgType  arg3,
FwAssertArgType  arg4,
FwAssertArgType  arg5,
NATIVE_UINT_TYPE  lineNo 
)

Assert with five arguments.

Definition at line 160 of file Assert.cpp.

◆ SwAssert() [7/7]

NATIVE_INT_TYPE Fw::SwAssert ( FILE_NAME_ARG  file,
FwAssertArgType  arg1,
FwAssertArgType  arg2,
FwAssertArgType  arg3,
FwAssertArgType  arg4,
FwAssertArgType  arg5,
FwAssertArgType  arg6,
NATIVE_UINT_TYPE  lineNo 
)

Assert with six arguments.

Definition at line 170 of file Assert.cpp.

Variable Documentation

◆ s_assertHook

STATIC AssertHook* Fw::s_assertHook = nullptr

Definition at line 98 of file Assert.cpp.

◆ ZERO_TIME

const Time Fw::ZERO_TIME = Time()

Definition at line 5 of file Time.cpp.