LambLisp 01 Red Fox Alpha
From AI to Actuator
Loading...
Searching...
No Matches
LambStdioClass Class Reference

Public Member Functions

int setTxBufferSize (int n)
int setRxBufferSize (int n)
bool set_input_callback (void(*cb)())
void begin (void)
void begin (unsigned long baudrate)
void end ()
int available (void)
int availableForWrite (void)
int read (void)
int write (uint8_t c)
int write (char c)
void flush (void)
int read (byte *buf, int max)
int read (char *s, int max)
int write (const char *s, int n)
int write (const byte *b, size_t n)
int write (const char *s)
 operator bool ()

Detailed Description

A wrapper around the underlying stdin/stdout implementation. On an embedded system, this class will use the primary serial in/out (Serial on Arduino-compatibles). On Linux, this class will set the terminal to byte-at-a-time mode (called "non-CANONICAL" mode).

Member Function Documentation

◆ set_input_callback()

bool LambStdioClass::set_input_callback ( void(* cb )())

register a callback the TRANSPORT invokes when input arrives, so the console can be drained by something other than the reader. This belongs on the SHIM, not at the call site: LL_Term talks to LambStdioClass and nothing else, and onReceive is a HardwareSerial method that the shim does not inherit – calling it through LambStdio compiles nowhere. Returns true if the transport supports it. POSIX returns false and the caller keeps its existing reader-driven path, which is correct there: stdin is already buffered by libc.