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.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Serial(port, opts?): SerialTransport;Defined in: src/transports/serialTransport.ts:28
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
port | SerialPortLike |
opts? | { maxFrameBytes?: number; } |
opts.maxFrameBytes? | number |
Returns
Section titled “Returns”SerialTransport
Methods
Section titled “Methods”getState()
Section titled “getState()”getState(): TransportState;Defined in: src/transports/serialTransport.ts:61
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”onData()
Section titled “onData()”onData(cb): void;Defined in: src/transports/serialTransport.ts:53
Each chunk is ONE complete companion frame (a BLE notification payload).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
cb | (chunk) => void |
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”onStateChange()
Section titled “onStateChange()”onStateChange(cb): void;Defined in: src/transports/serialTransport.ts:57
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
cb | (s) => void |
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”send()
Section titled “send()”send(bytes): Promise<void>;Defined in: src/transports/serialTransport.ts:49
Write one complete companion frame to the radio.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
bytes | Uint8Array |
Returns
Section titled “Returns”Promise<void>