KymoCore/Documentation
v8.0.0 Stable⌄
Versions8.0.0 Current
GitHub ↗
KYMOCORE / API REFERENCE

kymo_data_flags.h File Reference

API contracts in their original English. Navigation and guides are bilingual.

Shared data field selectors, without encoding or transport interfaces. More...

#include "../../kymo_types.h"
#include "../../binary/embedded_bits.h"

Go to the source code of this file.

Macros

#define KYMO_FLAG_X   0x08u
 Descriptor bit indicating a four-byte X coordinate.
#define KYMO_FLAG_Z   0x04u
 Descriptor bit indicating a four-byte Z coordinate.
#define KYMO_FLAG_TIMESTAMP   0x02u
 Descriptor bit indicating relative uint32 milliseconds.
#define KYMO_FLAG_TIMESTAMP_US   0x10u
 Descriptor bit selecting microseconds for the timestamp field.
#define KYMO_ALLOWED_FLAGS   EMB_U8_OR(KYMO_FLAG_X, EMB_U8_OR(KYMO_FLAG_Z, KYMO_FLAG_TIMESTAMP))
 Mask of every supported optional payload field.
#define KYMO_SUPPORTED_FLAGS
 Payload flags compiled into this library build.
#define KYMO_CODEC_FLAGS   EMB_U8_OR(KYMO_SUPPORTED_FLAGS, (KYMO_ENABLE_TIMESTAMP ? KYMO_FLAG_TIMESTAMP_US : 0u))
 Flags accepted by the raw codec of this library build.
#define KYMO_FRAME_MIN_SIZE   9u
 Size in bytes of a Y-only frame.
#define KYMO_FRAME_MAX_SIZE   21u
 Maximum complete-frame size in bytes.

Detailed Description

Shared data field selectors, without encoding or transport interfaces.

Definition in file kymo_data_flags.h.

Macro Definition Documentation

◆ KYMO_ALLOWED_FLAGS

#define KYMO_ALLOWED_FLAGS   EMB_U8_OR(KYMO_FLAG_X, EMB_U8_OR(KYMO_FLAG_Z, KYMO_FLAG_TIMESTAMP))

Mask of every supported optional payload field.

Only X, Z and timestamp flags are permitted on the wire. Build-time feature switches further restrict usable combinations through KYMO_SUPPORTED_FLAGS.

Usage
Use for XYZ with timestamps or to validate a supplied flag byte.

Definition at line 59 of file kymo_data_flags.h.

◆ KYMO_CODEC_FLAGS

#define KYMO_CODEC_FLAGS   EMB_U8_OR(KYMO_SUPPORTED_FLAGS, (KYMO_ENABLE_TIMESTAMP ? KYMO_FLAG_TIMESTAMP_US : 0u))

Flags accepted by the raw codec of this library build.

KYMO_SUPPORTED_FLAGS plus KYMO_FLAG_TIMESTAMP_US when timestamps are enabled.

Usage
Validate KymoDataPoint::flags before KymoProtocol_encode.

Definition at line 79 of file kymo_data_flags.h.

◆ KYMO_FLAG_TIMESTAMP

#define KYMO_FLAG_TIMESTAMP   0x02u

Descriptor bit indicating relative uint32 milliseconds.

Adds four bytes after all coordinates. The counter wraps modulo 2^32; the app converts it to seconds.

Usage
Set on a channel to include time relative to KymoRuntime_init.

Definition at line 35 of file kymo_data_flags.h.

◆ KYMO_FLAG_TIMESTAMP_US

#define KYMO_FLAG_TIMESTAMP_US   0x10u

Descriptor bit selecting microseconds for the timestamp field.

Occupies message-type bit 4 (data type 01). Valid only together with KYMO_FLAG_TIMESTAMP; the frame layout and length are unchanged, but KymoDataPoint::timestamp_ms then carries uint32 microseconds (wraps after about 71.6 minutes). Not part of KYMO_ALLOWED_FLAGS: the channel runtimes supply millisecond clocks and reject it. Use it with KymoProtocol_encode only.

Usage
point.flags = KYMO_FLAG_TIMESTAMP | KYMO_FLAG_TIMESTAMP_US; point.timestamp_ms = micros_since_epoch;

Definition at line 49 of file kymo_data_flags.h.

◆ KYMO_FLAG_X

#define KYMO_FLAG_X   0x08u

Descriptor bit indicating a four-byte X coordinate.

Adds one finite binary32 value before the mandatory Y/value field.

Usage
Set in KymoChannel::flags or KymoDataPoint::flags for XY or XYZ measurements.

Definition at line 17 of file kymo_data_flags.h.

◆ KYMO_FLAG_Z

#define KYMO_FLAG_Z   0x04u

Descriptor bit indicating a four-byte Z coordinate.

Adds a finite binary32 value after Y. Z can also be used without X.

Usage
Combine with KYMO_FLAG_X for three-dimensional measurements.

Definition at line 26 of file kymo_data_flags.h.

◆ KYMO_FRAME_MAX_SIZE

#define KYMO_FRAME_MAX_SIZE   21u

Maximum complete-frame size in bytes.

Includes X, Y, Z, timestamp and framing. A single buffer of this size supports all flag combinations.

Usage
Declare uint8_t frame[KYMO_FRAME_MAX_SIZE].

Definition at line 98 of file kymo_data_flags.h.

◆ KYMO_FRAME_MIN_SIZE

#define KYMO_FRAME_MIN_SIZE   9u

Size in bytes of a Y-only frame.

Two sync bytes, descriptor, channel, binary32 Y and CRC/zero trailer.

Usage
Minimum complete-frame bound for decoding.

Definition at line 89 of file kymo_data_flags.h.

◆ KYMO_SUPPORTED_FLAGS

#define KYMO_SUPPORTED_FLAGS
Value:
EMB_U8_OR((KYMO_ENABLE_X ? KYMO_FLAG_X : 0u), \
EMB_U8_OR((KYMO_ENABLE_Z ? KYMO_FLAG_Z : 0u), \
#define KYMO_ENABLE_X
Include X coordinates in the wire payload; on in the XYZ and TRACE profiles.
#define KYMO_ENABLE_Z
Include Z coordinates in the wire payload; on in the XYZ and TRACE profiles.
#define KYMO_ENABLE_TIMESTAMP
Include timestamps in DATA frames; on in the XYZ and TRACE profiles.
#define KYMO_FLAG_X
Descriptor bit indicating a four-byte X coordinate.
#define KYMO_FLAG_TIMESTAMP
Descriptor bit indicating relative uint32 milliseconds.
#define KYMO_FLAG_Z
Descriptor bit indicating a four-byte Z coordinate.

Payload flags compiled into this library build.

Wire constants remain unchanged; requests outside this mask fail. Zero selects the default scalar-only build. No fields are silently removed.

Usage
Validate application channel flags against KYMO_SUPPORTED_FLAGS.

Definition at line 68 of file kymo_data_flags.h.