pamoja for TypeScript - v0.2.0
    Preparing search index...

    Class LoraRadio

    A LoRa radio opened on a Linux board or wired to a simulated chip.

    Index
    • Closes the radio's device files, after any call in progress finishes. Calls after this reject.

      Returns void

    • Listens a few symbols for a LoRa preamble and resolves whether one is there, as a relay's scan does, leaving the chip in standby. An SX126x listens over 1, 2, 4, 8, or 16 symbols, rounded down to one of them, and an SX127x over one.

      Parameters

      • symbols: number

      Returns Promise<boolean>

    • Starts listening, frame after frame, until another call changes the mode.

      Returns Promise<void>

    • Draws a random number from the noise the receiver hears, leaving the chip in standby.

      Semtech's own drivers draw it the same way, and LoRaWAN 1.0.3 suggests this source for a join nonce on a device that has no other.

      Returns Promise<number>

    • Reads one register: a 16-bit address on the SX126x, 0x00 to 0x7F on the SX127x.

      Parameters

      • address: number

      Returns Promise<number>

    • Puts the radio to sleep until the next call wakes it. An SX126x is configured again before its next frame; an SX127x keeps its registers.

      Returns Promise<void>

    • Puts the radio in standby, which stops a transmission or a reception.

      Returns Promise<void>

    • Sends one frame and resolves with its airtime in microseconds once it has left.

      Parameters

      • payload: Buffer

      Returns Promise<number>

    • Writes one register: a 16-bit address on the SX126x, 0x00 to 0x7F on the SX127x.

      Parameters

      • address: number
      • value: number

      Returns Promise<void>