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

◆ sendUpdate()

void fl::ResponseSend::sendUpdate ( const fl::json & update)
inline

Send intermediate streaming update (for ASYNC_STREAM mode)

Parameters
updateThe update payload (any JSON value)

Creates a JSON-RPC response with "update" marker: {"jsonrpc": "2.0", "result": {"update": <update>}, "id": <requestId>}

Definition at line 88 of file response_send.h.

88 {
89 if (!mResponseSink || mIsFinal) {
90 return;
91 }
92
93 fl::json response = fl::json::object();
94 response.set("jsonrpc", "2.0");
95
96 fl::json result = fl::json::object();
97 result.set("update", update);
98
99 response.set("result", result);
100 response.set("id", mRequestId);
101
102 mResponseSink(response);
103 }
fl::function< void(const fl::json &)> mResponseSink
static json object() FL_NOEXCEPT
Definition json.h:692
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31

References mIsFinal, mRequestId, mResponseSink, and fl::json::object().

Referenced by setup().

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