lorawan: github.com/brocaar/lorawan/applayer/multicastsetup Index | Files

package multicastsetup

import "github.com/brocaar/lorawan/applayer/multicastsetup"

Package multicastsetup implements the Remote Multicast Setup v1.0.0 over LoRaWAN.

Index

Package Files

cid_string.go keys.go multicastsetup.go

Constants

const DefaultFPort uint8 = 200

DefaultFPort defines the default fPort value for Remote Multicast Setup.

Variables

var (
    ErrNoPayloadForCID = errors.New("lorawan/applayer/multicastsetup: no payload for given CID")
)

Errors

func GetMcAppSKey Uses

func GetMcAppSKey(mcKey lorawan.AES128Key, mcAddr lorawan.DevAddr) (lorawan.AES128Key, error)

GetMcAppSKey returns the McAppSKey given the McKey and McAddr.

func GetMcKEKey Uses

func GetMcKEKey(mcRootKey lorawan.AES128Key) (lorawan.AES128Key, error)

GetMcKEKey returns the McKEKey given the McRootKey.

func GetMcNetSKey Uses

func GetMcNetSKey(mcKey lorawan.AES128Key, mcAddr lorawan.DevAddr) (lorawan.AES128Key, error)

GetMcNetSKey returns the McNetSKey given the McKey and McAddr.

func GetMcRootKeyForAppKey Uses

func GetMcRootKeyForAppKey(appKey lorawan.AES128Key) (lorawan.AES128Key, error)

GetMcRootKeyForAppKey returns the McRootKey given an AppKey. Note: The AppKey is only used for LoRaWAN 1.1.x devices.

func GetMcRootKeyForGenAppKey Uses

func GetMcRootKeyForGenAppKey(genAppKey lorawan.AES128Key) (lorawan.AES128Key, error)

GetMcRootKeyForGenAppKey returns the McRootKey given a GenAppKey. Note: The GenAppKey is only used for LoRaWAN 1.0.x devices.

type CID Uses

type CID byte

CID defines the command identifier.

const (
    PackageVersionReq  CID = 0x00
    PackageVersionAns  CID = 0x00
    McGroupStatusReq   CID = 0x01
    McGroupStatusAns   CID = 0x01
    McGroupSetupReq    CID = 0x02
    McGroupSetupAns    CID = 0x02
    McGroupDeleteReq   CID = 0x03
    McGroupDeleteAns   CID = 0x03
    McClassCSessionReq CID = 0x04
    McClassCSessionAns CID = 0x04
    McClassBSessionReq CID = 0x05
    McClassBSessionAns CID = 0x05
)

Available command identifiers.

func (CID) String Uses

func (i CID) String() string

type Command Uses

type Command struct {
    CID     CID
    Payload CommandPayload
}

Command defines the Command structure.

func (Command) MarshalBinary Uses

func (c Command) MarshalBinary() ([]byte, error)

MarshalBinary encodes the command to a slice of bytes.

func (Command) Size Uses

func (c Command) Size() int

Size returns the size of the command in bytes.

func (*Command) UnmarshalBinary Uses

func (c *Command) UnmarshalBinary(uplink bool, data []byte) error

UnmarshalBinary decodes a slice of bytes into a command.

type CommandPayload Uses

type CommandPayload interface {
    MarshalBinary() (data []byte, err error)
    UnmarshalBinary(data []byte) error
    Size() int
}

CommandPayload defines the interface that a command payload must implement.

func GetCommandPayload Uses

func GetCommandPayload(uplink bool, c CID) (CommandPayload, error)

GetCommandPayload returns a new CommandPayload for the given CID.

type Commands Uses

type Commands []Command

Commands defines a slice of commands.

func (Commands) MarshalBinary Uses

func (c Commands) MarshalBinary() ([]byte, error)

MarshalBinary encodes the commands to a slice of bytes.

func (*Commands) UnmarshalBinary Uses

func (c *Commands) UnmarshalBinary(uplink bool, data []byte) error

UnmarshalBinary decodes a slice of bytes into a slice of commands.

type McClassBSessionAnsPayload Uses

type McClassBSessionAnsPayload struct {
    StatusAndMcGroupID McClassBSessionAnsPayloadStatusAndMcGroupID
    TimeToStart        *uint32
}

McClassBSessionAnsPayload implements the McClassBSessionAns payload.

func (McClassBSessionAnsPayload) MarshalBinary Uses

func (p McClassBSessionAnsPayload) MarshalBinary() ([]byte, error)

MarshalBinary encodes the payload to a slice of bytes.

func (McClassBSessionAnsPayload) Size Uses

func (p McClassBSessionAnsPayload) Size() int

Size returns the payload size in number of bytes.

func (*McClassBSessionAnsPayload) UnmarshalBinary Uses

func (p *McClassBSessionAnsPayload) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes the payload from a slice of bytes.

type McClassBSessionAnsPayloadStatusAndMcGroupID Uses

type McClassBSessionAnsPayloadStatusAndMcGroupID struct {
    McGroupUndefined bool
    FreqError        bool
    DRError          bool
    McGroupID        uint8
}

McClassBSessionAnsPayloadStatusAndMcGroupID implements the McClassBSessionAns payload StatusAndMcGroupID field.

type McClassBSessionReqPayload Uses

type McClassBSessionReqPayload struct {
    McGroupIDHeader    McClassBSessionReqPayloadMcGroupIDHeader
    SessionTime        uint32
    TimeOutPeriodicity McClassBSessionReqPayloadTimeOutPeriodicity
    DLFrequency        uint32
    DR                 uint8
}

McClassBSessionReqPayload implements the McClassBSessionReq payload.

func (McClassBSessionReqPayload) MarshalBinary Uses

func (p McClassBSessionReqPayload) MarshalBinary() ([]byte, error)

MarshalBinary encodes the payload to a slice of bytes.

func (McClassBSessionReqPayload) Size Uses

func (p McClassBSessionReqPayload) Size() int

Size returns the payload size in number of bytes.

func (*McClassBSessionReqPayload) UnmarshalBinary Uses

func (p *McClassBSessionReqPayload) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes the payload from a slice of bytes.

type McClassBSessionReqPayloadMcGroupIDHeader Uses

type McClassBSessionReqPayloadMcGroupIDHeader struct {
    McGroupID uint8
}

McClassBSessionReqPayloadMcGroupIDHeader implements the McClassBSessionReq payload McGroupIDHeader field.

type McClassBSessionReqPayloadTimeOutPeriodicity Uses

type McClassBSessionReqPayloadTimeOutPeriodicity struct {
    Periodicity uint8
    TimeOut     uint8
}

McClassBSessionReqPayloadTimeOutPeriodicity implements the McClassBSessionReq payload TimeOutPeriodicity field.

type McClassCSessionAnsPayload Uses

type McClassCSessionAnsPayload struct {
    StatusAndMcGroupID McClassCSessionAnsPayloadStatusAndMcGroupID
    TimeToStart        *uint32
}

McClassCSessionAnsPayload implements the McClassCSessionAns payload.

func (McClassCSessionAnsPayload) MarshalBinary Uses

func (p McClassCSessionAnsPayload) MarshalBinary() ([]byte, error)

MarshalBinary encodes the payload to a slice of bytes.

func (McClassCSessionAnsPayload) Size Uses

func (p McClassCSessionAnsPayload) Size() int

Size returns the payload size in number of bytes.

func (*McClassCSessionAnsPayload) UnmarshalBinary Uses

func (p *McClassCSessionAnsPayload) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes the payload from a slice of bytes.

type McClassCSessionAnsPayloadStatusAndMcGroupID Uses

type McClassCSessionAnsPayloadStatusAndMcGroupID struct {
    McGroupUndefined bool
    FreqError        bool
    DRError          bool
    McGroupID        uint8
}

McClassCSessionAnsPayloadStatusAndMcGroupID implements the McClassCSessionAns payload StatusAndMcGroupID field.

type McClassCSessionReqPayload Uses

type McClassCSessionReqPayload struct {
    McGroupIDHeader McClassCSessionReqPayloadMcGroupIDHeader
    SessionTime     uint32
    SessionTimeOut  McClassCSessionReqPayloadSessionTimeOut
    DLFrequency     uint32 // the frequency in Hz!
    DR              uint8
}

McClassCSessionReqPayload implements the McClassCSessionReq payload.

func (McClassCSessionReqPayload) MarshalBinary Uses

func (p McClassCSessionReqPayload) MarshalBinary() ([]byte, error)

MarshalBinary encodes the payload to a slice of bytes.

func (*McClassCSessionReqPayload) Size Uses

func (p *McClassCSessionReqPayload) Size() int

Size returns the payload size in number of bytes.

func (*McClassCSessionReqPayload) UnmarshalBinary Uses

func (p *McClassCSessionReqPayload) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes the payload from a slice of bytes.

type McClassCSessionReqPayloadMcGroupIDHeader Uses

type McClassCSessionReqPayloadMcGroupIDHeader struct {
    McGroupID uint8
}

McClassCSessionReqPayloadMcGroupIDHeader implements the McClassCSessionReq payload McGroupIDHeader field.

type McClassCSessionReqPayloadSessionTimeOut Uses

type McClassCSessionReqPayloadSessionTimeOut struct {
    TimeOut uint8 // the actual value in seconds is 2^TimeOut
}

McClassCSessionReqPayloadSessionTimeOut implements the McClassCSessionReq payload SessionTimeOut field.

type McGroupDeleteAnsPayload Uses

type McGroupDeleteAnsPayload struct {
    McGroupIDHeader McGroupDeleteAnsPayloadMcGroupIDHeader
}

McGroupDeleteAnsPayload implements the McGroupDeleteAns payload.

func (McGroupDeleteAnsPayload) MarshalBinary Uses

func (p McGroupDeleteAnsPayload) MarshalBinary() ([]byte, error)

MarshalBinary encodes the payload to a slice of bytes.

func (McGroupDeleteAnsPayload) Size Uses

func (p McGroupDeleteAnsPayload) Size() int

Size returns the payload size in number of bytes.

func (*McGroupDeleteAnsPayload) UnmarshalBinary Uses

func (p *McGroupDeleteAnsPayload) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes the payload from a slice of bytes.

type McGroupDeleteAnsPayloadMcGroupIDHeader Uses

type McGroupDeleteAnsPayloadMcGroupIDHeader struct {
    McGroupUndefined bool
    McGroupID        uint8
}

McGroupDeleteAnsPayloadMcGroupIDHeader implements the McGroupDeleteAns payload McGroupIDHeader field.

type McGroupDeleteReqPayload Uses

type McGroupDeleteReqPayload struct {
    McGroupIDHeader McGroupDeleteReqPayloadMcGroupIDHeader
}

McGroupDeleteReqPayload implements the McGroupDeleteReq payload.

func (McGroupDeleteReqPayload) MarshalBinary Uses

func (p McGroupDeleteReqPayload) MarshalBinary() ([]byte, error)

MarshalBinary encodes the payload to a slice of bytes.

func (McGroupDeleteReqPayload) Size Uses

func (p McGroupDeleteReqPayload) Size() int

Size returns the payload size in number of bytes.

func (*McGroupDeleteReqPayload) UnmarshalBinary Uses

func (p *McGroupDeleteReqPayload) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes the payload from a slice of bytes.

type McGroupDeleteReqPayloadMcGroupIDHeader Uses

type McGroupDeleteReqPayloadMcGroupIDHeader struct {
    McGroupID uint8
}

McGroupDeleteReqPayloadMcGroupIDHeader implements the McGroupDeleteReq payload McGroupIDHeader field.

type McGroupSetupAnsPayload Uses

type McGroupSetupAnsPayload struct {
    McGroupIDHeader McGroupSetupAnsPayloadMcGroupIDHeader
}

McGroupSetupAnsPayload implements the McGroupSetupAns payload.

func (McGroupSetupAnsPayload) MarshalBinary Uses

func (p McGroupSetupAnsPayload) MarshalBinary() ([]byte, error)

MarshalBinary encodes the payload to a slice of bytes.

func (McGroupSetupAnsPayload) Size Uses

func (p McGroupSetupAnsPayload) Size() int

Size returns the payload size in number of bytes.

func (*McGroupSetupAnsPayload) UnmarshalBinary Uses

func (p *McGroupSetupAnsPayload) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes the payload from a slice of bytes.

type McGroupSetupAnsPayloadMcGroupIDHeader Uses

type McGroupSetupAnsPayloadMcGroupIDHeader struct {
    IDError   bool
    McGroupID uint8
}

McGroupSetupAnsPayloadMcGroupIDHeader implements the McGroupSetupAns payload GroupIDHeader field.

type McGroupSetupReqPayload Uses

type McGroupSetupReqPayload struct {
    McGroupIDHeader McGroupSetupReqPayloadMcGroupIDHeader
    McAddr          lorawan.DevAddr
    McKeyEncrypted  [16]byte
    MinMcFCnt       uint32
    MaxMcFCnt       uint32
}

McGroupSetupReqPayload implements the McGroupSetupReq payload.

func (McGroupSetupReqPayload) MarshalBinary Uses

func (p McGroupSetupReqPayload) MarshalBinary() ([]byte, error)

MarshalBinary encodes the payload to a slice of bytes.

func (McGroupSetupReqPayload) Size Uses

func (p McGroupSetupReqPayload) Size() int

Size returns the payload size in number of bytes.

func (*McGroupSetupReqPayload) UnmarshalBinary Uses

func (p *McGroupSetupReqPayload) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes the payload from a slice of bytes.

type McGroupSetupReqPayloadMcGroupIDHeader Uses

type McGroupSetupReqPayloadMcGroupIDHeader struct {
    McGroupID uint8
}

McGroupSetupReqPayloadMcGroupIDHeader implements the McGroupSetupReq payload McGroupIDHeader field.

type McGroupStatusAnsPayload Uses

type McGroupStatusAnsPayload struct {
    Status McGroupStatusAnsPayloadStatus
    Items  []McGroupStatusAnsPayloadItem
}

McGroupStatusAnsPayload implements the McGroupStatusAns payload.

func (McGroupStatusAnsPayload) MarshalBinary Uses

func (p McGroupStatusAnsPayload) MarshalBinary() ([]byte, error)

MarshalBinary encodes the payload to a slice of bytes.

func (McGroupStatusAnsPayload) Size Uses

func (p McGroupStatusAnsPayload) Size() int

Size returns the payload size in number of bytes.

func (*McGroupStatusAnsPayload) UnmarshalBinary Uses

func (p *McGroupStatusAnsPayload) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes the payload from a slice of bytes.

type McGroupStatusAnsPayloadItem Uses

type McGroupStatusAnsPayloadItem struct {
    McGroupID uint8
    McAddr    lorawan.DevAddr
}

McGroupStatusAnsPayloadItem implements an McGroupID + MacAddr item.

type McGroupStatusAnsPayloadStatus Uses

type McGroupStatusAnsPayloadStatus struct {
    NbTotalGroups uint8
    AnsGroupMask  [4]bool
}

McGroupStatusAnsPayloadStatus implements the McGroupStatusAns payload Status field.

type McGroupStatusReqPayload Uses

type McGroupStatusReqPayload struct {
    CmdMask McGroupStatusReqPayloadCmdMask
}

McGroupStatusReqPayload implements the McGroupStatusReq payload.

func (McGroupStatusReqPayload) MarshalBinary Uses

func (p McGroupStatusReqPayload) MarshalBinary() ([]byte, error)

MarshalBinary encodes the payload to a slice of bytes.

func (McGroupStatusReqPayload) Size Uses

func (p McGroupStatusReqPayload) Size() int

Size returns the payload size in number of bytes.

func (*McGroupStatusReqPayload) UnmarshalBinary Uses

func (p *McGroupStatusReqPayload) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes the payload from a slice of bytes.

type McGroupStatusReqPayloadCmdMask Uses

type McGroupStatusReqPayloadCmdMask struct {
    RegGroupMask [4]bool
}

McGroupStatusReqPayloadCmdMask implements the McGroupStatusReq payload CmdMask field.

type PackageVersionAnsPayload Uses

type PackageVersionAnsPayload struct {
    PackageIdentifier uint8
    PackageVersion    uint8
}

PackageVersionAnsPayload implements the PackageVersionAns payload.

func (PackageVersionAnsPayload) MarshalBinary Uses

func (p PackageVersionAnsPayload) MarshalBinary() ([]byte, error)

MarshalBinary encodes the payload to a slice of bytes.

func (PackageVersionAnsPayload) Size Uses

func (p PackageVersionAnsPayload) Size() int

Size returns the payload size in number of bytes.

func (*PackageVersionAnsPayload) UnmarshalBinary Uses

func (p *PackageVersionAnsPayload) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes the payload from a slice of bytes.

Package multicastsetup imports 6 packages (graph) and is imported by 6 packages. Updated 2019-11-26. Refresh now. Tools for package owners.