@lzcontest/serial
v0.1.1
Published
Transport-neutral byte-session and serial-port contracts for amateur-radio software.
Maintainers
Readme
@lzcontest/serial
Transport-neutral serial-port and full-duplex byte-session contracts.
Install
npm install @lzcontest/serialDefine a protocol transport
import type { ByteSession, SerialSettings } from '@lzcontest/serial';
export const settings: SerialSettings = {
baudRate: 9_600,
dataBits: 8,
stopBits: 1,
parity: 'none',
flowControl: 'none',
bufferSize: 4_096,
};
export async function sendFrame(session: ByteSession, frame: Uint8Array) {
await session.write(frame);
}Core API
| Export | Purpose |
| --- | --- |
| SerialSettings | Baud rate, framing, flow control, and buffer size |
| ByteSession | Open full-duplex byte stream |
| SerialPortProvider | Port discovery, selection, opening, and events |
| SerialPortDescriptor | Stable adapter-owned port identity |
| ConnectionState | Serial connection lifecycle |
| waitForAbortableDelay | Cancellation-aware protocol delay |
