Create a JSON-RPC RequestSource that reads from fl:: serial input.
- Parameters
-
| prefix | Optional prefix to strip from input lines (default: "") |
- Returns
- RequestSource callback suitable for fl::Remote constructor
- Note
- Composes transport layer (serial I/O) with protocol layer (JSON-RPC normalization)
Example:
fl::unique_ptr< fl::Remote > remote
JSON-RPC server with scheduling support.
fl::function< void(const fl::json &)> createSerialResponseSink(const char *prefix="REMOTE: ") FL_NO_EXCEPT
Create a JSON-RPC ResponseSink that writes to fl:: serial output.
fl::function< fl::optional< fl::json >()> createSerialRequestSource(const char *prefix="") FL_NO_EXCEPT
Lines at least this long are reported when discarded. Below it, a non-JSON line is ordinary serial noise; above it, it is more likely a request that lost bytes on the way in.
Definition at line 117 of file serial.h.
Referenced by createSerialRequestSource().