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

◆ send()

void fl::ResponseSend::send ( const fl::json & result)
inline

Send a single response (for ASYNC mode)

Parameters
resultThe result payload (any JSON value)

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

Definition at line 68 of file response_send.h.

68 {
69 if (!mResponseSink || mIsFinal) {
70 return;
71 }
72
73 fl::json response = fl::json::object();
74 response.set("jsonrpc", "2.0");
75 response.set("result", result);
76 response.set("id", mRequestId);
77
78 mResponseSink(response);
79 }
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, fl::json::object(), and send().

Referenced by send(), and setup().

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