mqtt

package
v0.0.0-...-bfdc318 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(mRasp *raspb.Raspberry, mClientId string, mBroker string) *Client

Initializes and returns a new MQTT-Client. Sets client options and shutdown handling. mRasp = Raspberry governing arduinos which sensor data will be published to the MQTT-Broker mClientId = The MQTT-Client-Id that will be used to communicate with the MQTT-Broker (every Id has to be unique) mBroker = tcp-Address of the MQTT-Broker to publish/subscribe to

func (*Client) BrokerAddress

func (rClient *Client) BrokerAddress() string

func (*Client) ClientId

func (rClient *Client) ClientId() string

func (*Client) Connect

func (rClient *Client) Connect() error

Establish client connection to MQTT-Broker

func (*Client) Disconnect

func (rClient *Client) Disconnect()

Disconnect client from MQTT-Broker

func (*Client) MQTTClient

func (rClient *Client) MQTTClient() MQTT.Client

func (*Client) PublishSensorData

func (rClient *Client) PublishSensorData()

Publish sensor data from all Arduinos that this client has to the MQTT-Broker

func (*Client) Raspb

func (rClient *Client) Raspb() *raspb.Raspberry

Jump to

Keyboard shortcuts

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