api

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 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 BridgeConfig

type BridgeConfig struct {
	Version     string `json:"version"`
	Commit      string `json:"commit"`
	Coordinator int    `json:"coordinator"`
	LogLevel    string `json:"log_level"`
	PermitJoin  bool   `json:"permit_join"`
}

BridgeConfig represents message of `#/bridge/config` topic

func GetBridgeConfig

func GetBridgeConfig(client mqtt.Client) BridgeConfig

GetBridgeConfig subscribes and returns message from `#/bridge/config` topic

type BridgeConfigDevice

type BridgeConfigDevice struct {
	IEEEAddr     string `json:"ieeeAddr"`
	Type         string `json:"type"`
	Model        string `json:"model"`
	FriendlyName string `json:"friendly_name"`
	NWKAddr      int    `json:"nwkAddr"`
	ManufID      int    `json:"manufId"`
	ManufName    string `json:"manufName"`
	PowerSource  string `json:"powerSource"`
	ModelID      string `json:"modelId"`
	HWVersion    int    `json:"hwVersion"`
	SWBuildID    string `json:"swBuildId"`
	DateCode     string `json:"dateCode"`
}

BridgeConfigDevice represents message of `#/bridge/config/devices`

func GetBridgeConfigDevices

func GetBridgeConfigDevices(client mqtt.Client) []BridgeConfigDevice

GetBridgeConfigDevices subscribes and returns message from `#/bridge/config/devices` topic

type Broker

type Broker struct {
	Version          string
	Uptime           string
	MessagesSent     string
	MessagesReceived string
	ClientsConnected string
	ClientsTotal     string
}

Broker represents broker details from multiple `$SYS/broker/*` topics

func GetBrokerDetails

func GetBrokerDetails(c mqtt.Client) Broker

GetBrokerDetails subscribes and takes messages from multiple `$SYS/broker/*` topics

func (Broker) FormatUptime

func (b Broker) FormatUptime() string

FormatUptime formats uptime string

Jump to

Keyboard shortcuts

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