Documentation ¶
Overview ¶
Package types contains basic types that are used in The Things Network's protobuf messages.
Index ¶
- Variables
- func NwkAddrBits(netID NetID) uint
- func NwkAddrLength(netID NetID) int
- type AES128Key
- func (key AES128Key) Equal(other AES128Key) bool
- func (key AES128Key) GoString() string
- func (key *AES128Key) IsZero() bool
- func (key AES128Key) Marshal() ([]byte, error)
- func (key AES128Key) MarshalBinary() ([]byte, error)
- func (key AES128Key) MarshalJSON() ([]byte, error)
- func (key AES128Key) MarshalText() ([]byte, error)
- func (key AES128Key) MarshalTo(data []byte) (int, error)
- func (key AES128Key) Size() int
- func (key AES128Key) String() string
- func (key *AES128Key) Unmarshal(data []byte) error
- func (key *AES128Key) UnmarshalBinary(data []byte) error
- func (key *AES128Key) UnmarshalJSON(data []byte) error
- func (key *AES128Key) UnmarshalText(data []byte) error
- type DevAddr
- func (addr DevAddr) Copy(x *DevAddr) *DevAddr
- func (addr DevAddr) Equal(other DevAddr) bool
- func (addr DevAddr) GoString() string
- func (addr DevAddr) HasPrefix(prefix DevAddrPrefix) bool
- func (addr DevAddr) HasValidNetIDType() bool
- func (addr DevAddr) IsZero() bool
- func (addr DevAddr) Marshal() ([]byte, error)
- func (addr DevAddr) MarshalBinary() ([]byte, error)
- func (addr DevAddr) MarshalJSON() ([]byte, error)
- func (addr DevAddr) MarshalNumber() uint32
- func (addr DevAddr) MarshalText() ([]byte, error)
- func (addr DevAddr) MarshalTo(data []byte) (int, error)
- func (addr DevAddr) Mask(bits uint8) (masked DevAddr)
- func (addr DevAddr) NetIDType() byte
- func (addr DevAddr) NwkAddr() []byte
- func (addr DevAddr) NwkID() []byte
- func (addr DevAddr) Size() int
- func (addr DevAddr) String() string
- func (addr *DevAddr) Unmarshal(data []byte) error
- func (addr *DevAddr) UnmarshalBinary(data []byte) error
- func (addr *DevAddr) UnmarshalJSON(data []byte) error
- func (addr *DevAddr) UnmarshalNumber(n uint32)
- func (addr *DevAddr) UnmarshalText(data []byte) error
- func (addr DevAddr) WithPrefix(prefix DevAddrPrefix) (prefixed DevAddr)
- type DevAddrPrefix
- func (prefix DevAddrPrefix) ConfigString() string
- func (prefix DevAddrPrefix) Equal(other DevAddrPrefix) bool
- func (prefix DevAddrPrefix) GoString() string
- func (prefix DevAddrPrefix) IsZero() bool
- func (prefix DevAddrPrefix) Marshal() ([]byte, error)
- func (prefix DevAddrPrefix) MarshalBinary() ([]byte, error)
- func (prefix DevAddrPrefix) MarshalJSON() ([]byte, error)
- func (prefix DevAddrPrefix) MarshalText() ([]byte, error)
- func (prefix DevAddrPrefix) MarshalTo(data []byte) (int, error)
- func (prefix DevAddrPrefix) Matches(addr DevAddr) bool
- func (prefix DevAddrPrefix) Size() int
- func (prefix DevAddrPrefix) String() string
- func (prefix *DevAddrPrefix) Unmarshal(data []byte) error
- func (prefix *DevAddrPrefix) UnmarshalBinary(data []byte) error
- func (prefix *DevAddrPrefix) UnmarshalConfigString(s string) error
- func (prefix *DevAddrPrefix) UnmarshalJSON(data []byte) error
- func (prefix *DevAddrPrefix) UnmarshalText(data []byte) error
- type DevNonce
- func (dn DevNonce) Equal(other DevNonce) bool
- func (dn DevNonce) GoString() string
- func (dn DevNonce) IsZero() bool
- func (dn DevNonce) Marshal() ([]byte, error)
- func (dn DevNonce) MarshalBinary() ([]byte, error)
- func (dn DevNonce) MarshalJSON() ([]byte, error)
- func (dn DevNonce) MarshalNumber() uint16
- func (dn DevNonce) MarshalText() ([]byte, error)
- func (dn DevNonce) MarshalTo(data []byte) (int, error)
- func (dn DevNonce) Size() int
- func (dn DevNonce) String() string
- func (dn *DevNonce) Unmarshal(data []byte) error
- func (dn *DevNonce) UnmarshalBinary(data []byte) error
- func (dn *DevNonce) UnmarshalJSON(data []byte) error
- func (dn *DevNonce) UnmarshalNumber(n uint16)
- func (dn *DevNonce) UnmarshalText(data []byte) error
- type EUI64
- func (eui EUI64) Copy(x *EUI64) *EUI64
- func (eui EUI64) Equal(other EUI64) bool
- func (eui EUI64) GoString() string
- func (eui EUI64) HasPrefix(prefix EUI64Prefix) bool
- func (eui EUI64) IsZero() bool
- func (eui EUI64) Marshal() ([]byte, error)
- func (eui EUI64) MarshalBinary() ([]byte, error)
- func (eui EUI64) MarshalJSON() ([]byte, error)
- func (eui EUI64) MarshalNumber() uint64
- func (eui EUI64) MarshalText() ([]byte, error)
- func (eui EUI64) MarshalTo(data []byte) (int, error)
- func (eui EUI64) Mask(bits uint8) (masked EUI64)
- func (eui EUI64) Size() int
- func (eui EUI64) String() string
- func (eui *EUI64) Unmarshal(data []byte) error
- func (eui *EUI64) UnmarshalBinary(data []byte) error
- func (eui *EUI64) UnmarshalJSON(data []byte) error
- func (eui *EUI64) UnmarshalNumber(n uint64)
- func (eui *EUI64) UnmarshalText(data []byte) error
- func (eui EUI64) WithPrefix(prefix EUI64Prefix) (prefixed EUI64)
- type EUI64Prefix
- func (prefix EUI64Prefix) ConfigString() string
- func (prefix EUI64Prefix) Equal(other EUI64Prefix) bool
- func (prefix EUI64Prefix) GoString() string
- func (prefix EUI64Prefix) IsZero() bool
- func (prefix EUI64Prefix) Marshal() ([]byte, error)
- func (prefix EUI64Prefix) MarshalBinary() ([]byte, error)
- func (prefix EUI64Prefix) MarshalJSON() ([]byte, error)
- func (prefix EUI64Prefix) MarshalText() ([]byte, error)
- func (prefix EUI64Prefix) MarshalTo(data []byte) (int, error)
- func (prefix EUI64Prefix) Matches(eui EUI64) bool
- func (prefix EUI64Prefix) Size() int
- func (prefix EUI64Prefix) String() string
- func (prefix *EUI64Prefix) Unmarshal(data []byte) error
- func (prefix *EUI64Prefix) UnmarshalBinary(data []byte) error
- func (prefix *EUI64Prefix) UnmarshalConfigString(s string) error
- func (prefix *EUI64Prefix) UnmarshalJSON(data []byte) error
- func (prefix *EUI64Prefix) UnmarshalText(data []byte) error
- type Interface
- type JoinNonce
- func (jn JoinNonce) Equal(other JoinNonce) bool
- func (jn JoinNonce) GoString() string
- func (jn JoinNonce) IsZero() bool
- func (jn JoinNonce) Marshal() ([]byte, error)
- func (jn JoinNonce) MarshalBinary() ([]byte, error)
- func (jn JoinNonce) MarshalJSON() ([]byte, error)
- func (jn JoinNonce) MarshalText() ([]byte, error)
- func (jn JoinNonce) MarshalTo(data []byte) (int, error)
- func (jn JoinNonce) Size() int
- func (jn JoinNonce) String() string
- func (jn *JoinNonce) Unmarshal(data []byte) error
- func (jn *JoinNonce) UnmarshalBinary(data []byte) error
- func (jn *JoinNonce) UnmarshalJSON(data []byte) error
- func (jn *JoinNonce) UnmarshalText(data []byte) error
- type NetID
- func (id NetID) Copy(x *NetID) *NetID
- func (id NetID) Equal(other NetID) bool
- func (id NetID) GoString() string
- func (id NetID) ID() []byte
- func (id NetID) IDBits() uint
- func (id NetID) IsZero() bool
- func (id NetID) Marshal() ([]byte, error)
- func (id NetID) MarshalBinary() ([]byte, error)
- func (id NetID) MarshalJSON() ([]byte, error)
- func (id NetID) MarshalNumber() uint32
- func (id NetID) MarshalText() ([]byte, error)
- func (id NetID) MarshalTo(data []byte) (int, error)
- func (id NetID) Size() int
- func (id NetID) String() string
- func (id NetID) Type() byte
- func (id *NetID) Unmarshal(data []byte) error
- func (id *NetID) UnmarshalBinary(data []byte) error
- func (id *NetID) UnmarshalJSON(data []byte) error
- func (id *NetID) UnmarshalNumber(netID uint32) error
- func (id *NetID) UnmarshalText(data []byte) error
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var MaxDevAddr = DevAddr{0xFF, 0xFF, 0xFF, 0xFF}
MaxDevAddr is the highest value possible for a DevAddr.
var MinDevAddr = DevAddr{0x00, 0x00, 0x00, 0x00}
MinDevAddr is the lowest value possible for a DevAddr.
Functions ¶
func NwkAddrBits ¶
NwkAddrBits returns the length of NwkAddr field of netID in bits.
func NwkAddrLength ¶
NwkAddrLength returns the length of NwkAddr field of netID in bytes.
Types ¶
type AES128Key ¶
type AES128Key [16]byte
AES128Key is an 128-bit AES key.
func NewPopulatedAES128Key ¶
func NewPopulatedAES128Key(r randy) *AES128Key
NewPopulatedAES128Key returns a random AES128Key.
func (AES128Key) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (AES128Key) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (AES128Key) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (AES128Key) MarshalTo ¶
MarshalTo implements the MarshalerTo function required by generated protobuf.
func (*AES128Key) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*AES128Key) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*AES128Key) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type DevAddr ¶
type DevAddr [4]byte
DevAddr is a 32-bit LoRaWAN device address.
func NewDevAddr ¶
NewDevAddr returns new DevAddr.
func NewPopulatedDevAddr ¶
func NewPopulatedDevAddr(r randy) *DevAddr
NewPopulatedDevAddr returns a random DevAddr.
func (DevAddr) HasPrefix ¶
func (addr DevAddr) HasPrefix(prefix DevAddrPrefix) bool
HasPrefix returns true iff the DevAddr has a prefix of given length.
func (DevAddr) HasValidNetIDType ¶
HasValidNetIDType returns true if the DevAddr has NetID type, which is valid and compliant with LoRaWAN specification.
func (DevAddr) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (DevAddr) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (DevAddr) MarshalNumber ¶
MarshalNumber returns the DevAddr in a decimal form.
func (DevAddr) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
Example ¶
devAddr := DevAddr{0x26, 0x01, 0x26, 0xB4} text, err := devAddr.MarshalText() if err != nil { panic(err) } fmt.Println(string(text))
Output: 260126B4
func (DevAddr) MarshalTo ¶
MarshalTo implements the MarshalerTo function required by generated protobuf.
func (DevAddr) Mask ¶
Mask returns a copy of the DevAddr with only the first "bits" bits.
Example ¶
devAddr := DevAddr{0x26, 0x01, 0x26, 0xB4} devAddrMasked := devAddr.Mask(16) devAddr2 := DevAddr{0x26, 0x01, 0x00, 0x00} fmt.Println(devAddrMasked == devAddr2)
Output: true
func (DevAddr) NwkID ¶
NwkID returns NwkID of the DevAddr.
Example ¶
devAddr := DevAddr{0x26, 0x01, 0x26, 0xB4} fmt.Printf("%#x", devAddr.NwkID())
Output: 0x13
func (*DevAddr) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*DevAddr) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*DevAddr) UnmarshalNumber ¶
UnmarshalNumber retrieves a DevAddr from a decimal form.
func (*DevAddr) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
Example ¶
var devAddr DevAddr err := devAddr.UnmarshalText([]byte("2601A3C2")) if err != nil { panic(err) } devAddr2 := DevAddr{0x26, 0x01, 0xa3, 0xc2} fmt.Println(devAddr == devAddr2)
Output: true
func (DevAddr) WithPrefix ¶
func (addr DevAddr) WithPrefix(prefix DevAddrPrefix) (prefixed DevAddr)
WithPrefix returns the DevAddr, but with the first length bits replaced by the Prefix.
type DevAddrPrefix ¶
DevAddrPrefix is a DevAddr with a prefix length.
func NewPopulatedDevAddrPrefix ¶
func NewPopulatedDevAddrPrefix(r randy) *DevAddrPrefix
NewPopulatedDevAddrPrefix returns a random DevAddrPrefix.
func (DevAddrPrefix) ConfigString ¶
func (prefix DevAddrPrefix) ConfigString() string
ConfigString implements the config.Stringer interface.
func (DevAddrPrefix) Equal ¶
func (prefix DevAddrPrefix) Equal(other DevAddrPrefix) bool
Equal returns true iff prefixes are equal.
func (DevAddrPrefix) GoString ¶
func (prefix DevAddrPrefix) GoString() string
GoString implements the GoStringer interface.
func (DevAddrPrefix) IsZero ¶
func (prefix DevAddrPrefix) IsZero() bool
IsZero returns true iff the type is zero.
func (DevAddrPrefix) Marshal ¶
func (prefix DevAddrPrefix) Marshal() ([]byte, error)
Marshal implements the proto.Marshaler interface.
func (DevAddrPrefix) MarshalBinary ¶
func (prefix DevAddrPrefix) MarshalBinary() ([]byte, error)
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (DevAddrPrefix) MarshalJSON ¶
func (prefix DevAddrPrefix) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (DevAddrPrefix) MarshalText ¶
func (prefix DevAddrPrefix) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface.
func (DevAddrPrefix) MarshalTo ¶
func (prefix DevAddrPrefix) MarshalTo(data []byte) (int, error)
MarshalTo implements the MarshalerTo function required by generated protobuf.
func (DevAddrPrefix) Matches ¶
func (prefix DevAddrPrefix) Matches(addr DevAddr) bool
Matches returns true iff the DevAddr matches the prefix.
Example ¶
devAddr := DevAddr{0x26, 0x00, 0x26, 0xB4} devAddr2 := DevAddr{0x26, 0x2a, 0x26, 0x8e} devAddrPrefix := DevAddrPrefix{ DevAddr: DevAddr{0x26, 0x00, 0x00, 0x00}, Length: 16, } fmt.Println(devAddrPrefix.Matches(devAddr)) fmt.Println(devAddrPrefix.Matches(devAddr2))
Output: true false
func (DevAddrPrefix) Size ¶
func (prefix DevAddrPrefix) Size() int
Size implements the Sizer interface.
func (DevAddrPrefix) String ¶
func (prefix DevAddrPrefix) String() string
String implements the Stringer interface.
func (*DevAddrPrefix) Unmarshal ¶
func (prefix *DevAddrPrefix) Unmarshal(data []byte) error
Unmarshal implements the proto.Unmarshaler interface.
func (*DevAddrPrefix) UnmarshalBinary ¶
func (prefix *DevAddrPrefix) UnmarshalBinary(data []byte) error
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*DevAddrPrefix) UnmarshalConfigString ¶
func (prefix *DevAddrPrefix) UnmarshalConfigString(s string) error
UnmarshalConfigString implements the config.Configurable interface.
func (*DevAddrPrefix) UnmarshalJSON ¶
func (prefix *DevAddrPrefix) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
func (*DevAddrPrefix) UnmarshalText ¶
func (prefix *DevAddrPrefix) UnmarshalText(data []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type DevNonce ¶
type DevNonce [2]byte
DevNonce is device nonce used in the join procedure. - If LoRaWAN version <1.1 - it is randomly generated. - If LoRaWAN version >=1.1 - it is a scrictly increasing counter.
func NewPopulatedDevNonce ¶
func NewPopulatedDevNonce(r randy) *DevNonce
NewPopulatedDevNonce returns a random DevNonce.
func (DevNonce) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (DevNonce) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (DevNonce) MarshalNumber ¶
MarshalNumber returns the DevNonce in decimal form.
func (DevNonce) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (DevNonce) MarshalTo ¶
MarshalTo implements the MarshalerTo function required by generated protobuf.
func (*DevNonce) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*DevNonce) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*DevNonce) UnmarshalNumber ¶
UnmarshalNumber retrieves the DevNonce from decimal form.
func (*DevNonce) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type EUI64 ¶
type EUI64 [8]byte
EUI64 is a 64-bit Extended Unique Identifier.
func NewPopulatedEUI64 ¶
func NewPopulatedEUI64(r randy) *EUI64
NewPopulatedEUI64 returns a random EUI64.
func (EUI64) HasPrefix ¶
func (eui EUI64) HasPrefix(prefix EUI64Prefix) bool
HasPrefix returns true iff the EUI64 has a prefix of given length.
func (EUI64) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (EUI64) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (EUI64) MarshalNumber ¶
MarshalNumber returns the EUI64 in a decimal form.
func (EUI64) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (EUI64) MarshalTo ¶
MarshalTo implements the MarshalerTo function required by generated protobuf.
func (*EUI64) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*EUI64) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*EUI64) UnmarshalNumber ¶
UnmarshalNumber retrieves a EUI64 from a decimal form.
func (*EUI64) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (EUI64) WithPrefix ¶
func (eui EUI64) WithPrefix(prefix EUI64Prefix) (prefixed EUI64)
WithPrefix returns the EUI64, but with the first length bits replaced by the Prefix.
type EUI64Prefix ¶
EUI64Prefix is an EUI64 with a prefix length.
func (EUI64Prefix) ConfigString ¶
func (prefix EUI64Prefix) ConfigString() string
ConfigString implements the config.Stringer interface.
func (EUI64Prefix) Equal ¶
func (prefix EUI64Prefix) Equal(other EUI64Prefix) bool
Equal returns true iff prefixes are equal.
func (EUI64Prefix) GoString ¶
func (prefix EUI64Prefix) GoString() string
GoString implements the GoStringer interface.
func (EUI64Prefix) IsZero ¶
func (prefix EUI64Prefix) IsZero() bool
IsZero returns true iff the type is zero.
func (EUI64Prefix) Marshal ¶
func (prefix EUI64Prefix) Marshal() ([]byte, error)
Marshal implements the proto.Marshaler interface.
func (EUI64Prefix) MarshalBinary ¶
func (prefix EUI64Prefix) MarshalBinary() ([]byte, error)
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (EUI64Prefix) MarshalJSON ¶
func (prefix EUI64Prefix) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (EUI64Prefix) MarshalText ¶
func (prefix EUI64Prefix) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface.
func (EUI64Prefix) MarshalTo ¶
func (prefix EUI64Prefix) MarshalTo(data []byte) (int, error)
MarshalTo implements the MarshalerTo function required by generated protobuf.
func (EUI64Prefix) Matches ¶
func (prefix EUI64Prefix) Matches(eui EUI64) bool
Matches returns true iff the EUI64 matches the prefix.
func (EUI64Prefix) String ¶
func (prefix EUI64Prefix) String() string
String implements the Stringer interface.
func (*EUI64Prefix) Unmarshal ¶
func (prefix *EUI64Prefix) Unmarshal(data []byte) error
Unmarshal implements the proto.Unmarshaler interface.
func (*EUI64Prefix) UnmarshalBinary ¶
func (prefix *EUI64Prefix) UnmarshalBinary(data []byte) error
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*EUI64Prefix) UnmarshalConfigString ¶
func (prefix *EUI64Prefix) UnmarshalConfigString(s string) error
UnmarshalConfigString implements the config.Configurable interface.
func (*EUI64Prefix) UnmarshalJSON ¶
func (prefix *EUI64Prefix) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
func (*EUI64Prefix) UnmarshalText ¶
func (prefix *EUI64Prefix) UnmarshalText(data []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Interface ¶
type Interface interface { IsZero() bool String() string GoString() string Size() int Marshal() ([]byte, error) MarshalTo(data []byte) (int, error) Unmarshal(data []byte) error MarshalJSON() ([]byte, error) UnmarshalJSON(data []byte) error MarshalBinary() ([]byte, error) UnmarshalBinary(data []byte) error MarshalText() ([]byte, error) UnmarshalText(data []byte) error }
Interface all types in pkg/types must implement.
type JoinNonce ¶
type JoinNonce [3]byte
JoinNonce is Join Server nonce used in the join procedure. - If LoRaWAN version <1.1 - it is randomly generated. - If LoRaWAN version >=1.1 - it is a scrictly increasing counter.
func NewPopulatedJoinNonce ¶
func NewPopulatedJoinNonce(r randy) *JoinNonce
NewPopulatedJoinNonce returns a random JoinNonce.
func (JoinNonce) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (JoinNonce) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (JoinNonce) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (JoinNonce) MarshalTo ¶
MarshalTo implements the MarshalerTo function required by generated protobuf.
func (*JoinNonce) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*JoinNonce) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*JoinNonce) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type NetID ¶
type NetID [3]byte
NetID is issued by the LoRa Alliance.
func NewPopulatedNetID ¶
func NewPopulatedNetID(r randy) *NetID
NewPopulatedNetID returns a random NetID.
func (NetID) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (NetID) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (NetID) MarshalNumber ¶
MarshalNumber returns the numeric value.
func (NetID) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (NetID) MarshalTo ¶
MarshalTo implements the MarshalerTo function required by generated protobuf.
func (*NetID) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*NetID) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*NetID) UnmarshalNumber ¶
UnmarshalNumber unmarshals the NetID from a numeric value.
func (*NetID) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.