109 bool setMode(
const char* mode,
bool keep_options =
false) {
110 if (mode ==
nullptr)
return false;
142 format = strlen(mode) > 4 && tolower(mode[4]) ==
't'
151 expect_bits =
"11110010ddddddddddddddddddddddddddddddddddddddd";
258 if (tolower(*a++) != tolower(*b++))
return false;
265 if (tolower(*str++) != tolower(*prefix++))
return false;
TinyModem: software audio modems and packets with error correction.
Definition AX25.h:11
DataFormat
Data encoding which is used for the payload of a frame.
Definition ModemConfig.h:13
@ UIC_GROUND
UIC-751-3 ground to train (receive only).
Definition ModemConfig.h:19
@ CALLERID
Bell 202 Caller-ID (SDMF/MDMF, receive only).
Definition ModemConfig.h:17
@ UIC_TRAIN
UIC-751-3 train to ground (receive only).
Definition ModemConfig.h:18
@ BINARY
print the raw data bits as '0'/'1' (receive only)
Definition ModemConfig.h:16
@ ASCII
ASCII 8-N-1 (or 7-N-1).
Definition ModemConfig.h:14
@ BAUDOT
Baudot 5 bit (RTTY, TDD).
Definition ModemConfig.h:15
bool rx_one
receiver: stop after the first carrier was lost
Definition ModemConfig.h:80
int binary_raw_bits
receiver: output n raw bits without framing (0 = disabled)
Definition ModemConfig.h:84
bool auto_carrier
automatically detect the carrier frequency
Definition ModemConfig.h:70
float auto_carrier_threshold
minimum magnitude for the carrier auto detection
Definition ModemConfig.h:72
bool print_filter
receiver: replace non printable characters with '.'
Definition ModemConfig.h:88
int start_bits
number of start bits (-1 = auto)
Definition ModemConfig.h:50
float search_limit
stop searching for a better frame when this confidence was reached
Definition ModemConfig.h:68
float rx_noise
receiver: (testing only) amplitude of added uniform noise
Definition ModemConfig.h:96
float stop_bits
number of stop bits (-1 = auto)
Definition ModemConfig.h:52
bool rx_sync
receiver: synchronize on sync_byte
Definition ModemConfig.h:60
static bool equalsIgnoreCase(const char *a, const char *b)
Definition ModemConfig.h:256
bool setMode(const char *mode, bool keep_options=false)
Definition ModemConfig.h:109
static bool startsWithIgnoreCase(const char *str, const char *prefix)
Definition ModemConfig.h:263
long long sync_byte
sync byte value (-1 = none)
Definition ModemConfig.h:64
bool isResolved() const
true after resolve() was called successfully
Definition ModemConfig.h:235
float space_freq
space frequency in Hz (0 = auto)
Definition ModemConfig.h:44
DataFormat format
data encoding
Definition ModemConfig.h:90
bool invert_start_stop
invert the start and stop bits
Definition ModemConfig.h:54
uint8_t channel
receiver: input channel which is used for the decoding
Definition ModemConfig.h:94
bool isTxSupported() const
Returns true if the selected format supports transmitting.
Definition ModemConfig.h:165
const char * expect_bits
custom expected frame pattern ('0','1','d')
Definition ModemConfig.h:92
float confidence
minimum confidence threshold (signal-to-noise squelch)
Definition ModemConfig.h:66
int autodetect_shift
derived: shift which is used for the carrier auto detection
Definition ModemConfig.h:101
bool inverted
swap the mark and space frequencies
Definition ModemConfig.h:56
ModemConfig()
Definition ModemConfig.h:33
unsigned frameBits() const
number of bits of a frame: start + data + stop bits
Definition ModemConfig.h:230
int data_bits
number of data bits per frame (0 = auto)
Definition ModemConfig.h:48
bool binary_output
receiver: output the data bits as '0'/'1' text
Definition ModemConfig.h:82
int trailer_bits
number of mark bits which are sent after the last frame
Definition ModemConfig.h:78
float volume
transmit amplitude (0.0 - 1.0)
Definition ModemConfig.h:74
bool is_resolved
Definition ModemConfig.h:238
void resetMode()
Definition ModemConfig.h:240
bool baudot_usos
Baudot: unshift on space.
Definition ModemConfig.h:86
float baud_rate
baud rate in bits per second (default: 1200 baud Bell 202)
Definition ModemConfig.h:40
float mark_freq
mark frequency in Hz (0 = auto)
Definition ModemConfig.h:42
bool msb_first
transmit the most significant data bit first
Definition ModemConfig.h:58
int buffer_divisor
Definition ModemConfig.h:99
int tx_sync_bytes
transmitter: number of sync bytes which are sent as preamble
Definition ModemConfig.h:62
int leader_bits
number of mark bits which are sent before the first frame
Definition ModemConfig.h:76
bool resolve()
Definition ModemConfig.h:171
float bandwidth
receive filter bandwidth in Hz (0 = auto)
Definition ModemConfig.h:46