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
119 embed_bool has_alias;
121 embed_bool has_timestamp;
129 embed_bool bool_value;
130 const char *string_value;
136 embed_bool has_timestamp;
147 embed_bool has_alias;
149 embed_bool has_timestamp;
152 embed_bool has_value;
158 embed_bool bool_value;
159 const char *string_value;
160 size_t string_value_len;
166 const char *group_id;
167 const char *message_type;
168 const char *edge_node_id;
169 const char *device_id;
196 const SpbMetric *list;
238 SpbTopicOutArgs topic_out;
240 SpbPayloadArgs payload;
241 SpbMetricsArgs metrics;
242 SpbSourceArgs source;
245 SpbPayloadHeader header;
246 SpbMetricDecoded metric;
247 const uint8_t *metric_bytes;
252extern SparkplugVars SparkplugV;
257 void (*
const build_topic)(
const uint8_t *work);
258 void (*
const build_metric)(
const uint8_t *work);
259 void (*
const build_payload)(uint8_t *work);
260 void (*
const parse_payload)(
const uint8_t *work);
261 void (*
const next_metric)(
const uint8_t *work);
262 void (*
const parse_metric)(
const uint8_t *work);
267void protocore_sparkplug_build_topic(
const uint8_t *work);
268void protocore_sparkplug_build_metric(
const uint8_t *work);
269void protocore_sparkplug_build_payload(uint8_t *work);
270void protocore_sparkplug_parse_payload(
const uint8_t *work);
271void protocore_sparkplug_next_metric(
const uint8_t *work);
272void protocore_sparkplug_parse_metric(
const uint8_t *work);
278static const SparkplugNs Sparkplug __attribute__((unused)) = {
279 .build_topic = protocore_sparkplug_build_topic,
280 .build_metric = protocore_sparkplug_build_metric,
281 .build_payload = protocore_sparkplug_build_payload,
282 .parse_payload = protocore_sparkplug_parse_payload,
283 .next_metric = protocore_sparkplug_next_metric,
284 .parse_metric = protocore_sparkplug_parse_metric,
296uint8_t *protocore_sparkplug_span(
void);
EMBED_ENUM_BYTE(ProtoConn, PROTO_NONE=0, PROTO_HTTP=1, PROTO_TELNET=2, PROTO_SSH=3, PROTO_MODBUS=4, PROTO_OPCUA=5, PROTO_SSH_RFWD=6, PROTO_RELAY=7, PROTO_BRIDGE=8, PROTO_NTRIP_CASTER=9, PROTO_MESH=10, PROTO_UDP=11,)
Application protocol spoken on a listener port or connection slot.