FastLED 3.9.15
Loading...
Searching...
No Matches
serial.h File Reference
#include "fl/stl/json.h"
#include "fl/system/delay.h"
#include "fl/stl/int.h"
#include "fl/stl/cctype.h"
#include "fl/stl/chrono.h"
#include "fl/stl/cstdio.h"
#include "fl/stl/cstring.h"
#include "fl/stl/function.h"
#include "fl/stl/optional.h"
#include "fl/stl/pair.h"
#include "fl/stl/string.h"
#include "fl/stl/strstream.h"
#include "fl/stl/string_view.h"
+ Include dependency graph for serial.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fl::SerialReader
 Serial adapter using fl:: input functions (fl::available, fl::read) More...
 
struct  fl::SerialWriter
 Serial adapter using fl:: output functions (fl::println) More...
 

Namespaces

namespace  fl
 Base definition for an LED controller.
 

Functions

fl::function< fl::optional< fl::json >()> fl::createSerialRequestSource (const char *prefix="")
 Create a JSON-RPC RequestSource that reads from fl:: serial input.
 
fl::function< void(const fl::json &)> fl::createSerialResponseSink (const char *prefix="REMOTE: ")
 Create a JSON-RPC ResponseSink that writes to fl:: serial output.
 
fl::pair< fl::function< fl::optional< fl::json >()>, fl::function< void(const fl::json &)> > fl::createSerialTransport (const char *responsePrefix="REMOTE: ", const char *requestPrefix="")
 Create RequestSource and ResponseSink pair for serial I/O.
 
fl::string fl::formatJsonResponse (const fl::json &response, const char *prefix="")
 Serialize JSON response to a string.
 
template<typename SerialIn>
fl::optional< fl::stringfl::readSerialLine (SerialIn &serial, char delimiter='\n', fl::optional< u32 > timeoutMs=fl::nullopt)
 Read a line from a serial-like input source (blocking with optional timeout)
 
fl::optional< fl::stringfl::readSerialLine (SerialReader &serial, char delimiter='\n', fl::optional< u32 > timeoutMs=fl::nullopt)
 Optimized readSerialLine for fl:: serial input.
 
template<typename SerialIn>
fl::optional< fl::stringfl::readSerialStringUntil (SerialIn &serial, char delimiter, char skipChar, fl::optional< u32 > timeoutMs)
 
template<typename SerialOut>
void fl::writeSerialLine (SerialOut &serial, const fl::string &str)
 Write a string with newline to a serial-like output.