Allows to connect to a Meshtastic device over WebSerial

Hierarchy

Constructors

Properties

configId: number

Randomly generated number to ensure confiuration lockstep

connType: string

Defines the connection type as serial

deviceStatus: DeviceStatusEnum

Describes the current state of the device

isConfigured: boolean

Describes the current state of the device

log: Logger<unknown>

Logs to the console and the logging event emitter

pendingSettingsChanges: boolean

Are there any settings that have yet to be applied?

port: undefined | SerialPort

Serial port used to communicate with device.

preventLock?: boolean

Should locks be prevented

queue: Queue

Keeps track of all requests sent to the radio that have callbacks TODO: Update description

transformer?: TransformStream<Uint8Array, Uint8Array>

Transform stream for parsing raw serial data

Events

onAtakPacket: SubEvent<AtakPacket> = ...

Fires when a new MeshPacket message containing a ATAK packet has been received from device

onAtakPacket

onChannelPacket: SubEvent<ChannelPacket> = ...

Fires when a new Channel message is recieved

onChannelPacket

onConfigPacket: SubEvent<ConfigPacket> = ...

Fires when a new Config message is recieved

onConfigPacket

onDeviceDebugLog: SubEvent<Uint8Array> = ...

Outputs any debug log data (currently serial connections only)

onDeviceDebugLog

onDeviceMetadataPacket: SubEvent<DeviceMetadataPacket> = ...

Fires when the device receives a Metadata packet

onDeviceMetadataPacket

onDeviceStatus: SubEvent<DeviceStatusEnum> = ...

Fires when the devices connection or configuration status changes

onDeviceStatus

onFromRadio: SubEvent<Protobuf.FromRadio> = ...

Fires when a new FromRadio message has been received from the device

onFromRadio

onIpTunnelPacket: SubEvent<IpTunnelPacket> = ...

Fires when a new MeshPacket message containing a IP Tunnel packet has been received from device

onIpTunnelPacket

onLogEvent: SubEvent<LogEventPacket> = ...

Fires when a new FromRadio message has been received from the device

onLogEvent

onLogRecord: SubEvent<Protobuf.LogRecord> = ...

Fires when a new FromRadio message containing a LogRecord packet has been received from device

onLogRecord

onMeshHeartbeat: SubEvent<Date> = ...

Fires when the device receives a meshPacket, returns a timestamp

onMeshHeartbeat

onMeshPacket: SubEvent<Protobuf.MeshPacket> = ...

Fires when a new FromRadio message containing a Data packet has been received from the device

onMeshPacket

onMessagePacket: SubEvent<MessagePacket> = ...

Fires when a new MeshPacket message containing a Text packet has been received from device

onMessagePacket

onModuleConfigPacket: SubEvent<ModuleConfigPacket> = ...

Fires when a new ModuleConfig message is recieved

onModuleConfigPacket

onMyNodeInfo: SubEvent<Protobuf.MyNodeInfo> = ...

Fires when a new MyNodeInfo message has been received from the device

onMyNodeInfo

onNodeInfoPacket: SubEvent<NodeInfoPacket> = ...

Fires when a new MeshPacket message containing a NodeInfo packet has been received from device

onNodeInfoPacket

onPingPacket: SubEvent<PingPacket> = ...

Fires when a new MeshPacket message containing a Ping packet has been received from device

onPingPacket

onPositionPacket: SubEvent<PositionPacket> = ...

Fires when a new MeshPacket message containing a Position packet has been received from device

onPositionPacket

onPrivatePacket: SubEvent<PrivatePacket> = ...

Fires when a new MeshPacket message containing a Private packet has been received from device

onPrivatePacket

onRangeTestPacket: SubEvent<RangeTestPacket> = ...

Fires when a new MeshPacket message containing a Store and Forward packet has been received from device

onRangeTestPacket

onReleaseEvent: SubEvent<boolean>

Fires when disconnect() is called, used to instruct serial port and readers to release there locks

onReleaseEvent

onRemoteHardwarePacket: SubEvent<RemoteHardwarePacket> = ...

Fires when a new MeshPacket message containing a Remote Hardware packet has been received from device

onRemoteHardwarePacket

onRoutingPacket: SubEvent<RoutingPacket> = ...

Fires when a new MeshPacket message containing a Routing packet has been received from device

onRoutingPacket

onSerialPacket: SubEvent<SerialPacket> = ...

Fires when a new MeshPacket message containing a Serial packet has been received from device

onSerialPacket

onStoreForwardPacket: SubEvent<StoreForwardPacket> = ...

Fires when a new MeshPacket message containing a Store and Forward packet has been received from device

onStoreForwardPacket

onTelemetryPacket: SubEvent<TelemetryPacket> = ...

Fires when a new MeshPacket message containing a Telemetry packet has been received from device

onTelemetryPacket

onUserPacket: SubEvent<UserPacket> = ...

Fires when a new MeshPacket message containing a User packet has been received from device

onUserPacket

onWaypointPacket: SubEvent<WaypointPacket> = ...

Fires when a new MeshPacket message containing a Waypoint packet has been received from device

onWaypointPacket

Methods

  • Completes all SubEvents

    Returns void

  • Triggers the device configure process

    Returns void

  • Confirms the currently set channels, and prevents changes from reverting after 10 minutes.

    Parameters

    Returns Promise<void>

  • Confirms the currently set config, and prevents changes from reverting after 10 minutes.

    Parameters

    • Optional callback: confirmSetConfigProps

      If wantAck is true, callback is called when the ack is received

    Returns Promise<void>

  • Disconnects from the serial port

    Returns Promise<void>

  • Gets devices Owner

    Parameters

    • Optional callback: getOwnerProps

      If wantAck is true, callback is called when the ack is received

    Returns Promise<void>

  • Opens browsers connection dialogue to select a serial port

    Returns

    Returned SerialPort

    Parameters

    • Optional filter: SerialPortRequestOptions

      Filter to use when requesting serial port

    Returns Promise<SerialPort>

  • Gets list of serial ports that can be passed to connect

    Returns Promise<SerialPort[]>

  • Pings device to check if it is avaliable

    Returns Promise<boolean>

  • Reads packets from transformed serial port steam and processes them.

    Parameters

    • reader: ReadableStreamDefaultReader<Uint8Array>

      Reader to use

    Returns Promise<void>

  • Disconnects from the serial port

    Returns Promise<void>

  • Resets the internal NodeDB of the radio, usefull for removing old nodes that no longer exist.

    Parameters

    • Optional callback: resetPeersProps

      If wantAck is true, callback is called when the ack is received

    Returns Promise<void>

  • Sends raw packet over the radio

    Parameters

    Returns Promise<void>

  • Sends a text over the radio

    Returns

    Parameters

    Returns Promise<void>

  • Sends supplied protobuf message to the radio

    Parameters

    • data: Uint8Array

      Raw bytes to send

    Returns Promise<void>

Generated using TypeDoc