UART descriptor setup and byte-oriented compatibility helpers. More...
#include <stdbool.h>#include <unistd.h>

Go to the source code of this file.
Functions | |
| int | serial_init (const char *port_name) |
| Configure the shared non-blocking USHER UART descriptor. | |
| static int | ttyUSB0ChAvailable (void) |
| Preserve the legacy "character available" transport API contract. | |
| static void | ttyUSB0Transmit (char value) |
| Attempt a single-byte write through the legacy UART interface. | |
| static char | ttyUSB0Getch (void) |
| Attempt a single-byte read through the legacy UART interface. | |
Variables | |
| int | fd |
Detailed Description
UART descriptor setup and byte-oriented compatibility helpers.
New USHER code should use serial_tx.h for output because it preserves frame boundaries under concurrent worker activity. These helpers remain for platform compatibility with the historic transport interface.
Definition in file serial.h.
Function Documentation
◆ serial_init()
| int serial_init | ( | const char * | port_name | ) |
Configure the shared non-blocking USHER UART descriptor.
- Parameters
-
port_name UART device path.
- Returns
- 0 on success or a negative setup error.
The descriptor is set to raw 115200-bit/s 8-bit mode so line discipline cannot translate binary USHER framing bytes. This module owns descriptor setup only; concurrent transmission must use serial_tx.h.
◆ ttyUSB0ChAvailable()
|
inlinestatic |
Preserve the legacy "character available" transport API contract.
- Returns
- Always false because USHER receives through the parser's nonblocking descriptor.
Retained solely for platform compatibility. New code must not use this predicate to gate UART reads; it would permanently suppress them.
◆ ttyUSB0Getch()
|
inlinestatic |
◆ ttyUSB0Transmit()
|
inlinestatic |
Attempt a single-byte write through the legacy UART interface.
- Parameters
-
value Byte to send.
The compatibility API cannot report a short write or a busy descriptor. Use the frame-aware interface in serial_tx.h for USHER output.