FastLED 3.9.15
Loading...
Searching...
No Matches

◆ printStreamRaw()

void printStreamRaw ( const char * messageType,
const fl::json & data )

Print JSONL stream message directly to Serial, bypassing fl::println.

Parameters
messageTypeType of message (e.g., "test_result", "config_complete")
dataJSON object containing message data

Definition at line 61 of file AutoResearchRemote.cpp.

61 {
62 // Build pure JSONL message: RESULT: {"type":"...", ...data}
64 output.set("type", messageType);
65
66 // Copy all fields from data into output
67 if (data.is_object()) {
68 auto keys = data.keys();
69 for (fl::size i = 0; i < keys.size(); i++) {
70 output.set(keys[i].c_str(), data[keys[i]]);
71 }
72 }
73
74 // Use fl:: serial transport for consistent formatting
75 fl::string formatted = fl::formatJsonResponse(output, "RESULT: ");
76 fl::println(formatted.c_str());
77}
const char * c_str() const FL_NOEXCEPT
bool is_object() const FL_NOEXCEPT
Definition json.h:248
fl::vector< fl::string > keys() const FL_NOEXCEPT
Definition json.h:522
static json object() FL_NOEXCEPT
Definition json.h:692
fl::string formatJsonResponse(const fl::json &response, const char *prefix)
Serialize JSON response to a string.
void println(const char *str) FL_NOEXCEPT

References fl::basic_string::c_str(), fl::formatJsonResponse(), fl::json::is_object(), fl::json::keys(), fl::json::object(), and fl::println().

Referenced by loop(), and setup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: