mqtt

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0, MIT Imports: 17 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 {
	// contains filtered or unexported fields
}

Backend implements a MQTT backend.

func NewBackend

func NewBackend(conf config.Config) (*Backend, error)

NewBackend creates a new Backend.

func (*Backend) PublishEvent

func (b *Backend) PublishEvent(gatewayID lorawan.EUI64, event string, id uint32, v proto.Message) error

PublishEvent publishes the given event.

func (*Backend) PublishState

func (b *Backend) PublishState(gatewayID lorawan.EUI64, state string, v proto.Message) error

PublishState publishes the given state as retained message.

func (*Backend) SetDownlinkFrameFunc

func (b *Backend) SetDownlinkFrameFunc(f func(*gw.DownlinkFrame))

SetDownlinkFrameFunc sets the DownlinkFrame handler func.

func (*Backend) SetGatewayCommandExecRequestFunc

func (b *Backend) SetGatewayCommandExecRequestFunc(f func(*gw.GatewayCommandExecRequest))

SetGatewayCommandExecRequestFunc sets the GatewayCommandExecRequest handler func.

func (*Backend) SetGatewayConfigurationFunc

func (b *Backend) SetGatewayConfigurationFunc(f func(*gw.GatewayConfiguration))

SetGatewayConfigurationFunc sets the GatewayConfiguration handler func.

func (*Backend) SetGatewaySubscription

func (b *Backend) SetGatewaySubscription(subscribe bool, gatewayID lorawan.EUI64) error

SetGatewaySubscription sets or unsets the gateway. Note: the actual MQTT (un)subscribe happens in a separate function to avoid race conditions in case of connection issues. This way, the gateways map always reflect the desired state.

func (*Backend) SetRawPacketForwarderCommandFunc

func (b *Backend) SetRawPacketForwarderCommandFunc(f func(*gw.RawPacketForwarderCommand))

SetRawPacketForwarderCommandFunc sets the RawPacketForwarderCommand handler func.

func (*Backend) Start

func (b *Backend) Start() error

Start starts the integration.

func (*Backend) Stop

func (b *Backend) Stop() error

Stop stops the integration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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