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

    Class CfList

    The optional channel list at the end of a join accept.

    A network that wants a device on more channels than its region's defaults says so in sixteen bytes: five frequencies for a dynamic plan such as EU868, or six groups of channel mask bits for a fixed plan such as US915. The list keeps the bytes as they arrived and reads either form out of them.

    Index
    • Reads the mask groups out of a type 1 list.

      Returns number[] | null

      Six groups, or null for a list of any other type.

    • Lists the channels a type 1 list enables.

      Returns number[]

      The channel numbers, lowest first, which is empty for a list of any other type.

    • Reports whether a type 1 list enables a channel.

      Parameters

      • channel: number

        The channel number, group * 16 + bit.

      Returns boolean | null

      Whether its bit is set, or null for a list of any other type or a channel past the 96 the groups cover.

    • Reads the frequencies out of a type 0 list.

      Returns number[] | null

      Five frequencies in hertz, 0 for an unused slot, or null for a list of any other type.

    • Builds a type 1 list from channel mask groups.

      Parameters

      • masks: readonly number[]

        Six sixteen-bit groups, where bit n of group g enables channel g * 16 + n.

      Returns CfList

      The channel list.

      If there are not six, or a group does not fit sixteen bits.

    • Builds a type 0 list from frequencies.

      Parameters

      • frequenciesHz: readonly number[]

        Five frequencies in hertz, with 0 for a slot left unused.

      Returns CfList

      The channel list.

      If there are not five, or a frequency is not a whole number of hundreds of hertz from 100 MHz to just under 1.678 GHz.

      const list = CfList.frequencies([867_100_000, 867_300_000, 867_500_000, 867_700_000, 867_900_000])
      list.bytes.subarray(0, 3) // <Buffer 18 4f 84>
    • Keeps a channel list exactly as it arrived, whatever its type byte says.

      Parameters

      • bytes: Uint8Array

        The sixteen CFList bytes.

      Returns CfList

      The channel list.

      If there are not sixteen bytes.