MCPcopy Create free account
hub / github.com/FastLED/FastLED / printStreamRaw

Function printStreamRaw

examples/AutoResearch/AutoResearchRemote.cpp:61–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void printStreamRaw(const char* messageType, const fl::json& data) {
62 // Build pure JSONL message: RESULT: {"type":"...", ...data}
63 fl::json output = fl::json::object();
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}
78
79// ============================================================================
80// Standard JSON-RPC Response Format (Phase 4 Refactoring)

Callers

nothing calls this directly

Calls 7

formatJsonResponseFunction · 0.85
printlnFunction · 0.50
setMethod · 0.45
is_objectMethod · 0.45
keysMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected