mqtt

package
v2.7.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Backend implements a MQTT backend.

func NewBackend

func NewBackend(config BackendConfig) (*Backend, error)

NewBackend creates a new Backend.

func (*Backend) Close

func (b *Backend) Close()

Close closes the backend.

func (*Backend) DownlinkFrameChan

func (b *Backend) DownlinkFrameChan() chan gw.DownlinkFrame

DownlinkFrameChan returns the downlink frame channel.

func (*Backend) GatewayConfigurationChan

func (b *Backend) GatewayConfigurationChan() chan gw.GatewayConfiguration

GatewayConfigurationChan returns the gateway configuration channel.

func (*Backend) PublishDownlinkTXAck

func (b *Backend) PublishDownlinkTXAck(gatewayID lorawan.EUI64, msg gw.DownlinkTXAck) error

PublishDownlinkTXAck publishes a downlink ack to the MQTT broker.

func (*Backend) PublishGatewayStats

func (b *Backend) PublishGatewayStats(gatewayID lorawan.EUI64, msg gw.GatewayStats) error

PublishGatewayStats publishes a gateway stats message to the MQTT broker.

func (*Backend) PublishUplinkFrame

func (b *Backend) PublishUplinkFrame(gatewayID lorawan.EUI64, msg gw.UplinkFrame) error

PublishUplinkFrame publishes an uplink-frame to the MQTT broker.

func (*Backend) SubscribeGateway

func (b *Backend) SubscribeGateway(gatewayID lorawan.EUI64) error

SubscribeGateway subscribes a gateway to its topics.

func (*Backend) UnsubscribeGateway

func (b *Backend) UnsubscribeGateway(gatewayID lorawan.EUI64) error

UnsubscribeGateway unsubscribes the gateway from its topics.

type BackendAuthConfig

type BackendAuthConfig struct {
	Type            string
	Generic         auth.GenericConfig
	GCPCloudIoTCore auth.GCPCloudIoTCoreConfig `mapstructure:"gcp_cloud_iot_core"`
}

BackendAuthConfig holds the MQTT pub-sub backend auth configuration.

type BackendConfig

type BackendConfig struct {
	UplinkTopicTemplate   string `mapstructure:"uplink_topic_template"`
	DownlinkTopicTemplate string `mapstructure:"downlink_topic_template"`
	StatsTopicTemplate    string `mapstructure:"stats_topic_template"`
	AckTopicTemplate      string `mapstructure:"ack_topic_template"`
	ConfigTopicTemplate   string `mapstructure:"config_topic_template"`
	Marshaler             string `mapstructure:"marshaler"`
	Auth                  BackendAuthConfig

	// for backwards compatibility
	Server               string
	Username             string
	Password             string
	CACert               string        `mapstructure:"ca_cert"`
	TLSCert              string        `mapstructure:"tls_cert"`
	TLSKey               string        `mapstructure:"tls_key"`
	QOS                  uint8         `mapstructure:"qos"`
	CleanSession         bool          `mapstructure:"clean_session"`
	ClientID             string        `mapstructure:"client_id"`
	MaxReconnectInterval time.Duration `mapstructure:"max_reconnect_interval"`

	AlwaysSubscribeMACs []lorawan.EUI64 `mapstructure:"-"`
}

BackendConfig holds the MQTT pub-sub backend configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL