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

◆ createSerialResponseSink()

fl::function< void(const fl::json &)> fl::createSerialResponseSink ( const char * prefix = "REMOTE: ")
inline

Create a JSON-RPC ResponseSink that writes to fl:: serial output.

Parameters
prefixOptional prefix to prepend to responses (default: "REMOTE: ")
Returns
ResponseSink callback suitable for fl::Remote constructor
Note
Composes protocol layer (schema filtering) with transport layer (serial I/O)

Definition at line 162 of file serial.h.

162 : ") {
163 return [prefix](const fl::json& response) {
164 // Format and write to serial (no filtering needed - protocol uses flat structure)
165 SerialWriter serial;
166 fl::string formatted = formatJsonResponse(response, prefix);
167 writeSerialLine(serial, formatted);
168 };
169}

References formatJsonResponse(), and writeSerialLine().

Referenced by autoResearchLowMemorySetup(), and createSerialTransport().

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