Documentation ¶
Overview ¶
Package mhdr contains LoRaWAN MAC Header related stuff.
The MAC header specifies the message type (MType) and according to which major version (Major) of the frame format of the LoRaWAN layer specification the frame has been encoded.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MHDR ¶
type MHDR interface { //String returns a MAC header into a string String() string //ByteArray returns a MAC header into a byte array ByteArray() []byte //MType returns message type MType() MType //Major returns major version Major() MajorVersion }
MHDR is accessed returns an os.FileInfo for the FileHeader.
type MType ¶
type MType byte
MType represents the message type
Example ¶
package main import ( "fmt" "github.com/tkiraly/lorawan/mhdr" ) func main() { m := mhdr.New(mhdr.ConfirmedDataDownMessageType, mhdr.LoRaWANR1MajorVersion) fmt.Printf("%s", m.MType()) }
Output: ConfirmedDataDownMessageType
const ( JoinRequestMessageType MType = iota JoinAcceptMessageType UnconfirmedDataUpMessageType UnconfirmedDataDownMessageType ConfirmedDataUpMessageType ConfirmedDataDownMessageType RFUMessageType ProprietaryMessageType )
The LoRaWAN distinguishes between six different MAC message types: join request, join accept, unconfirmed data up/down, and confirmed data up/down.
type MajorVersion ¶
type MajorVersion byte
MajorVersion represents the major version
const (
LoRaWANR1MajorVersion MajorVersion = iota
)
represents the Major version
func (MajorVersion) String ¶
func (i MajorVersion) String() string
Click to show internal directories.
Click to hide internal directories.