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

Hierarchy

Constructors

Properties

abortController: AbortController
configId: number

Randomly generated number to ensure confiuration lockstep

connType: string

Defines the connection type as http

deviceStatus: DeviceStatusEnum

Describes the current state of the device

isConfigured: boolean

Describes the current state of the device

log: ((scope: EmitterScope, emitter: Emitter, message: string, level: LogRecord_Level, packet?: Uint8Array) => void)

Type declaration

onDeviceMetadataPacket: SubEvent<DeviceMetadataPacket> = ...

Fires when the device receives a Metadata packet

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

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

peningRequest: boolean
queue: Queue

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

readLoop: null | Timer
receiveBatchRequests: boolean

Enables receiving messages all at once, versus one per request

url: string

URL of the device that is to be connected to.

Events

onAtakPacket: SubEvent<AtakPacket> = ...

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

onChannelPacket: SubEvent<ChannelPacket> = ...

Fires when a new Channel message is recieved

onConfigPacket: SubEvent<ConfigPacket> = ...

Fires when a new Config message is recieved

onDeviceStatus: SubEvent<DeviceStatusEnum> = ...

Fires when the devices connection or configuration status changes

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

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

onIpTunnelPacket: SubEvent<IpTunnelPacket> = ...

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

onLogEvent: SubEvent<LogEventPacket> = ...

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

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

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

onMeshHeartbeat: SubEvent<Date> = ...

Fires when the device receives a meshPacket, returns a timestamp

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

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

onMessagePacket: SubEvent<MessagePacket> = ...

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

onModuleConfigPacket: SubEvent<ModuleConfigPacket> = ...

Fires when a new ModuleConfig message is recieved

onNodeInfoPacket: SubEvent<NodeInfoPacket> = ...

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

onPingPacket: SubEvent<PingPacket> = ...

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

onPositionPacket: SubEvent<PositionPacket> = ...

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

onPrivatePacket: SubEvent<PrivatePacket> = ...

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

onRangeTestPacket: SubEvent<RangeTestPacket> = ...

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

onRemoteHardwarePacket: SubEvent<RemoteHardwarePacket> = ...

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

onRoutingPacket: SubEvent<RoutingPacket> = ...

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

onSerialPacket: SubEvent<SerialPacket> = ...

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

onStoreForwardPacket: SubEvent<StoreForwardPacket> = ...

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

onTelemetryPacket: SubEvent<TelemetryPacket> = ...

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

onUserPacket: SubEvent<UserPacket> = ...

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

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

    • Optional callback: ((id: number) => Promise<void>)

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

        • (id: number): Promise<void>
        • Parameters

          • id: number

          Returns Promise<void>

    Returns Promise<void>

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

    Parameters

    • Optional callback: ((id: number) => Promise<void>)

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

        • (id: number): Promise<void>
        • Parameters

          • id: number

          Returns Promise<void>

    Returns Promise<void>

  • Deletes specific channel via index

    Parameters

    • index: number

      Channel index to be deleted

    • Optional callback: ((id: number) => Promise<void>)

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

        • (id: number): Promise<void>
        • Parameters

          • id: number

          Returns Promise<void>

    Returns Promise<void>

  • Disconnects from the Meshtastic device

    Returns void

  • Gets all of the devices channels

    Parameters

    • Optional callback: (() => Promise<void>)

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

        • (): Promise<void>
        • Returns Promise<void>

    Returns Promise<void>

  • Gets specified channel information from the radio

    Parameters

    • index: number

      Channel index to be retrieved

    • Optional callback: ((id: number) => Promise<void>)

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

        • (id: number): Promise<void>
        • Parameters

          • id: number

          Returns Promise<void>

    Returns Promise<void>

  • Gets devices config

    Parameters

    • configType: AdminMessage_ConfigType
    • Optional callback: ((id: number) => Promise<void>)

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

        • (id: number): Promise<void>
        • Parameters

          • id: number

          Returns Promise<void>

    Returns Promise<void>

  • Gets devices metadata

    Parameters

    • Optional callback: ((id: number) => Promise<void>)

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

        • (id: number): Promise<void>
        • Parameters

          • id: number

          Returns Promise<void>

    Returns Promise<void>

  • Gets devices config

    Parameters

    • configType: AdminMessage_ModuleConfigType
    • Optional callback: ((id: number) => Promise<void>)

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

        • (id: number): Promise<void>
        • Parameters

          • id: number

          Returns Promise<void>

    Returns Promise<void>

  • Gets devices Owner

    Parameters

    • Optional callback: ((id: number) => Promise<void>)

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

        • (id: number): Promise<void>
        • Parameters

          • id: number

          Returns Promise<void>

    Returns 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>

  • Pings device to check if it is avaliable

    Returns Promise<boolean>

  • Reads any avaliable protobuf messages from the radio

    Returns Promise<void>

  • Sends a text over the radio

    Parameters

    • location: Protobuf.Location

      Location to send

    • Optional destinationNum: number

      Node number of the destination node

    • wantAck: boolean = false

      Whether or not acknowledgement is wanted

    • channel: number = 0
    • Optional callback: ((id: number) => Promise<void>)

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

        • (id: number): Promise<void>
        • Parameters

          • id: number

          Returns Promise<void>

    Returns 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

    • channel: number = 0
    • 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

    • Optional callback: ((id: number) => Promise<void>)

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

        • (id: number): Promise<void>
        • Parameters

          • id: number

          Returns Promise<void>

    • emoji: number = 0
    • Optional location: Protobuf.Location
    • replyId: number = 0

    Returns Promise<void>

  • Sends raw packet over the radio

    Parameters

    • id: number
    • toRadio: Uint8Array

      binary data to send

    • Optional callback: ((id: number) => Promise<void>)
        • (id: number): Promise<void>
        • Parameters

          • id: number

          Returns Promise<void>

    Returns 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

    • channel: number = 0
    • Optional callback: ((id: number) => Promise<void>)

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

        • (id: number): Promise<void>
        • Parameters

          • id: number

          Returns Promise<void>

    Returns Promise<void>

  • Sets devices ChannelSettings

    Parameters

    • channel: Protobuf.Channel

      Channel data to be set

    • Optional callback: ((id: number) => Promise<void>)

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

        • (id: number): Promise<void>
        • Parameters

          • id: number

          Returns Promise<void>

    Returns Promise<void>

  • Writes config to device

    Parameters

    • config: Protobuf.Config

      config object

    • Optional callback: ((id: number) => Promise<void>)

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

        • (id: number): Promise<void>
        • Parameters

          • id: number

          Returns Promise<void>

    Returns Promise<void>

  • Writes module config to device

    Parameters

    • config: Protobuf.ModuleConfig

      module config object

    • Optional callback: ((id: number) => Promise<void>)

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

        • (id: number): Promise<void>
        • Parameters

          • id: number

          Returns Promise<void>

    Returns Promise<void>

  • Sets devices owner data

    Parameters

    • owner: Protobuf.User

      Owner data to apply to the device

    • Optional callback: ((id: number) => Promise<void>)

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

        • (id: number): Promise<void>
        • Parameters

          • id: number

          Returns Promise<void>

    Returns Promise<void>

  • Sends supplied protobuf message to the radio

    Parameters

    • data: Uint8Array

    Returns Promise<void>

Generated using TypeDoc