F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
ConfigCheck.cpp
Go to the documentation of this file.
1
13#include <FpConfig.hpp>
14#include <limits>
15
16// Check that Fw::String is big enough to hold any string that can be given a
17// default value in FPP.
18
20 "A generic string should be able to hold a command string");
22 "A generic string should be able to hold an event string");
24 "A generic string should be able to hold a telemetry string");
26 "A generic string should be able to hold a parameter string");
27
28// Check that command/telemetry strings are not larger than an argument buffer
29
31 "FW_CMD_STRING_MAX_SIZE cannot be larger than FW_CMD_ARG_BUFFER_MAX_SIZE");
33 "FW_LOG_STRING_MAX_SIZE cannot be larger than FW_LOG_BUFFER_MAX_SIZE");
35 "FW_TLM_STRING_MAX_SIZE cannot be larger than FW_TLM_BUFFER_MAX_SIZE");
37 "FW_PARAM_STRING_MAX_SIZE cannot be larger than FW_PARAM_BUFFER_MAX_SIZE");
38
39// Text logging needs the code generator for serializables to generate a stringified version of the
40// value.
41static_assert((FW_ENABLE_TEXT_LOGGING == 0) || (FW_SERIALIZABLE_TO_STRING != 0),
42 "FW_SERIALIZABLE_TO_STRING must be enabled to enable FW_ENABLE_TEXT_LOGGING");
43
44// Unit testing needs serializable strings
45#ifdef BUILD_UT
46static_assert(FW_SERIALIZABLE_TO_STRING != 0,
47 "FW_SERIALIZABLE_TO_STRING must be enabled for unit testing");
48#endif
49
50static_assert(std::numeric_limits<FwBuffSizeType>::max() == std::numeric_limits<FwSizeStoreType>::max() &&
51 std::numeric_limits<FwBuffSizeType>::min() == std::numeric_limits<FwSizeStoreType>::min(),
52 "FwBuffSizeType must be equivalent to FwExternalSizeType");
53
54static_assert(std::numeric_limits<FwSizeType>::max() >= std::numeric_limits<FwSizeStoreType>::max() &&
55 std::numeric_limits<FwSizeType>::min() <= std::numeric_limits<FwSizeStoreType>::min(),
56 "FwSizeType cannot entirely store values of type FwExternalSizeType");
#define FW_LOG_BUFFER_MAX_SIZE
Definition FpConfig.h:313
#define FW_SERIALIZABLE_TO_STRING
Indicates if autocoded serializables have toString() methods.
Definition FpConfig.h:365
#define FW_FIXED_LENGTH_STRING_SIZE
Character array size for Fw::String.
Definition FpConfig.h:387
#define FW_CMD_STRING_MAX_SIZE
Max character size of command string arguments.
Definition FpConfig.h:298
#define FW_TLM_STRING_MAX_SIZE
Max size of channelized telemetry string type.
Definition FpConfig.h:329
#define FW_PARAM_BUFFER_MAX_SIZE
Definition FpConfig.h:334
#define FW_TLM_BUFFER_MAX_SIZE
Definition FpConfig.h:324
#define FW_ENABLE_TEXT_LOGGING
Indicates whether text logging is turned on.
Definition FpConfig.h:354
#define FW_PARAM_STRING_MAX_SIZE
Max size of parameter string type.
Definition FpConfig.h:339
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
Definition FpConfig.h:319
#define FW_CMD_ARG_BUFFER_MAX_SIZE
Definition FpConfig.h:293
C++-compatible configuration header for fprime configuration.