Illustrated C/C++ source sheets, symbol index, API relationship graph, compiler console and debug trace

LIVE AI / FLEXIBLE SENSING / FLIGHT CONTEXT

Sensoraia API

Live AI and sensing, connected to the flight.
See, listen, inspect and return supported results while airborne.

Loading...
Searching...
No Matches
serial.h File Reference

UART descriptor setup and byte-oriented compatibility helpers. More...

#include <stdbool.h>
#include <unistd.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.

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_nameUART 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.

Definition at line 41 of file serial.c.

◆ ttyUSB0ChAvailable()

int ttyUSB0ChAvailable ( void )
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.

Definition at line 47 of file serial.h.

◆ ttyUSB0Getch()

char ttyUSB0Getch ( void )
inlinestatic

Attempt a single-byte read through the legacy UART interface.

Returns
Received byte, or zero when no byte was read.

The return value cannot distinguish a received NUL from an empty read; binary protocol parsers must check the descriptor read result instead.

Definition at line 69 of file serial.h.

◆ ttyUSB0Transmit()

void ttyUSB0Transmit ( char value)
inlinestatic

Attempt a single-byte write through the legacy UART interface.

Parameters
valueByte 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.

Definition at line 58 of file serial.h.

Variable Documentation

◆ fd

int fd
extern

Shared UART descriptor used by legacy receive/transmit integration code.

Definition at line 39 of file serial.c.