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

logLevel: LogRecord_Level = Protobuf.LogRecord_Level.WARNING

Sets the library-wide logging level

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

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

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

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

  • Clears specific channel with the designated index

    Parameters

    • index: number

      Channel index to be cleared

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

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

  • 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

      Desired config type to request

    • 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 Module config

    Parameters

    • moduleConfigType: AdminMessage_ModuleConfigType

      Desired module config type to request

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

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

    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>

  • Sends packet over the radio

    Parameters

    • byteData: Uint8Array

      Raw bytes to send

    • portNum: PortNum

      DataType Enum of protobuf data type

    • Optional destinationNum: number

      Node number of the destination node

    • Optional wantAck: boolean = false

      Whether or not acknowledgement is wanted. Default is false

    • Optional channel: ChannelNumber = 0

      Channel to send. Default is 0

    • Optional wantResponse: boolean = false

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

    • Optional echoResponse: boolean = false

      Sends event back to client. Default is false. Default is false

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

    • Optional emoji: number = 0

      Used for message reactions. Default is 0

    • Optional replyId: number = 0

      Used to reply to a message. Default is 0

    Returns Promise<void>

  • Sends raw packet over the radio

    Parameters

    • id: number

      Unique packet ID

    • toRadio: Uint8Array

      Binary data to send

    • 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 a text over the radio

    Returns

    Parameters

    • text: string

      Message to send

    • Optional destinationNum: number

      Node number of the destination node

    • Optional wantAck: boolean = false

      Whether or not acknowledgement is wanted. Default is false

    • Optional channel: ChannelNumber = 0

      Channel number to send to. Default is 0. Default is 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 a text over the radio

    Returns

    Parameters

    • waypoint: Protobuf.Waypoint

      Desired waypoint to send

    • Optional destinationNum: number

      Node number of the destination node

    • wantAck: boolean = false

      Whether or not acknowledgement is wanted

    • channel: ChannelNumber = 0

      Channel to send on default of 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

      Raw bytes to send

    Returns Promise<void>

Generated using TypeDoc