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

Method sendStreamUpdate

src/fl/remote/remote.cpp.hpp:58–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58void Remote::sendStreamUpdate(const char* method, const fl::json& update) {
59 fl::string methodName(method);
60 auto it = mAsyncRequests.find(methodName);
61 if (it == mAsyncRequests.end()) {
62 FL_WARN("No pending async request for method: " << method);
63 return;
64 }
65
66 int requestId = it->second.requestId;
67 // Don't erase - stream is still active
68
69 // Build JSON-RPC response with "update" marker
70 fl::json response = fl::json::object();
71 response.set("jsonrpc", "2.0");
72 response.set("id", requestId);
73
74 fl::json resultObj = fl::json::object();
75 resultObj.set("update", update);
76 response.set("result", resultObj);
77
78 // Send via response sink
79 if (mResponseSink) {
80 mResponseSink(response);
81 FL_DBG("Sent stream update for " << method << " (id=" << requestId << ")");
82 }
83}
84
85void Remote::sendStreamFinal(const char* method, const fl::json& result) {
86 fl::string methodName(method);

Callers

nothing calls this directly

Calls 3

findMethod · 0.45
endMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected