Files
iot_skeleton/esp32/main/protocol.h
2026-04-12 21:25:01 +03:00

36 lines
660 B
C

#pragma once
#include <stdint.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
int build_telemetry_single(
char* buf,
size_t buf_size,
const char* id,
const char* device_id,
int64_t ts_ms,
const char* metric,
double value,
const char* unit, // optional (NULL)
const char* source, // optional (NULL)
int64_t m_ts_ms // optional (0 = нет)
);
int build_event(
char* buf,
size_t buf_size,
const char* id,
const char* device_id,
int64_t ts_ms,
const char* name,
const char* severity, // optional
const char* message // optional
);
#ifdef __cplusplus
}
#endif