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

    Class LorawanEndDevice

    A LoRaWAN Class A end device.

    One exchange runs like this: join or send returns a transmission to put on the air and two receive windows timed from its end. A frame heard in either window goes to heard. If neither window held one, nothingHeard says whether to send the same frame again with repeat, or move on.

    Index
    • get dataRate(): number

      The data rate the next uplink goes out at, before any back-off step.

      Returns number

    • get devAddr(): number | null

      The address the device is on the network by, or null before joining.

      Returns number | null

    • get fcntDown(): number | null

      The last downlink frame counter accepted, or null before any downlink.

      Returns number | null

    • get fcntUp(): number

      The next uplink frame counter.

      Returns number

    • get isJoined(): boolean

      Whether the device is on a network: once joined, or from the start for a personalized device.

      Returns boolean

    • get receiveDelayUs(): number

      The delay from the end of an uplink to the first receive window, in microseconds.

      Returns number

    • get relaying(): boolean

      Whether the next uplink goes through a relay.

      Returns boolean

    • get transmissions(): number

      How many times each uplink goes out, as the network last set it.

      Returns number

    • get worCounter(): number

      The wake-on-radio frame counter the next frame will use, TS011-1.0.1 section 5.3.2.

      Returns number

    • Reads a frame heard in one of the receive windows of the last transmission.

      A frame that is not for this device, does not verify, or is longer than the window's data rate carries throws and leaves the transmission waiting, so the second window still opens. Without window, a frame may be as long as the faster window allows.

      Parameters

      Returns LorawanHeard

    • Reads the acknowledgment a relay answered the last wake-on-radio frame with.

      The device is now synchronized: it knows when the relay scans, so its next frames carry only as much preamble as the two clocks could have drifted apart.

      Parameters

      • frame: Buffer

      Returns LorawanRelayStatus

    • Says what comes next once both receive windows closed with nothing for the device.

      Parameters

      • nowUs: number

      Returns LorawanNext

    • Says what to do once the acknowledgment window closed with nothing in it: send the uplink anyway, or wake the relay again first, as the network's BackOff asks.

      Parameters

      • nowUs: number

      Returns LorawanWorNext

    • Asks the network, with the next uplink, for the time.

      Returns void

    • Asks the network, with the next uplink, how well it hears the device.

      Returns void

    • Puts a saved state back on a device made the same way, on the clock it woke to.

      Parameters

      • saved: Buffer
      • nowUs: number

      Returns void

    • Saves a joined device's state, to keep across a loss of power.

      The bytes hold the session keys, so keep them wherever the keys would be safe.

      Parameters

      • nowUs: number

      Returns Buffer

    • Builds an uplink carrying a payload on an application port, 1 to 223, or 224 for the certification test port.

      Parameters

      • port: number
      • payload: Buffer
      • confirmed: boolean
      • nowUs: number

      Returns LorawanTransmission

    • Sets what the device reports its battery as when a network asks: a level from 1, empty, to 254, full, "external" for a device on external power, or null when it cannot tell.

      Parameters

      • Optionalbattery: string | number | null

      Returns void

    • Turns relay mode on or off, TS011-1.0.1 section 10.2 and appendix 5.

      From here on the decision is the caller's rather than the device's own policy, until its network takes it over with EndDeviceConfReq or hands it back. Returns false when the network holds the decision, leaving the mode as it was.

      Parameters

      • on: boolean

      Returns boolean