45#ifndef PROTOCORE_SPARKPLUG_H
46#define PROTOCORE_SPARKPLUG_H
50#if PROTOCORE_ENABLE_SPARKPLUG
55#define SPB_NAMESPACE "spBv1.0"
58#define SPB_MSG_NBIRTH "NBIRTH"
59#define SPB_MSG_NDEATH "NDEATH"
60#define SPB_MSG_DBIRTH "DBIRTH"
61#define SPB_MSG_DDEATH "DDEATH"
62#define SPB_MSG_NDATA "NDATA"
63#define SPB_MSG_DDATA "DDATA"
64#define SPB_MSG_NCMD "NCMD"
65#define SPB_MSG_DCMD "DCMD"
66#define SPB_MSG_STATE "STATE"
69#define SPB_DT_UNKNOWN 0
75#define SPB_DT_UINT16 6
76#define SPB_DT_UINT32 7
77#define SPB_DT_UINT64 8
79#define SPB_DT_DOUBLE 10
80#define SPB_DT_BOOLEAN 11
81#define SPB_DT_STRING 12
82#define SPB_DT_DATETIME 13
85#define SPB_DT_DATASET 16
86#define SPB_DT_BYTES 17
88#define SPB_DT_TEMPLATE 19
89#define SPB_DT_PROPERTYSET 20
90#define SPB_DT_PROPERTYSETLIST 21
91#define SPB_DT_INT8_ARRAY 22
92#define SPB_DT_INT16_ARRAY 23
93#define SPB_DT_INT32_ARRAY 24
94#define SPB_DT_INT64_ARRAY 25
95#define SPB_DT_UINT8_ARRAY 26
96#define SPB_DT_UINT16_ARRAY 27
97#define SPB_DT_UINT32_ARRAY 28
98#define SPB_DT_UINT64_ARRAY 29
99#define SPB_DT_FLOAT_ARRAY 30
100#define SPB_DT_DOUBLE_ARRAY 31
101#define SPB_DT_BOOLEAN_ARRAY 32
102#define SPB_DT_STRING_ARRAY 33
103#define SPB_DT_DATETIME_ARRAY 34
131 const char *string_value;
160 const char *string_value;
161 size_t string_value_len;
167 const char *group_id;
168 const char *message_type;
169 const char *edge_node_id;
170 const char *device_id;
197 const SpbMetric *list;
239 SpbTopicOutArgs topic_out;
241 SpbPayloadArgs payload;
242 SpbMetricsArgs metrics;
243 SpbSourceArgs source;
246 SpbPayloadHeader header;
247 SpbMetricDecoded metric;
248 const uint8_t *metric_bytes;
253extern SparkplugVars SparkplugV;
258 void (*
const build_topic)(uint8_t *work);
259 void (*
const build_metric)(uint8_t *work);
260 void (*
const build_payload)(uint8_t *work);
261 void (*
const parse_payload)(uint8_t *work);
262 void (*
const next_metric)(uint8_t *work);
263 void (*
const parse_metric)(uint8_t *work);
268void protocore_sparkplug_build_topic(uint8_t *work);
269void protocore_sparkplug_build_metric(uint8_t *work);
270void protocore_sparkplug_build_payload(uint8_t *work);
271void protocore_sparkplug_parse_payload(uint8_t *work);
272void protocore_sparkplug_next_metric(uint8_t *work);
273void protocore_sparkplug_parse_metric(uint8_t *work);
279static const SparkplugNs Sparkplug __attribute__((unused)) = {
280 .build_topic = protocore_sparkplug_build_topic,
281 .build_metric = protocore_sparkplug_build_metric,
282 .build_payload = protocore_sparkplug_build_payload,
283 .parse_payload = protocore_sparkplug_parse_payload,
284 .next_metric = protocore_sparkplug_next_metric,
285 .parse_metric = protocore_sparkplug_parse_metric,
297uint8_t *protocore_sparkplug_span(
void);
PROTO_ENUM_PACKED
Application protocol spoken on a listener port or connection slot.
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS