Skip to content

Serial

Defined in: src/transports/serialTransport.ts:21

Transport that frames the MeshCore serial protocol over a duck-typed port. The user owns opening/closing the port; this only observes and frames it.

new Serial(port, opts?): SerialTransport;

Defined in: src/transports/serialTransport.ts:28

ParameterType
portSerialPortLike
opts?{ maxFrameBytes?: number; }
opts.maxFrameBytes?number

SerialTransport

getState(): TransportState;

Defined in: src/transports/serialTransport.ts:61

TransportState

Transport.getState


onData(cb): void;

Defined in: src/transports/serialTransport.ts:53

Each chunk is ONE complete companion frame (a BLE notification payload).

ParameterType
cb(chunk) => void

void

Transport.onData


onStateChange(cb): void;

Defined in: src/transports/serialTransport.ts:57

ParameterType
cb(s) => void

void

Transport.onStateChange


send(bytes): Promise<void>;

Defined in: src/transports/serialTransport.ts:49

Write one complete companion frame to the radio.

ParameterType
bytesUint8Array

Promise<void>

Transport.send