Documentation ¶
Index ¶
- func ParseHEX(input string, length int) ([]byte, error)
- type AES128Key
- func (key AES128Key) Bytes() []byte
- func (key AES128Key) GoString() string
- func (key AES128Key) IsEmpty() bool
- func (key AES128Key) Marshal() ([]byte, error)
- func (key AES128Key) MarshalBinary() ([]byte, error)
- func (key AES128Key) MarshalText() ([]byte, error)
- func (key *AES128Key) MarshalTo(b []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) UnmarshalText(data []byte) error
- type AccessKey
- type Activation
- type ActivationEventData
- type AppEUI
- func (eui AppEUI) Bytes() []byte
- func (eui AppEUI) GoString() string
- func (eui AppEUI) IsEmpty() bool
- func (eui AppEUI) Marshal() ([]byte, error)
- func (eui AppEUI) MarshalBinary() ([]byte, error)
- func (eui AppEUI) MarshalText() ([]byte, error)
- func (eui *AppEUI) MarshalTo(b []byte) (int, error)
- func (eui *AppEUI) Size() int
- func (eui AppEUI) String() string
- func (eui *AppEUI) Unmarshal(data []byte) error
- func (eui *AppEUI) UnmarshalBinary(data []byte) error
- func (eui *AppEUI) UnmarshalText(data []byte) error
- type AppKey
- func (key AppKey) Bytes() []byte
- func (key AppKey) GoString() string
- func (key AppKey) IsEmpty() bool
- func (key AppKey) Marshal() ([]byte, error)
- func (key AppKey) MarshalBinary() ([]byte, error)
- func (key AppKey) MarshalText() ([]byte, error)
- func (key *AppKey) MarshalTo(b []byte) (int, error)
- func (key *AppKey) Size() int
- func (key AppKey) String() string
- func (key *AppKey) Unmarshal(data []byte) error
- func (key *AppKey) UnmarshalBinary(data []byte) error
- func (key *AppKey) UnmarshalText(data []byte) error
- type AppNonce
- func (n AppNonce) Bytes() []byte
- func (n AppNonce) GoString() string
- func (n AppNonce) Marshal() ([]byte, error)
- func (n AppNonce) MarshalBinary() ([]byte, error)
- func (n AppNonce) MarshalText() ([]byte, error)
- func (n *AppNonce) MarshalTo(b []byte) (int, error)
- func (n *AppNonce) Size() int
- func (n AppNonce) String() string
- func (n *AppNonce) Unmarshal(data []byte) error
- func (n *AppNonce) UnmarshalBinary(data []byte) error
- func (n *AppNonce) UnmarshalText(data []byte) error
- type AppSKey
- func (key AppSKey) Bytes() []byte
- func (key AppSKey) GoString() string
- func (key AppSKey) IsEmpty() bool
- func (key AppSKey) Marshal() ([]byte, error)
- func (key AppSKey) MarshalBinary() ([]byte, error)
- func (key AppSKey) MarshalText() ([]byte, error)
- func (key *AppSKey) MarshalTo(b []byte) (int, error)
- func (key *AppSKey) Size() int
- func (key AppSKey) String() string
- func (key *AppSKey) Unmarshal(data []byte) error
- func (key *AppSKey) UnmarshalBinary(data []byte) error
- func (key *AppSKey) UnmarshalText(data []byte) error
- type DataRate
- func (datr DataRate) Bytes() []byte
- func (datr DataRate) GoString() string
- func (datr DataRate) Marshal() ([]byte, error)
- func (datr DataRate) MarshalBinary() ([]byte, error)
- func (datr DataRate) MarshalText() ([]byte, error)
- func (datr DataRate) MarshalTo(b []byte) (int, error)
- func (datr DataRate) Size() int
- func (datr DataRate) String() string
- func (datr *DataRate) Unmarshal(data []byte) error
- func (datr *DataRate) UnmarshalBinary(data []byte) error
- func (datr *DataRate) UnmarshalText(data []byte) error
- type DevAddr
- func (addr DevAddr) Bytes() []byte
- func (addr DevAddr) GoString() string
- func (addr DevAddr) HasPrefix(prefix DevAddrPrefix) bool
- func (addr DevAddr) IsEmpty() bool
- func (addr DevAddr) Marshal() ([]byte, error)
- func (addr DevAddr) MarshalBinary() ([]byte, error)
- func (addr DevAddr) MarshalText() ([]byte, error)
- func (addr DevAddr) MarshalTo(b []byte) (int, error)
- func (addr DevAddr) Mask(bits int) (masked DevAddr)
- 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) UnmarshalText(data []byte) error
- func (addr DevAddr) WithPrefix(prefix DevAddrPrefix) (prefixed DevAddr)
- type DevAddrPrefix
- type DevEUI
- func (eui DevEUI) Bytes() []byte
- func (eui DevEUI) GoString() string
- func (eui DevEUI) IsEmpty() bool
- func (eui DevEUI) Marshal() ([]byte, error)
- func (eui DevEUI) MarshalBinary() ([]byte, error)
- func (eui DevEUI) MarshalText() ([]byte, error)
- func (eui *DevEUI) MarshalTo(b []byte) (int, error)
- func (eui *DevEUI) Size() int
- func (eui DevEUI) String() string
- func (eui *DevEUI) Unmarshal(data []byte) error
- func (eui *DevEUI) UnmarshalBinary(data []byte) error
- func (eui *DevEUI) UnmarshalText(data []byte) error
- type DevNonce
- func (n DevNonce) Bytes() []byte
- func (n DevNonce) GoString() string
- func (n DevNonce) Marshal() ([]byte, error)
- func (n DevNonce) MarshalBinary() ([]byte, error)
- func (n DevNonce) MarshalText() ([]byte, error)
- func (n *DevNonce) MarshalTo(b []byte) (int, error)
- func (n *DevNonce) Size() int
- func (n DevNonce) String() string
- func (n *DevNonce) Unmarshal(data []byte) error
- func (n *DevNonce) UnmarshalBinary(data []byte) error
- func (n *DevNonce) UnmarshalText(data []byte) error
- type DeviceEvent
- type DownlinkEventConfigInfo
- type DownlinkEventData
- type DownlinkMessage
- type EUI64
- func (eui EUI64) Bytes() []byte
- func (eui EUI64) GoString() string
- func (eui EUI64) IsEmpty() bool
- func (eui EUI64) Marshal() ([]byte, error)
- func (eui EUI64) MarshalBinary() ([]byte, error)
- func (eui EUI64) MarshalText() ([]byte, error)
- func (eui *EUI64) MarshalTo(b []byte) (int, error)
- 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) UnmarshalText(data []byte) error
- type ErrorEventData
- type EventType
- type GatewayMetadata
- type JSONTime
- type LocationMetadata
- type Metadata
- type NetID
- func (n NetID) Bytes() []byte
- func (n NetID) GoString() string
- func (n NetID) IsEmpty() bool
- func (n NetID) Marshal() ([]byte, error)
- func (n NetID) MarshalBinary() ([]byte, error)
- func (n NetID) MarshalText() ([]byte, error)
- func (n *NetID) MarshalTo(b []byte) (int, error)
- func (n *NetID) Size() int
- func (n NetID) String() string
- func (n *NetID) Unmarshal(data []byte) error
- func (n *NetID) UnmarshalBinary(data []byte) error
- func (n *NetID) UnmarshalText(data []byte) error
- type NwkSKey
- func (key NwkSKey) Bytes() []byte
- func (key NwkSKey) GoString() string
- func (key NwkSKey) IsEmpty() bool
- func (key NwkSKey) Marshal() ([]byte, error)
- func (key NwkSKey) MarshalBinary() ([]byte, error)
- func (key NwkSKey) MarshalText() ([]byte, error)
- func (key *NwkSKey) MarshalTo(b []byte) (int, error)
- func (key *NwkSKey) Size() int
- func (key NwkSKey) String() string
- func (key *NwkSKey) Unmarshal(data []byte) error
- func (key *NwkSKey) UnmarshalBinary(data []byte) error
- func (key *NwkSKey) UnmarshalText(data []byte) error
- type Right
- type UplinkMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AES128Key ¶
type AES128Key [16]byte
AES128Key is an 128 bit AES key.
func ParseAES128Key ¶
ParseAES128Key parses a 128-bit hex-encoded string to an AES128Key
func (AES128Key) MarshalBinary ¶
MarshalBinary implements the BinaryMarshaler interface.
func (AES128Key) MarshalText ¶
MarshalText implements the TextMarshaler interface.
func (*AES128Key) UnmarshalBinary ¶
UnmarshalBinary implements the BinaryUnmarshaler interface.
func (*AES128Key) UnmarshalText ¶
UnmarshalText implements the TextUnmarshaler interface.
type AccessKey ¶
type AccessKey struct { // The friendly name of the access key Name string `json:"name"` // The hard-to-guess access key Key string `json:"key"` // The rights associated with the key Rights []Right `json:"rights"` }
AccessKey is an access key that gives someone the right to do something with an application
type Activation ¶
type Activation struct { AppID string `json:"app_id,omitempty"` DevID string `json:"dev_id,omitempty"` AppEUI AppEUI `json:"app_eui,omitempty"` DevEUI DevEUI `json:"dev_eui,omitempty"` DevAddr DevAddr `json:"dev_addr,omitempty"` Metadata Metadata `json:"metadata,omitempty"` }
Activation messages are used to notify application of a device activation
type ActivationEventData ¶
type ActivationEventData struct { AppEUI AppEUI `json:"app_eui"` DevEUI DevEUI `json:"dev_eui"` DevAddr DevAddr `json:"dev_addr"` Metadata Metadata `json:"metadata"` }
ActivationEventData is added to activation events
type AppEUI ¶
type AppEUI EUI64
AppEUI is a unique identifier for applications.
func ParseAppEUI ¶
ParseAppEUI parses a 64-bit hex-encoded string to an AppEUI
func (AppEUI) MarshalBinary ¶
MarshalBinary implements the BinaryMarshaler interface.
func (AppEUI) MarshalText ¶
MarshalText implements the TextMarshaler interface.
func (*AppEUI) UnmarshalBinary ¶
UnmarshalBinary implements the BinaryUnmarshaler interface.
func (*AppEUI) UnmarshalText ¶
UnmarshalText implements the TextUnmarshaler interface.
type AppKey ¶
type AppKey AES128Key
AppKey (Application Key) is used for LoRaWAN OTAA.
func ParseAppKey ¶
ParseAppKey parses a 64-bit hex-encoded string to an AppKey
func (AppKey) MarshalBinary ¶
MarshalBinary implements the BinaryMarshaler interface.
func (AppKey) MarshalText ¶
MarshalText implements the TextMarshaler interface.
func (*AppKey) UnmarshalBinary ¶
UnmarshalBinary implements the BinaryUnmarshaler interface.
func (*AppKey) UnmarshalText ¶
UnmarshalText implements the TextUnmarshaler interface.
type AppNonce ¶
type AppNonce [3]byte
AppNonce for LoRaWAN
func (AppNonce) MarshalBinary ¶
MarshalBinary implements the BinaryMarshaler interface.
func (AppNonce) MarshalText ¶
MarshalText implements the TextMarshaler interface.
func (*AppNonce) UnmarshalBinary ¶
UnmarshalBinary implements the BinaryUnmarshaler interface.
func (*AppNonce) UnmarshalText ¶
UnmarshalText implements the TextUnmarshaler interface.
type AppSKey ¶
type AppSKey AES128Key
AppSKey (Application Session Key) is used for LoRaWAN payload encryption.
func ParseAppSKey ¶
ParseAppSKey parses a 64-bit hex-encoded string to an AppSKey
func (AppSKey) MarshalBinary ¶
MarshalBinary implements the BinaryMarshaler interface.
func (AppSKey) MarshalText ¶
MarshalText implements the TextMarshaler interface.
func (*AppSKey) UnmarshalBinary ¶
UnmarshalBinary implements the BinaryUnmarshaler interface.
func (*AppSKey) UnmarshalText ¶
UnmarshalText implements the TextUnmarshaler interface.
type DataRate ¶
type DataRate struct { SpreadingFactor uint `json:"spreading_factor,omitempty"` Bandwidth uint `json:"bandwidth,omitempty"` }
func ParseDataRate ¶
ParseDataRate parses a 32-bit hex-encoded string to a Devdatr
func (DataRate) MarshalBinary ¶
MarshalBinary implements the BinaryMarshaler interface.
func (DataRate) MarshalText ¶
MarshalText implements the TextMarshaler interface.
func (*DataRate) UnmarshalBinary ¶
UnmarshalBinary implements the BinaryUnmarshaler interface.
func (*DataRate) UnmarshalText ¶
UnmarshalText implements the TextUnmarshaler interface.
type DevAddr ¶
type DevAddr [4]byte
DevAddr is a non-unique address for LoRaWAN devices.
func ParseDevAddr ¶
ParseDevAddr parses a 32-bit hex-encoded string to a DevAddr
func (DevAddr) HasPrefix ¶
func (addr DevAddr) HasPrefix(prefix DevAddrPrefix) bool
HasPrefix returns true if the DevAddr has a prefix of given length
func (DevAddr) MarshalBinary ¶
MarshalBinary implements the BinaryMarshaler interface.
func (DevAddr) MarshalText ¶
MarshalText implements the TextMarshaler interface.
func (*DevAddr) UnmarshalBinary ¶
UnmarshalBinary implements the BinaryUnmarshaler interface.
func (*DevAddr) UnmarshalText ¶
UnmarshalText implements the TextUnmarshaler interface.
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 ParseDevAddrPrefix ¶
func ParseDevAddrPrefix(prefixString string) (prefix DevAddrPrefix, err error)
ParseDevAddrPrefix parses a DevAddr in prefix notation (01020304/24) to a prefix
func (DevAddrPrefix) MarshalText ¶
func (prefix DevAddrPrefix) MarshalText() ([]byte, error)
MarshalText implements the TextMarshaler interface.
func (DevAddrPrefix) String ¶
func (prefix DevAddrPrefix) String() string
String implements the fmt.Stringer interface
func (*DevAddrPrefix) UnmarshalText ¶
func (prefix *DevAddrPrefix) UnmarshalText(data []byte) error
UnmarshalText implements the TextUnmarshaler interface.
type DevEUI ¶
type DevEUI EUI64
DevEUI is a unique identifier for devices.
func ParseDevEUI ¶
ParseDevEUI parses a 64-bit hex-encoded string to an DevEUI
func (DevEUI) MarshalBinary ¶
MarshalBinary implements the BinaryMarshaler interface.
func (DevEUI) MarshalText ¶
MarshalText implements the TextMarshaler interface.
func (*DevEUI) UnmarshalBinary ¶
UnmarshalBinary implements the BinaryUnmarshaler interface.
func (*DevEUI) UnmarshalText ¶
UnmarshalText implements the TextUnmarshaler interface.
type DevNonce ¶
type DevNonce [2]byte
DevNonce for LoRaWAN
func (DevNonce) MarshalBinary ¶
MarshalBinary implements the BinaryMarshaler interface.
func (DevNonce) MarshalText ¶
MarshalText implements the TextMarshaler interface.
func (*DevNonce) UnmarshalBinary ¶
UnmarshalBinary implements the BinaryUnmarshaler interface.
func (*DevNonce) UnmarshalText ¶
UnmarshalText implements the TextUnmarshaler interface.
type DeviceEvent ¶
DeviceEvent represents an application-layer event message for a device event
type DownlinkEventConfigInfo ¶
type DownlinkEventConfigInfo struct { Modulation string `json:"modulation,omitempty"` DataRate string `json:"data_rate,omitempty"` BitRate uint `json:"bit_rate,omitempty"` FCnt uint `json:"counter,omitempty"` Frequency uint `json:"frequency,omitempty"` Power int `json:"power,omitempty"` }
DownlinkEventConfigInfo contains configuration information for a downlink message, all fields are optional
type DownlinkEventData ¶
type DownlinkEventData struct { Payload []byte `json:"payload"` GatewayID string `json:"gateway_id"` Config DownlinkEventConfigInfo `json:"config"` }
DownlinkEventData is added to downlink events
type DownlinkMessage ¶
type DownlinkMessage struct { AppID string `json:"app_id,omitempty"` DevID string `json:"dev_id,omitempty"` FPort uint8 `json:"port"` PayloadRaw []byte `json:"payload_raw,omitempty"` PayloadFields map[string]interface{} `json:"payload_fields,omitempty"` }
DownlinkMessage represents an application-layer downlink message
type EUI64 ¶
type EUI64 [8]byte
EUI64 is used for AppEUIs and DevEUIs.
func ParseEUI64 ¶
ParseEUI64 parses a 64-bit hex-encoded string to an EUI64.
func (EUI64) MarshalBinary ¶
MarshalBinary implements the BinaryMarshaler interface.
func (EUI64) MarshalText ¶
MarshalText implements the TextMarshaler interface.
func (*EUI64) UnmarshalBinary ¶
UnmarshalBinary implements the BinaryUnmarshaler interface.
func (*EUI64) UnmarshalText ¶
UnmarshalText implements the TextUnmarshaler interface.
type ErrorEventData ¶
type ErrorEventData struct {
Error string `json:"error"`
}
ErrorEventData is added to error events
type EventType ¶
type EventType string
EventType represents the type of event
const ( UplinkErrorEvent EventType = "up/errors" DownlinkScheduledEvent EventType = "down/scheduled" DownlinkSentEvent EventType = "down/sent" DownlinkErrorEvent EventType = "down/errors" DownlinkAckEvent EventType = "down/acks" ActivationEvent EventType = "activations" ActivationErrorEvent EventType = "activations/errors" )
Event types
type GatewayMetadata ¶
type GatewayMetadata struct { GtwID string `json:"gtw_id,omitempty"` Timestamp uint32 `json:"timestamp,omitempty"` Time JSONTime `json:"time,omitempty"` Channel uint32 `json:"channel"` RSSI float32 `json:"rssi,omitempty"` SNR float32 `json:"snr,omitempty"` RFChain uint32 `json:"rf_chain,omitempty"` LocationMetadata }
GatewayMetadata contains metadata for each gateway that received a message
type JSONTime ¶
JSONTime is a time.Time that marshals to/from RFC3339Nano format
func (JSONTime) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface
func (*JSONTime) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface
type LocationMetadata ¶
type LocationMetadata struct { Latitude float32 `json:"latitude,omitempty"` Longitude float32 `json:"longitude,omitempty"` Altitude int32 `json:"altitude,omitempty"` }
LocationMetadata contains GPS coordinates
type Metadata ¶
type Metadata struct { Time JSONTime `json:"time,omitempty,omitempty"` Frequency float32 `json:"frequency,omitempty"` Modulation string `json:"modulation,omitempty"` DataRate string `json:"data_rate,omitempty"` Bitrate uint32 `json:"bit_rate,omitempty"` CodingRate string `json:"coding_rate,omitempty"` Gateways []GatewayMetadata `json:"gateways,omitempty"` LocationMetadata }
Metadata contains metadata of a message
type NetID ¶
type NetID [3]byte
NetID for LoRaWAN
func (NetID) MarshalBinary ¶
MarshalBinary implements the BinaryMarshaler interface.
func (NetID) MarshalText ¶
MarshalText implements the TextMarshaler interface.
func (*NetID) UnmarshalBinary ¶
UnmarshalBinary implements the BinaryUnmarshaler interface.
func (*NetID) UnmarshalText ¶
UnmarshalText implements the TextUnmarshaler interface.
type NwkSKey ¶
type NwkSKey AES128Key
NwkSKey (Network Session Key) is used for LoRaWAN MIC calculation.
func ParseNwkSKey ¶
ParseNwkSKey parses a 64-bit hex-encoded string to an NwkSKey
func (NwkSKey) MarshalBinary ¶
MarshalBinary implements the BinaryMarshaler interface.
func (NwkSKey) MarshalText ¶
MarshalText implements the TextMarshaler interface.
func (*NwkSKey) UnmarshalBinary ¶
UnmarshalBinary implements the BinaryUnmarshaler interface.
func (*NwkSKey) UnmarshalText ¶
UnmarshalText implements the TextUnmarshaler interface.
type UplinkMessage ¶
type UplinkMessage struct { AppID string `json:"app_id,omitempty"` DevID string `json:"dev_id,omitempty"` FPort uint8 `json:"port"` FCnt uint32 `json:"counter"` PayloadRaw []byte `json:"payload_raw"` PayloadFields map[string]interface{} `json:"payload_fields,omitempty"` Metadata Metadata `json:"metadata,omitempty"` }
UplinkMessage represents an application-layer uplink message