WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
Telemetry.h File Reference

Header for generic telemetry packet struct generation and serialization. More...

#include <string.h>
#include "communication/spacepacketutils.hpp"
#include "utils/stringutils.hpp"
#include "configuration.h"

Go to the source code of this file.

Classes

struct  cmd_tlm_base
 Base struct in definition of command and telemetry packets. More...

Macros

#define CMD_APID_MIN_ALLOWABLE   0x1
#define CMD_APID_MAX_ALLOWABLE   0xB
#define TLM_APID_MIN_ALLOWABLE   0xC
#define TLM_APID_MAX_ALLOWABLE   0xF
#define CMD_TLM_COMMON(NAME, APID, SIZE, ...)
#define STRIP_PARENS(X)
#define STRIP_PARENS_IMPL(...)
#define DECLARE_FIELD(pair)
#define DECLARE_FIELD_(type, name)
#define PACKETIZE_FIELD(pair)
#define PACKETIZE_FIELD_(type, name)
#define DEPACKETIZE_FIELD(pair)
#define DEPACKETIZE_FIELD_(type, name)
#define STR_FIELD(pair)
#define STR_FIELD_(type, name)
#define EXPAND_VAL(x)
#define FOR_EACH_1(M, x)
#define FOR_EACH_2(M, x, ...)
#define FOR_EACH_3(M, x, ...)
#define FOR_EACH_4(M, x, ...)
#define FOR_EACH_5(M, x, ...)
#define FOR_EACH_6(M, x, ...)
#define FOR_EACH_7(M, x, ...)
#define FOR_EACH_8(M, x, ...)
#define FOR_EACH_9(M, x, ...)
#define FOR_EACH_10(M, x, ...)
#define FOR_EACH_11(M, x, ...)
#define FOR_EACH_12(M, x, ...)
#define FOR_EACH_13(M, x, ...)
#define FOR_EACH_14(M, x, ...)
#define FOR_EACH_15(M, x, ...)
#define FOR_EACH_16(M, x, ...)
#define FOR_EACH_17(M, x, ...)
#define FOR_EACH_18(M, x, ...)
#define FOR_EACH_19(M, x, ...)
#define FOR_EACH_20(M, x, ...)
#define FOR_EACH_21(M, x, ...)
#define FOR_EACH_22(M, x, ...)
#define FOR_EACH_23(M, x, ...)
#define FOR_EACH_24(M, x, ...)
#define FOR_EACH_25(M, x, ...)
#define FOR_EACH_26(M, x, ...)
#define FOR_EACH_27(M, x, ...)
#define FOR_EACH_28(M, x, ...)
#define FOR_EACH_29(M, x, ...)
#define FOR_EACH_30(M, x, ...)
#define FOR_EACH_31(M, x, ...)
#define FOR_EACH_32(M, x, ...)
#define FOR_EACH_33(M, x, ...)
#define FOR_EACH_34(M, x, ...)
#define FOR_EACH_35(M, x, ...)
#define FOR_EACH_36(M, x, ...)
#define FOR_EACH_37(M, x, ...)
#define FOR_EACH_38(M, x, ...)
#define FOR_EACH_39(M, x, ...)
#define FOR_EACH_40(M, x, ...)
#define FOR_EACH_41(M, x, ...)
#define FOR_EACH_42(M, x, ...)
#define FOR_EACH_43(M, x, ...)
#define FOR_EACH_44(M, x, ...)
#define FOR_EACH_45(M, x, ...)
#define FOR_EACH_46(M, x, ...)
#define FOR_EACH_47(M, x, ...)
#define FOR_EACH_48(M, x, ...)
#define FOR_EACH_49(M, x, ...)
#define FOR_EACH_50(M, x, ...)
#define GET_FOR_EACH_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, NAME, ...)
#define FOR_EACH(M, ...)
#define TELEMETRY(NAME, APID, SIZE, ...)

Detailed Description

Header for generic telemetry packet struct generation and serialization.

This file defines a macro-based system to simplify the definition and serialization of telemetry packets in C++. It provides an easy and consistent way to define packet structures, serialize them into byte streams (packetize), and reconstruct them (depacketize) while respecting endianness in a robust manner.

Overview

The TELEMETRY(NAME, APID, SIZE, ...) macro expands to a struct named NAME with fields defined by the user. It also adds these methods:

  • void packetize(uint8* out) const;
  • void depacketize(const uint8* in);
  • uint16 apid();
  • uint16 size();

The packetize/depacketize methods serialize and deserialize the fields into/from a binary format. Endianness is handled automatically depending on the IS_BIG_ENDIAN macro.

The apid function returns the apid of the packet

Macros?

C++ does not support variadic field declaration or reflection natively. This macro-based approach allows you to declare telemetry structures with strong typing and automatic serialization logic without writing repetitive boilerplate code.

Example

// Must include a #define IS_BIG_ENDIAN flag that signifies
// the endianness of the native machine. For warpOS this is defined in package/configuration.h
// The TELEMETRY macro expects the following inputs, in the following order:
// 1). Telemetry packet struct name
// 2). First packet struct element
// a). Data type (in parenthesis)
// b). Data name
// 3). Second packet struct element
// a). Data type (in parenthesis)
// b). Data name
// 4). Third packet struct element
// a). Data type (in parenthesis)
// b). Data name
// ...
// ...
// ...
// 11). Tenth packet struct element
// a). Data type (in parenthesis)
// b). Data name
TELEMETRY(MyTelemetryPacket, 100,
((uint8), id),
((uint16), voltage),
((float), temperature),
((double), pressure),
((FixedString<5>), status),
((FixedArray<uint8, 3>), byte_array),
((FixedArray<uint32, 3>), big_array),
((int32), unused)
);
MyTelemetryPacket pkt = {
42, 0x1234, 36.5f, 1013.25, "OK", {0, 122, 255},
{0xAABBCCDD, 0x11223344, 0x55667788}
};
uint8 buffer[sizeof(MyTelemetryPacket)];
pkt.packetize(buffer); // Serialize to buffer
pkt.depacketize(buffer); // Deserialize from buffer
#define TELEMETRY(NAME, APID, SIZE,...)
Definition Telemetry.h:297

Types

  • FixedString<N> is a fixed-size, null-terminated character array wrapper that avoids direct use of char[N], which macro expansion cannot safely handle.
  • FixedArray<T, N> is a fixed-size array wrapper supporting brace-initialization and safe copying.
  • All native types. such as but not limited to, int8, uint8, int16, uint16, int32, uint32, float, and double.

Notes

  • Always initialize all fields explicitly, even if they are unused. Uninitialized fields can result in undefined behavior during serialization.
  • Padding or alignment-sensitive fields should be handled carefully; the unused field can be added to preserve internal layout if needed.
  • The system currently supports up to 50 fields per struct. You can extend the FOR_EACH_n macros if more are required.
  • When telemetering arrays and strings, you must use the FixedString and FixedArray template structures.

Endianness

Endianness is managed at runtime by checking the IS_BIG_ENDIAN macro:

  • IS_BIG_ENDIAN == 1: values are assumed to be in big-endian format.
  • IS_BIG_ENDIAN == 0: values are converted from little-endian to big-endian and back.

All multi-byte fields (e.g., uint16, float, double) are endianness-aware.

See also
FixedString
FixedArray

Macro Definition Documentation

◆ CMD_APID_MAX_ALLOWABLE

#define CMD_APID_MAX_ALLOWABLE   0xB

◆ CMD_APID_MIN_ALLOWABLE

#define CMD_APID_MIN_ALLOWABLE   0x1

◆ CMD_TLM_COMMON

#define CMD_TLM_COMMON ( NAME,
APID,
SIZE,
... )
Value:
struct NAME : public cmd_tlm_base { \
/* mutable to allow modification within the const str() member function */ \
mutable char temp_buf[MAX_TLM_FIELD_CHAR_BUF_SIZE]; \
\
EXPAND_VAL(FOR_EACH(DECLARE_FIELD, __VA_ARGS__)) \
\
uint16 apid() const override { return APID; } \
\
uint16 size() const override { return SIZE; } \
\
void packetize(uint8* out) const override { \
uint8* ptr = out; \
EXPAND_VAL(FOR_EACH(PACKETIZE_FIELD, __VA_ARGS__)) \
} \
\
void depacketize(const uint8* in) override { \
const uint8* ptr = in; \
EXPAND_VAL(FOR_EACH(DEPACKETIZE_FIELD, __VA_ARGS__)) \
} \
\
int16 str(char* output, uint16 size) const override { \
char* ptr = output; \
EXPAND_VAL(FOR_EACH(STR_FIELD, __VA_ARGS__)) \
*(ptr - 1) = '\0'; \
return NO_ERROR; \
} \
};
#define DEPACKETIZE_FIELD(pair)
Definition Telemetry.h:103
#define DECLARE_FIELD(pair)
Definition Telemetry.h:90
#define PACKETIZE_FIELD(pair)
Definition Telemetry.h:94
#define STR_FIELD(pair)
Definition Telemetry.h:113
#define FOR_EACH(M,...)
Definition Telemetry.h:186
#define NO_ERROR
Error code in the case where matrix math executed successfully.
Definition clockwerkerrors.h:34
Base struct in definition of command and telemetry packets.
Definition Telemetry.h:48
virtual uint16 size() const
Definition Telemetry.h:50
virtual void depacketize(const uint8 *out)
Definition Telemetry.h:52
virtual uint16 apid() const
Definition Telemetry.h:49
virtual int16 str(char *output, uint16 size) const
Definition Telemetry.h:53
virtual void packetize(uint8 *out) const
Definition Telemetry.h:51

◆ DECLARE_FIELD

#define DECLARE_FIELD ( pair)
Value:
#define DECLARE_FIELD_(type, name)
Definition Telemetry.h:91

◆ DECLARE_FIELD_

#define DECLARE_FIELD_ ( type,
name )
Value:
STRIP_PARENS(type) name;
#define STRIP_PARENS(X)
Definition Telemetry.h:86

◆ DEPACKETIZE_FIELD

#define DEPACKETIZE_FIELD ( pair)
Value:
#define DEPACKETIZE_FIELD_(type, name)
Definition Telemetry.h:104

◆ DEPACKETIZE_FIELD_

#define DEPACKETIZE_FIELD_ ( type,
name )
Value:
do { \
STRIP_PARENS(type) temp; \
memcpy(&temp, ptr, sizeof(temp)); \
if (sizeof(STRIP_PARENS(type)) > 1 && !IS_BIG_ENDIAN) temp = warpos::changeEndian(temp);\
this->name = temp; \
ptr += sizeof(temp); \
} while (0)
T changeEndian(T in)
Change the endianness of a number.
Definition spacepacketutils.hpp:123

◆ EXPAND_VAL

#define EXPAND_VAL ( x)
Value:
x

◆ FOR_EACH

#define FOR_EACH ( M,
... )
Value:
(M, __VA_ARGS__))
#define FOR_EACH_50(M, x,...)
Definition Telemetry.h:175
#define FOR_EACH_45(M, x,...)
Definition Telemetry.h:170
#define FOR_EACH_19(M, x,...)
Definition Telemetry.h:144
#define FOR_EACH_14(M, x,...)
Definition Telemetry.h:139
#define FOR_EACH_34(M, x,...)
Definition Telemetry.h:159
#define FOR_EACH_36(M, x,...)
Definition Telemetry.h:161
#define FOR_EACH_4(M, x,...)
Definition Telemetry.h:129
#define GET_FOR_EACH_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, NAME,...)
Definition Telemetry.h:178
#define FOR_EACH_18(M, x,...)
Definition Telemetry.h:143
#define FOR_EACH_8(M, x,...)
Definition Telemetry.h:133
#define FOR_EACH_10(M, x,...)
Definition Telemetry.h:135
#define FOR_EACH_7(M, x,...)
Definition Telemetry.h:132
#define FOR_EACH_40(M, x,...)
Definition Telemetry.h:165
#define FOR_EACH_9(M, x,...)
Definition Telemetry.h:134
#define FOR_EACH_49(M, x,...)
Definition Telemetry.h:174
#define FOR_EACH_27(M, x,...)
Definition Telemetry.h:152
#define FOR_EACH_3(M, x,...)
Definition Telemetry.h:128
#define FOR_EACH_23(M, x,...)
Definition Telemetry.h:148
#define FOR_EACH_1(M, x)
Definition Telemetry.h:126
#define FOR_EACH_22(M, x,...)
Definition Telemetry.h:147
#define FOR_EACH_12(M, x,...)
Definition Telemetry.h:137
#define FOR_EACH_32(M, x,...)
Definition Telemetry.h:157
#define FOR_EACH_25(M, x,...)
Definition Telemetry.h:150
#define FOR_EACH_37(M, x,...)
Definition Telemetry.h:162
#define FOR_EACH_21(M, x,...)
Definition Telemetry.h:146
#define FOR_EACH_47(M, x,...)
Definition Telemetry.h:172
#define FOR_EACH_17(M, x,...)
Definition Telemetry.h:142
#define FOR_EACH_48(M, x,...)
Definition Telemetry.h:173
#define FOR_EACH_5(M, x,...)
Definition Telemetry.h:130
#define FOR_EACH_46(M, x,...)
Definition Telemetry.h:171
#define FOR_EACH_13(M, x,...)
Definition Telemetry.h:138
#define FOR_EACH_41(M, x,...)
Definition Telemetry.h:166
#define FOR_EACH_11(M, x,...)
Definition Telemetry.h:136
#define FOR_EACH_44(M, x,...)
Definition Telemetry.h:169
#define FOR_EACH_26(M, x,...)
Definition Telemetry.h:151
#define EXPAND_VAL(x)
Definition Telemetry.h:125
#define FOR_EACH_15(M, x,...)
Definition Telemetry.h:140
#define FOR_EACH_31(M, x,...)
Definition Telemetry.h:156
#define FOR_EACH_33(M, x,...)
Definition Telemetry.h:158
#define FOR_EACH_24(M, x,...)
Definition Telemetry.h:149
#define FOR_EACH_16(M, x,...)
Definition Telemetry.h:141
#define FOR_EACH_43(M, x,...)
Definition Telemetry.h:168
#define FOR_EACH_30(M, x,...)
Definition Telemetry.h:155
#define FOR_EACH_29(M, x,...)
Definition Telemetry.h:154
#define FOR_EACH_6(M, x,...)
Definition Telemetry.h:131
#define FOR_EACH_39(M, x,...)
Definition Telemetry.h:164
#define FOR_EACH_20(M, x,...)
Definition Telemetry.h:145
#define FOR_EACH_35(M, x,...)
Definition Telemetry.h:160
#define FOR_EACH_42(M, x,...)
Definition Telemetry.h:167
#define FOR_EACH_28(M, x,...)
Definition Telemetry.h:153
#define FOR_EACH_2(M, x,...)
Definition Telemetry.h:127
#define FOR_EACH_38(M, x,...)
Definition Telemetry.h:163

◆ FOR_EACH_1

#define FOR_EACH_1 ( M,
x )
Value:
M(x);

◆ FOR_EACH_10

#define FOR_EACH_10 ( M,
x,
... )
Value:
M(x); FOR_EACH_9(M, __VA_ARGS__)

◆ FOR_EACH_11

#define FOR_EACH_11 ( M,
x,
... )
Value:
M(x); FOR_EACH_10(M, __VA_ARGS__)

◆ FOR_EACH_12

#define FOR_EACH_12 ( M,
x,
... )
Value:
M(x); FOR_EACH_11(M, __VA_ARGS__)

◆ FOR_EACH_13

#define FOR_EACH_13 ( M,
x,
... )
Value:
M(x); FOR_EACH_12(M, __VA_ARGS__)

◆ FOR_EACH_14

#define FOR_EACH_14 ( M,
x,
... )
Value:
M(x); FOR_EACH_13(M, __VA_ARGS__)

◆ FOR_EACH_15

#define FOR_EACH_15 ( M,
x,
... )
Value:
M(x); FOR_EACH_14(M, __VA_ARGS__)

◆ FOR_EACH_16

#define FOR_EACH_16 ( M,
x,
... )
Value:
M(x); FOR_EACH_15(M, __VA_ARGS__)

◆ FOR_EACH_17

#define FOR_EACH_17 ( M,
x,
... )
Value:
M(x); FOR_EACH_16(M, __VA_ARGS__)

◆ FOR_EACH_18

#define FOR_EACH_18 ( M,
x,
... )
Value:
M(x); FOR_EACH_17(M, __VA_ARGS__)

◆ FOR_EACH_19

#define FOR_EACH_19 ( M,
x,
... )
Value:
M(x); FOR_EACH_18(M, __VA_ARGS__)

◆ FOR_EACH_2

#define FOR_EACH_2 ( M,
x,
... )
Value:
M(x); FOR_EACH_1(M, __VA_ARGS__)

◆ FOR_EACH_20

#define FOR_EACH_20 ( M,
x,
... )
Value:
M(x); FOR_EACH_19(M, __VA_ARGS__)

◆ FOR_EACH_21

#define FOR_EACH_21 ( M,
x,
... )
Value:
M(x); FOR_EACH_20(M, __VA_ARGS__)

◆ FOR_EACH_22

#define FOR_EACH_22 ( M,
x,
... )
Value:
M(x); FOR_EACH_21(M, __VA_ARGS__)

◆ FOR_EACH_23

#define FOR_EACH_23 ( M,
x,
... )
Value:
M(x); FOR_EACH_22(M, __VA_ARGS__)

◆ FOR_EACH_24

#define FOR_EACH_24 ( M,
x,
... )
Value:
M(x); FOR_EACH_23(M, __VA_ARGS__)

◆ FOR_EACH_25

#define FOR_EACH_25 ( M,
x,
... )
Value:
M(x); FOR_EACH_24(M, __VA_ARGS__)

◆ FOR_EACH_26

#define FOR_EACH_26 ( M,
x,
... )
Value:
M(x); FOR_EACH_25(M, __VA_ARGS__)

◆ FOR_EACH_27

#define FOR_EACH_27 ( M,
x,
... )
Value:
M(x); FOR_EACH_26(M, __VA_ARGS__)

◆ FOR_EACH_28

#define FOR_EACH_28 ( M,
x,
... )
Value:
M(x); FOR_EACH_27(M, __VA_ARGS__)

◆ FOR_EACH_29

#define FOR_EACH_29 ( M,
x,
... )
Value:
M(x); FOR_EACH_28(M, __VA_ARGS__)

◆ FOR_EACH_3

#define FOR_EACH_3 ( M,
x,
... )
Value:
M(x); FOR_EACH_2(M, __VA_ARGS__)

◆ FOR_EACH_30

#define FOR_EACH_30 ( M,
x,
... )
Value:
M(x); FOR_EACH_29(M, __VA_ARGS__)

◆ FOR_EACH_31

#define FOR_EACH_31 ( M,
x,
... )
Value:
M(x); FOR_EACH_30(M, __VA_ARGS__)

◆ FOR_EACH_32

#define FOR_EACH_32 ( M,
x,
... )
Value:
M(x); FOR_EACH_31(M, __VA_ARGS__)

◆ FOR_EACH_33

#define FOR_EACH_33 ( M,
x,
... )
Value:
M(x); FOR_EACH_32(M, __VA_ARGS__)

◆ FOR_EACH_34

#define FOR_EACH_34 ( M,
x,
... )
Value:
M(x); FOR_EACH_33(M, __VA_ARGS__)

◆ FOR_EACH_35

#define FOR_EACH_35 ( M,
x,
... )
Value:
M(x); FOR_EACH_34(M, __VA_ARGS__)

◆ FOR_EACH_36

#define FOR_EACH_36 ( M,
x,
... )
Value:
M(x); FOR_EACH_35(M, __VA_ARGS__)

◆ FOR_EACH_37

#define FOR_EACH_37 ( M,
x,
... )
Value:
M(x); FOR_EACH_36(M, __VA_ARGS__)

◆ FOR_EACH_38

#define FOR_EACH_38 ( M,
x,
... )
Value:
M(x); FOR_EACH_37(M, __VA_ARGS__)

◆ FOR_EACH_39

#define FOR_EACH_39 ( M,
x,
... )
Value:
M(x); FOR_EACH_38(M, __VA_ARGS__)

◆ FOR_EACH_4

#define FOR_EACH_4 ( M,
x,
... )
Value:
M(x); FOR_EACH_3(M, __VA_ARGS__)

◆ FOR_EACH_40

#define FOR_EACH_40 ( M,
x,
... )
Value:
M(x); FOR_EACH_39(M, __VA_ARGS__)

◆ FOR_EACH_41

#define FOR_EACH_41 ( M,
x,
... )
Value:
M(x); FOR_EACH_40(M, __VA_ARGS__)

◆ FOR_EACH_42

#define FOR_EACH_42 ( M,
x,
... )
Value:
M(x); FOR_EACH_41(M, __VA_ARGS__)

◆ FOR_EACH_43

#define FOR_EACH_43 ( M,
x,
... )
Value:
M(x); FOR_EACH_42(M, __VA_ARGS__)

◆ FOR_EACH_44

#define FOR_EACH_44 ( M,
x,
... )
Value:
M(x); FOR_EACH_43(M, __VA_ARGS__)

◆ FOR_EACH_45

#define FOR_EACH_45 ( M,
x,
... )
Value:
M(x); FOR_EACH_44(M, __VA_ARGS__)

◆ FOR_EACH_46

#define FOR_EACH_46 ( M,
x,
... )
Value:
M(x); FOR_EACH_45(M, __VA_ARGS__)

◆ FOR_EACH_47

#define FOR_EACH_47 ( M,
x,
... )
Value:
M(x); FOR_EACH_46(M, __VA_ARGS__)

◆ FOR_EACH_48

#define FOR_EACH_48 ( M,
x,
... )
Value:
M(x); FOR_EACH_47(M, __VA_ARGS__)

◆ FOR_EACH_49

#define FOR_EACH_49 ( M,
x,
... )
Value:
M(x); FOR_EACH_48(M, __VA_ARGS__)

◆ FOR_EACH_5

#define FOR_EACH_5 ( M,
x,
... )
Value:
M(x); FOR_EACH_4(M, __VA_ARGS__)

◆ FOR_EACH_50

#define FOR_EACH_50 ( M,
x,
... )
Value:
M(x); FOR_EACH_49(M, __VA_ARGS__)

◆ FOR_EACH_6

#define FOR_EACH_6 ( M,
x,
... )
Value:
M(x); FOR_EACH_5(M, __VA_ARGS__)

◆ FOR_EACH_7

#define FOR_EACH_7 ( M,
x,
... )
Value:
M(x); FOR_EACH_6(M, __VA_ARGS__)

◆ FOR_EACH_8

#define FOR_EACH_8 ( M,
x,
... )
Value:
M(x); FOR_EACH_7(M, __VA_ARGS__)

◆ FOR_EACH_9

#define FOR_EACH_9 ( M,
x,
... )
Value:
M(x); FOR_EACH_8(M, __VA_ARGS__)

◆ GET_FOR_EACH_MACRO

#define GET_FOR_EACH_MACRO ( _1,
_2,
_3,
_4,
_5,
_6,
_7,
_8,
_9,
_10,
_11,
_12,
_13,
_14,
_15,
_16,
_17,
_18,
_19,
_20,
_21,
_22,
_23,
_24,
_25,
_26,
_27,
_28,
_29,
_30,
_31,
_32,
_33,
_34,
_35,
_36,
_37,
_38,
_39,
_40,
_41,
_42,
_43,
_44,
_45,
_46,
_47,
_48,
_49,
_50,
NAME,
... )
Value:
NAME

◆ PACKETIZE_FIELD

#define PACKETIZE_FIELD ( pair)
Value:
#define PACKETIZE_FIELD_(type, name)
Definition Telemetry.h:95

◆ PACKETIZE_FIELD_

#define PACKETIZE_FIELD_ ( type,
name )
Value:
do { \
STRIP_PARENS(type) temp = this->name; \
if (sizeof(STRIP_PARENS(type)) > 1 && !IS_BIG_ENDIAN) temp = warpos::changeEndian(temp);\
memcpy(ptr, &temp, sizeof(temp)); \
ptr += sizeof(temp); \
} while (0)

◆ STR_FIELD

#define STR_FIELD ( pair)
Value:
#define STR_FIELD_(type, name)
Definition Telemetry.h:114

◆ STR_FIELD_

#define STR_FIELD_ ( type,
name )
Value:
do { \
int16 status = clockwerk::numberToString(this->name, temp_buf, sizeof(temp_buf)); \
if (status != NO_ERROR) return status; \
size_t len = strlen(temp_buf); \
if ((size_t)(ptr - output) + len + 2 > size) return ERROR_DIMENSIONS; /* not enough space */\
memcpy(ptr, temp_buf, len); \
ptr += len; \
*ptr++ = ','; \
} while (0)
#define ERROR_DIMENSIONS
Definition clockwerkerrors.h:41
int16 numberToString(int64 num, char *out, size_t out_size)
Definition stringutils.cpp:156

◆ STRIP_PARENS

#define STRIP_PARENS ( X)
Value:
#define STRIP_PARENS_IMPL(...)
Definition Telemetry.h:87

◆ STRIP_PARENS_IMPL

#define STRIP_PARENS_IMPL ( ...)
Value:
__VA_ARGS__

◆ TELEMETRY

#define TELEMETRY ( NAME,
APID,
SIZE,
... )
Value:
static_assert(((APID) & 0x00F) >= TLM_APID_MIN_ALLOWABLE && ((APID) & 0x00F) <= TLM_APID_MAX_ALLOWABLE, \
"Creating TLM NAME failed. APID must be between TLM_APID_MIN_ALLOWABLE and TLM_APID_MAX_ALLOWABLE"); \
static_assert(SIZE <= CMD_TLM_PKT_MAX_SIZE_BYTES, "Creating TLM NAME failed. SIZE must be <=> configuration/CMD_TLM_PKT_MAX_SIZE_BYTES");\
CMD_TLM_COMMON(NAME, APID, SIZE, __VA_ARGS__)
#define TLM_APID_MAX_ALLOWABLE
Definition Telemetry.h:39
#define TLM_APID_MIN_ALLOWABLE
Definition Telemetry.h:37

◆ TLM_APID_MAX_ALLOWABLE

#define TLM_APID_MAX_ALLOWABLE   0xF

◆ TLM_APID_MIN_ALLOWABLE

#define TLM_APID_MIN_ALLOWABLE   0xC