Documentation ¶
Overview ¶
Package multicastsetup implements the Remote Multicast Setup v1.0.0 over LoRaWAN.
Index ¶
- Constants
- Variables
- func GetMcAppSKey(mcKey lorawan.AES128Key, mcAddr lorawan.DevAddr) (lorawan.AES128Key, error)
- func GetMcKEKey(mcRootKey lorawan.AES128Key) (lorawan.AES128Key, error)
- func GetMcNetSKey(mcKey lorawan.AES128Key, mcAddr lorawan.DevAddr) (lorawan.AES128Key, error)
- func GetMcRootKeyForAppKey(appKey lorawan.AES128Key) (lorawan.AES128Key, error)
- func GetMcRootKeyForGenAppKey(genAppKey lorawan.AES128Key) (lorawan.AES128Key, error)
- type CID
- type Command
- type CommandPayload
- type Commands
- type McClassBSessionAnsPayload
- type McClassBSessionAnsPayloadStatusAndMcGroupID
- type McClassBSessionReqPayload
- type McClassBSessionReqPayloadMcGroupIDHeader
- type McClassBSessionReqPayloadTimeOutPeriodicity
- type McClassCSessionAnsPayload
- type McClassCSessionAnsPayloadStatusAndMcGroupID
- type McClassCSessionReqPayload
- type McClassCSessionReqPayloadMcGroupIDHeader
- type McClassCSessionReqPayloadSessionTimeOut
- type McGroupDeleteAnsPayload
- type McGroupDeleteAnsPayloadMcGroupIDHeader
- type McGroupDeleteReqPayload
- type McGroupDeleteReqPayloadMcGroupIDHeader
- type McGroupSetupAnsPayload
- type McGroupSetupAnsPayloadMcGroupIDHeader
- type McGroupSetupReqPayload
- type McGroupSetupReqPayloadMcGroupIDHeader
- type McGroupStatusAnsPayload
- type McGroupStatusAnsPayloadItem
- type McGroupStatusAnsPayloadStatus
- type McGroupStatusReqPayload
- type McGroupStatusReqPayloadCmdMask
- type PackageVersionAnsPayload
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
Functions ¶
func GetMcAppSKey ¶
GetMcAppSKey returns the McAppSKey given the McKey and McAddr.
func GetMcKEKey ¶
GetMcKEKey returns the McKEKey given the McRootKey.
func GetMcNetSKey ¶
GetMcNetSKey returns the McNetSKey given the McKey and McAddr.
func GetMcRootKeyForAppKey ¶
GetMcRootKeyForAppKey returns the McRootKey given an AppKey. Note: The AppKey is only used for LoRaWAN 1.1.x devices.
Types ¶
type CID ¶
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.
type Command ¶
type Command struct { CID CID Payload CommandPayload }
Command defines the Command structure.
func (Command) MarshalBinary ¶
MarshalBinary encodes the command to a slice of bytes.
type CommandPayload ¶
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 ¶
func GetCommandPayload(uplink bool, c CID) (CommandPayload, error)
GetCommandPayload returns a new CommandPayload for the given CID.
type Commands ¶
type Commands []Command
Commands defines a slice of commands.
func (Commands) MarshalBinary ¶
MarshalBinary encodes the commands to a slice of bytes.
type McClassBSessionAnsPayload ¶
type McClassBSessionAnsPayload struct { StatusAndMcGroupID McClassBSessionAnsPayloadStatusAndMcGroupID TimeToStart *uint32 }
McClassBSessionAnsPayload implements the McClassBSessionAns payload.
func (McClassBSessionAnsPayload) MarshalBinary ¶
func (p McClassBSessionAnsPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (McClassBSessionAnsPayload) Size ¶
func (p McClassBSessionAnsPayload) Size() int
Size returns the payload size in number of bytes.
func (*McClassBSessionAnsPayload) UnmarshalBinary ¶
func (p *McClassBSessionAnsPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes the payload from a slice of bytes.
type McClassBSessionAnsPayloadStatusAndMcGroupID ¶
type McClassBSessionAnsPayloadStatusAndMcGroupID struct { McGroupUndefined bool FreqError bool DRError bool McGroupID uint8 }
McClassBSessionAnsPayloadStatusAndMcGroupID implements the McClassBSessionAns payload StatusAndMcGroupID field.
type McClassBSessionReqPayload ¶
type McClassBSessionReqPayload struct { McGroupIDHeader McClassBSessionReqPayloadMcGroupIDHeader SessionTime uint32 TimeOutPeriodicity McClassBSessionReqPayloadTimeOutPeriodicity DLFrequency uint32 DR uint8 }
McClassBSessionReqPayload implements the McClassBSessionReq payload.
func (McClassBSessionReqPayload) MarshalBinary ¶
func (p McClassBSessionReqPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (McClassBSessionReqPayload) Size ¶
func (p McClassBSessionReqPayload) Size() int
Size returns the payload size in number of bytes.
func (*McClassBSessionReqPayload) UnmarshalBinary ¶
func (p *McClassBSessionReqPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes the payload from a slice of bytes.
type McClassBSessionReqPayloadMcGroupIDHeader ¶
type McClassBSessionReqPayloadMcGroupIDHeader struct {
McGroupID uint8
}
McClassBSessionReqPayloadMcGroupIDHeader implements the McClassBSessionReq payload McGroupIDHeader field.
type McClassBSessionReqPayloadTimeOutPeriodicity ¶
McClassBSessionReqPayloadTimeOutPeriodicity implements the McClassBSessionReq payload TimeOutPeriodicity field.
type McClassCSessionAnsPayload ¶
type McClassCSessionAnsPayload struct { StatusAndMcGroupID McClassCSessionAnsPayloadStatusAndMcGroupID TimeToStart *uint32 }
McClassCSessionAnsPayload implements the McClassCSessionAns payload.
func (McClassCSessionAnsPayload) MarshalBinary ¶
func (p McClassCSessionAnsPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (McClassCSessionAnsPayload) Size ¶
func (p McClassCSessionAnsPayload) Size() int
Size returns the payload size in number of bytes.
func (*McClassCSessionAnsPayload) UnmarshalBinary ¶
func (p *McClassCSessionAnsPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes the payload from a slice of bytes.
type McClassCSessionAnsPayloadStatusAndMcGroupID ¶
type McClassCSessionAnsPayloadStatusAndMcGroupID struct { McGroupUndefined bool FreqError bool DRError bool McGroupID uint8 }
McClassCSessionAnsPayloadStatusAndMcGroupID implements the McClassCSessionAns payload StatusAndMcGroupID field.
type McClassCSessionReqPayload ¶
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 ¶
func (p McClassCSessionReqPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (*McClassCSessionReqPayload) Size ¶
func (p *McClassCSessionReqPayload) Size() int
Size returns the payload size in number of bytes.
func (*McClassCSessionReqPayload) UnmarshalBinary ¶
func (p *McClassCSessionReqPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes the payload from a slice of bytes.
type McClassCSessionReqPayloadMcGroupIDHeader ¶
type McClassCSessionReqPayloadMcGroupIDHeader struct {
McGroupID uint8
}
McClassCSessionReqPayloadMcGroupIDHeader implements the McClassCSessionReq payload McGroupIDHeader field.
type McClassCSessionReqPayloadSessionTimeOut ¶
type McClassCSessionReqPayloadSessionTimeOut struct {
TimeOut uint8 // the actual value in seconds is 2^TimeOut
}
McClassCSessionReqPayloadSessionTimeOut implements the McClassCSessionReq payload SessionTimeOut field.
type McGroupDeleteAnsPayload ¶
type McGroupDeleteAnsPayload struct {
McGroupIDHeader McGroupDeleteAnsPayloadMcGroupIDHeader
}
McGroupDeleteAnsPayload implements the McGroupDeleteAns payload.
func (McGroupDeleteAnsPayload) MarshalBinary ¶
func (p McGroupDeleteAnsPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (McGroupDeleteAnsPayload) Size ¶
func (p McGroupDeleteAnsPayload) Size() int
Size returns the payload size in number of bytes.
func (*McGroupDeleteAnsPayload) UnmarshalBinary ¶
func (p *McGroupDeleteAnsPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes the payload from a slice of bytes.
type McGroupDeleteAnsPayloadMcGroupIDHeader ¶
McGroupDeleteAnsPayloadMcGroupIDHeader implements the McGroupDeleteAns payload McGroupIDHeader field.
type McGroupDeleteReqPayload ¶
type McGroupDeleteReqPayload struct {
McGroupIDHeader McGroupDeleteReqPayloadMcGroupIDHeader
}
McGroupDeleteReqPayload implements the McGroupDeleteReq payload.
func (McGroupDeleteReqPayload) MarshalBinary ¶
func (p McGroupDeleteReqPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (McGroupDeleteReqPayload) Size ¶
func (p McGroupDeleteReqPayload) Size() int
Size returns the payload size in number of bytes.
func (*McGroupDeleteReqPayload) UnmarshalBinary ¶
func (p *McGroupDeleteReqPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes the payload from a slice of bytes.
type McGroupDeleteReqPayloadMcGroupIDHeader ¶
type McGroupDeleteReqPayloadMcGroupIDHeader struct {
McGroupID uint8
}
McGroupDeleteReqPayloadMcGroupIDHeader implements the McGroupDeleteReq payload McGroupIDHeader field.
type McGroupSetupAnsPayload ¶
type McGroupSetupAnsPayload struct {
McGroupIDHeader McGroupSetupAnsPayloadMcGroupIDHeader
}
McGroupSetupAnsPayload implements the McGroupSetupAns payload.
func (McGroupSetupAnsPayload) MarshalBinary ¶
func (p McGroupSetupAnsPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (McGroupSetupAnsPayload) Size ¶
func (p McGroupSetupAnsPayload) Size() int
Size returns the payload size in number of bytes.
func (*McGroupSetupAnsPayload) UnmarshalBinary ¶
func (p *McGroupSetupAnsPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes the payload from a slice of bytes.
type McGroupSetupAnsPayloadMcGroupIDHeader ¶
McGroupSetupAnsPayloadMcGroupIDHeader implements the McGroupSetupAns payload GroupIDHeader field.
type McGroupSetupReqPayload ¶
type McGroupSetupReqPayload struct { McGroupIDHeader McGroupSetupReqPayloadMcGroupIDHeader McAddr lorawan.DevAddr McKeyEncrypted [16]byte MinMcFCnt uint32 MaxMcFCnt uint32 }
McGroupSetupReqPayload implements the McGroupSetupReq payload.
func (McGroupSetupReqPayload) MarshalBinary ¶
func (p McGroupSetupReqPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (McGroupSetupReqPayload) Size ¶
func (p McGroupSetupReqPayload) Size() int
Size returns the payload size in number of bytes.
func (*McGroupSetupReqPayload) UnmarshalBinary ¶
func (p *McGroupSetupReqPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes the payload from a slice of bytes.
type McGroupSetupReqPayloadMcGroupIDHeader ¶
type McGroupSetupReqPayloadMcGroupIDHeader struct {
McGroupID uint8
}
McGroupSetupReqPayloadMcGroupIDHeader implements the McGroupSetupReq payload McGroupIDHeader field.
type McGroupStatusAnsPayload ¶
type McGroupStatusAnsPayload struct { Status McGroupStatusAnsPayloadStatus Items []McGroupStatusAnsPayloadItem }
McGroupStatusAnsPayload implements the McGroupStatusAns payload.
func (McGroupStatusAnsPayload) MarshalBinary ¶
func (p McGroupStatusAnsPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (McGroupStatusAnsPayload) Size ¶
func (p McGroupStatusAnsPayload) Size() int
Size returns the payload size in number of bytes.
func (*McGroupStatusAnsPayload) UnmarshalBinary ¶
func (p *McGroupStatusAnsPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes the payload from a slice of bytes.
type McGroupStatusAnsPayloadItem ¶
McGroupStatusAnsPayloadItem implements an McGroupID + MacAddr item.
type McGroupStatusAnsPayloadStatus ¶
McGroupStatusAnsPayloadStatus implements the McGroupStatusAns payload Status field.
type McGroupStatusReqPayload ¶
type McGroupStatusReqPayload struct {
CmdMask McGroupStatusReqPayloadCmdMask
}
McGroupStatusReqPayload implements the McGroupStatusReq payload.
func (McGroupStatusReqPayload) MarshalBinary ¶
func (p McGroupStatusReqPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (McGroupStatusReqPayload) Size ¶
func (p McGroupStatusReqPayload) Size() int
Size returns the payload size in number of bytes.
func (*McGroupStatusReqPayload) UnmarshalBinary ¶
func (p *McGroupStatusReqPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes the payload from a slice of bytes.
type McGroupStatusReqPayloadCmdMask ¶
type McGroupStatusReqPayloadCmdMask struct {
RegGroupMask [4]bool
}
McGroupStatusReqPayloadCmdMask implements the McGroupStatusReq payload CmdMask field.
type PackageVersionAnsPayload ¶
PackageVersionAnsPayload implements the PackageVersionAns payload.
func (PackageVersionAnsPayload) MarshalBinary ¶
func (p PackageVersionAnsPayload) MarshalBinary() ([]byte, error)
MarshalBinary encodes the payload to a slice of bytes.
func (PackageVersionAnsPayload) Size ¶
func (p PackageVersionAnsPayload) Size() int
Size returns the payload size in number of bytes.
func (*PackageVersionAnsPayload) UnmarshalBinary ¶
func (p *PackageVersionAnsPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes the payload from a slice of bytes.