menu

DeviceSerialBinding

import { DeviceSerialBinding } from "destack:device/binding";

Serial binding family.

language/library/src/device/binding/serial.ds:292:456
1export interface DeviceSerialBinding {2    listSerialPorts(): Result<SerialPort[], HostError>;3    openSerialWatch(): Result<SerialWatchHandle, HostError>;4    closeSerialWatch(watch: SerialWatchHandle): Result<void, HostError>;5    readSerialWatch(watch: SerialWatchHandle, timeoutNs?: uint64 | undefined): Result<SerialWatchEvent, HostError>;6    openSerialPort(id: &'a readonly string, options: &'b readonly SerialOpenOptions): Result<SerialPortHandle, HostError>;7    closeSerialPort(port: SerialPortHandle): Result<void, HostError>;8    describeSerialPort(port: SerialPortHandle): Result<SerialPort, HostError>;9    getSerialConfig(port: SerialPortHandle): Result<SerialConfig, HostError>;10    setSerialConfig(port: SerialPortHandle, config: &'a readonly SerialConfig): Result<void, HostError>;11    readSerial(port: SerialPortHandle, buffer: &'a [uint8], timeoutNs?: uint64 | undefined): Result<uint64, HostError>;12    writeSerial(port: SerialPortHandle, bytes: &'a readonly [uint8], timeoutNs?: uint64 | undefined): Result<uint64, HostError>;13    drainSerial(port: SerialPortHandle): Result<void, HostError>;14    flushSerial(port: SerialPortHandle, buffers: SerialFlushFlags): Result<void, HostError>;15    getSerialSignals(port: SerialPortHandle): Result<SerialInputSignals, HostError>;16    setSerialSignals(port: SerialPortHandle, signals: &'a readonly SerialOutputSignals): Result<void, HostError>;17    readSerialEvent(port: SerialPortHandle, timeoutNs?: uint64 | undefined): Result<SerialEvent, HostError>;18}

Members

listSerialPorts(): Result<SerialPort[], HostError>

List serial ports.

openSerialWatch(): Result<SerialWatchHandle, HostError>

Open a serial topology watch.

closeSerialWatch(watch: SerialWatchHandle): Result<void, HostError>

Close a serial topology watch.

readSerialWatch(watch: SerialWatchHandle, timeoutNs?: uint64 | undefined): Result<SerialWatchEvent, HostError>

Read one serial topology event.

openSerialPort(id: &'a readonly string, options: &'b readonly SerialOpenOptions): Result<SerialPortHandle, HostError>

Open a serial port.

closeSerialPort(port: SerialPortHandle): Result<void, HostError>

Close a serial port.

describeSerialPort(port: SerialPortHandle): Result<SerialPort, HostError>

Describe a serial port.

getSerialConfig(port: SerialPortHandle): Result<SerialConfig, HostError>

Read serial port configuration.

setSerialConfig(port: SerialPortHandle, config: &'a readonly SerialConfig): Result<void, HostError>

Update serial port configuration.

readSerial(port: SerialPortHandle, buffer: &'a [uint8], timeoutNs?: uint64 | undefined): Result<uint64, HostError>

Read bytes from a serial port.

writeSerial(port: SerialPortHandle, bytes: &'a readonly [uint8], timeoutNs?: uint64 | undefined): Result<uint64, HostError>

Write bytes to a serial port.

drainSerial(port: SerialPortHandle): Result<void, HostError>

Wait for queued serial output to drain.

flushSerial(port: SerialPortHandle, buffers: SerialFlushFlags): Result<void, HostError>

Flush queued serial bytes.

getSerialSignals(port: SerialPortHandle): Result<SerialInputSignals, HostError>

Read serial input signals.

setSerialSignals(port: SerialPortHandle, signals: &'a readonly SerialOutputSignals): Result<void, HostError>

Update serial output signals.

readSerialEvent(port: SerialPortHandle, timeoutNs?: uint64 | undefined): Result<SerialEvent, HostError>

Read one serial port event.