Options
All
  • Public
  • Public/Protected
  • All
Menu

Allows to connect to a Meshtastic device over HTTP(S)

Hierarchy

Index

Constructors

constructor

Events

Readonly onAdminPacketEvent

onAdminPacketEvent: Subject<AdminPacket> = ...

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

Readonly onDeviceStatusEvent

onDeviceStatusEvent: Subject<DeviceStatusEnum> = ...

Fires when the devices connection or configuration status changes

Readonly onFromRadioEvent

onFromRadioEvent: Subject<FromRadio> = ...

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

Readonly onLogRecordEvent

onLogRecordEvent: Subject<LogRecord> = ...

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

Readonly onMeshHeartbeat

onMeshHeartbeat: Subject<number> = ...

Fires when the device receives a meshPacket, returns a timestamp

Readonly onMeshPacketEvent

onMeshPacketEvent: Subject<MeshPacket> = ...

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

Readonly onNodeInfoPacketEvent

onNodeInfoPacketEvent: Subject<NodeInfoPacket> = ...

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

Readonly onPositionPacketEvent

onPositionPacketEvent: Subject<PositionPacket> = ...

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

Readonly onRoutingPacketEvent

onRoutingPacketEvent: Subject<RoutingPacket> = ...

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

Readonly onTextPacketEvent

onTextPacketEvent: Subject<TextPacket> = ...

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

Properties

Protected deviceStatus

deviceStatus: DeviceStatusEnum

Describes the current state of the device

Protected isConfigured

isConfigured: boolean

Describes the current state of the device

Readonly onMyNodeInfoEvent

onMyNodeInfoEvent: Subject<MyNodeInfo> = ...

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

Readonly onRadioConfigEvent

onRadioConfigEvent: Subject<RadioConfig> = ...

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

receiveBatchRequests

receiveBatchRequests: undefined | boolean

Enables receiving messages all at once, versus one per request

url

url: undefined | string

URL of the device that is to be connected to.

Methods

blinkLED

  • blinkLED(): Promise<void | Response>
  • Web API method: Make device LED blink

    todo,

    strongly type response

    Returns Promise<void | Response>

configure

  • configure(): Promise<void>
  • Triggers the device configure process

    Returns Promise<void>

connect

  • Initiates the connect process to a Meshtastic device via HTTP(S)

    Parameters

    Returns Promise<void>

deleteSPIFFS

  • Web API method: Delete SPIFFS file

    Parameters

    • file: string

    Returns Promise<void | WebSPIFFSResponse>

disconnect

  • disconnect(): void
  • Disconnects from the Meshtastic device

    Returns void

getNetworks

  • Web API method: Scan for WiFi AP's

    Returns Promise<void | WebNetworkResponse>

getSPIFFS

  • Web API method: Fetch SPIFFS contents

    Returns Promise<void | WebSPIFFSResponse>

getStatistics

  • Web API method: Get airtime statistics

    Returns Promise<void | WebStatisticsResponse>

Protected handleFromRadio

  • handleFromRadio(fromRadio: Uint8Array): Promise<void>
  • Gets called whenever a fromRadio message is received from device, returns fromRadio data

    Parameters

    • fromRadio: Uint8Array

      Uint8Array containing raw radio data

    Returns Promise<void>

ping

  • ping(): Promise<boolean>
  • Pings device to check if it is avaliable

    Returns Promise<boolean>

Protected readFromRadio

  • readFromRadio(): Promise<void>
  • Reads any avaliable protobuf messages from the radio

    Returns Promise<void>

restartDevice

  • restartDevice(): Promise<void>
  • Web API method: Restart device

    Returns Promise<void>

sendPacket

  • sendPacket(byteData: Uint8Array, portNum: PortNum, destinationNum?: number, wantAck?: boolean, wantResponse?: boolean, echoResponse?: boolean): Promise<void>
  • Sends packet over the radio

    Parameters

    • byteData: Uint8Array
    • portNum: PortNum

      dataType Enum of protobuf data type

    • Optional destinationNum: number

      Node number of the destination node

    • wantAck: boolean = false

      Whether or not acknowledgement is wanted

    • wantResponse: boolean = false

      Used for testing, requests recpipient to respond in kind with the same type of request

    • echoResponse: boolean = false

      Sends event back to client

    Returns Promise<void>

sendText

  • sendText(text: string, destinationNum?: number, wantAck?: boolean): Promise<void>
  • Sends a text over the radio

    Parameters

    • text: string
    • Optional destinationNum: number

      Node number of the destination node

    • wantAck: boolean = false

      Whether or not acknowledgement is wanted

    Returns Promise<void>

setChannelSettings

  • setChannelSettings(channel: Channel): Promise<void>
  • Sets devices ChannelSettings

    todo

    what is confirmSetChannel?

    Parameters

    Returns Promise<void>

setOwner

  • setOwner(owner: User): Promise<void>
  • Sets devices owner data

    todo

    what is confirmSetOwner?

    Parameters

    Returns Promise<void>

setPreferences

Protected writeToRadio

  • writeToRadio(data: Uint8Array): Promise<void>
  • Sends supplied protobuf message to the radio

    Parameters

    • data: Uint8Array

    Returns Promise<void>

Generated using TypeDoc