Documentation ¶
Index ¶
Constants ¶
View Source
const QoS = 0x02
Variables ¶
View Source
var ( // ConnectRetries says how many times the client should retry a failed connection ConnectRetries = 10 // ConnectRetryDelay says how long the client should wait between retries ConnectRetryDelay = time.Second )
Functions ¶
This section is empty.
Types ¶
type ActivationHandler ¶
type Client ¶
type Client interface { Connect() error Disconnect() IsConnected() bool // Uplink pub/sub PublishUplink(appEUI types.AppEUI, devEUI types.DevEUI, payload core.DataUpAppReq) Token SubscribeDeviceUplink(appEUI types.AppEUI, devEUI types.DevEUI, handler UplinkHandler) Token SubscribeAppUplink(appEUI types.AppEUI, handler UplinkHandler) Token SubscribeUplink(handler UplinkHandler) Token // Downlink pub/sub PublishDownlink(appEUI types.AppEUI, devEUI types.DevEUI, payload core.DataDownAppReq) Token SubscribeDeviceDownlink(appEUI types.AppEUI, devEUI types.DevEUI, handler DownlinkHandler) Token SubscribeAppDownlink(appEUI types.AppEUI, handler DownlinkHandler) Token SubscribeDownlink(handler DownlinkHandler) Token // Activation pub/sub PublishActivation(appEUI types.AppEUI, devEUI types.DevEUI, payload core.OTAAAppReq) Token SubscribeDeviceActivations(appEUI types.AppEUI, devEUI types.DevEUI, handler ActivationHandler) Token SubscribeAppActivations(appEUI types.AppEUI, handler ActivationHandler) Token SubscribeActivations(handler ActivationHandler) Token }
Client connects to the MQTT server and can publish/subscribe on uplink, downlink and activations from devices
type DeviceTopic ¶
type DeviceTopic struct { AppEUI types.AppEUI DevEUI types.DevEUI Type DeviceTopicType }
DeviceTopic represents an MQTT topic for application devices If the DevEUI is an empty []byte{}, it is considered to be a wildcard
func ParseDeviceTopic ¶
func ParseDeviceTopic(topic string) (*DeviceTopic, error)
ParseDeviceTopic parses an MQTT device topic string to a DeviceTopic struct
func (DeviceTopic) String ¶
func (t DeviceTopic) String() string
String implements the Stringer interface
type DeviceTopicType ¶
type DeviceTopicType string
DeviceTopicType represents the type of a device topic
const ( // Activations of devices Activations DeviceTopicType = "activations" // Uplink data from devices Uplink DeviceTopicType = "up" // Downlink data to devices Downlink DeviceTopicType = "down" )
type DownlinkHandler ¶
type UplinkHandler ¶
Click to show internal directories.
Click to hide internal directories.