#pragma once #include "cJSON.h" #include struct ProtocolMessage { int v; std::string id; std::string type; uint64_t ts; std::string deviceId; // C++ строка cJSON* payload; }; // Создание JSON из структуры cJSON* protocol_message_to_json(const ProtocolMessage *msg); // Разбор JSON в структуру int protocol_json_to_message(const char *json_str, ProtocolMessage *msg);