Arduino Stream API for a modem (encoder and decoder): the written characters are modulated to the audio output and the audio input is demodulated into characters that can be read. You can use only the output (transmit only), only the input (receive only) or both.
More...
|
| | BasicModemStream ()=default |
| | BasicModemStream (Print &audio_out) |
| | transmit only
|
| | BasicModemStream (Print &audio_out, Stream &audio_in) |
| | transmit and receive with separate output and input
|
| | BasicModemStream (Stream &audio, audio_tools::RxTxMode mode) |
| void | setOutput (Print &audio_out) |
| | Defines the audio output (transmitter).
|
| void | setInput (Stream &audio_in) |
| | Defines the audio input (receiver).
|
| void | setStatusOutput (Print &out) |
| | Defines the output for the ### CARRIER / ### NOCARRIER messages.
|
| Config | defaultConfig () |
| bool | begin (Config cfg, int rx_buffer_size=256) |
| void | end () |
| size_t | write (uint8_t ch) override |
| size_t | write (const uint8_t *data, size_t len) override |
| void | flush () override |
| | Sends the trailer: call this at the end of a message.
|
| int | available () override |
| int | read () override |
| int | peek () override |
| size_t | readBytes (uint8_t *data, size_t len) |
| | Reads the available data (does not wait for more data).
|
| size_t | readBytes (char *data, size_t len) |
| size_t | update () |
| bool | isCarrier () |
| | true while a carrier is detected
|
| Encoder & | getEncoder () |
| Decoder & | getDecoder () |
template<class Encoder, class Decoder, class Config>
class tinymodem::BasicModemStream< Encoder, Decoder, Config >
Arduino Stream API for a modem (encoder and decoder): the written characters are modulated to the audio output and the audio input is demodulated into characters that can be read. You can use only the output (transmit only), only the input (receive only) or both.
The received data is only processed when you call available(), read(), peek() or update(), so call one of them regularly in your loop(). No decoded data is lost: the input is only read while less than rx_buffer_size bytes are waiting to be read.
- Copyright
- GPLv3