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

◆ sendAsyncStreamRequest()

void sendAsyncStreamRequest ( )

Definition at line 171 of file RpcClient.ino.

171 {
172 Serial.println("=== Testing ASYNC_STREAM mode: streamData(5) ===");
173
174 // Create JSON-RPC request
175 fl::json request;
176 request["jsonrpc"] = "2.0";
177 request["method"] = "streamData";
178 fl::json params;
179 params.push_back(5); // Request 5 updates
180 request["params"] = params;
181 request["id"] = requestId;
182
184 waitingForResponse = true;
185
186 transport->writeResponse(request);
187
188 fl::printf("Sent request ID %d: streamData(5)\n", expectedRequestId);
189 Serial.println("Expecting ACK, then 5 updates, then final result...");
190}
int requestId
bool waitingForResponse
int expectedRequestId
Definition RpcClient.ino:62
fl::unique_ptr< fl::net::http::HttpStreamClient > transport
Definition RpcClient.ino:42
void push_back(const json &value) FL_NOEXCEPT
Definition json.h:745
void printf(const char *format, const Args &... args) FL_NOEXCEPT
Printf-like formatting function that prints directly to the platform output.
Definition stdio.h:635
#define Serial
Definition serial.h:304

References expectedRequestId, fl::printf(), fl::json::push_back(), requestId, Serial, transport, and waitingForResponse.

Referenced by loop().

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