Documentation ¶
Index ¶
- Constants
- Variables
- func NewBlockCipher(key []byte) cipher.Block
- type MQTTClient
- type NeighborInfo
- type Node
- func (node *Node) ClearDeviceMetrics()
- func (node *Node) ClearEnvironmentMetrics()
- func (node *Node) ClearMapReportData()
- func (node *Node) IsValid() bool
- func (node *Node) Prune(seenByTtl, neighborTtl, metricsTtl, mapReportTtl int64)
- func (node *Node) UpdateDeviceMetrics(batteryLevel uint32, voltage, chUtil, airUtilTx float32, uptime uint32)
- func (node *Node) UpdateEnvironmentMetrics(temperature, relativeHumidity, barometricPressure float32)
- func (node *Node) UpdateMapReport(fwVersion, region, modemPreset string, hasDefaultCh bool, ...)
- func (node *Node) UpdateNeighborInfo(neighborNum uint32, snr float32)
- func (node *Node) UpdatePosition(latitude, longitude, altitude int32, precision uint32)
- func (node *Node) UpdateSeenBy(topic string)
- func (node *Node) UpdateUser(longName, shortName, hwModel, role string)
- type NodeDB
Constants ¶
View Source
const ( SeenByLimit = 10 NeighborLimit = 100 )
Variables ¶
View Source
var DefaultKey = []byte{
0xd4, 0xf1, 0xbb, 0x3a,
0x20, 0x29, 0x07, 0x59,
0xf0, 0xbc, 0xff, 0xab,
0xcf, 0x4e, 0x69, 0x01,
}
Functions ¶
func NewBlockCipher ¶
Types ¶
type MQTTClient ¶
type MQTTClient struct { Topics []string TopicRegex *regexp.Regexp Accept func(from uint32) bool BlockCipher cipher.Block MessageHandler func(from uint32, topic string, portNum generated.PortNum, payload []byte) mqtt.Client }
func (*MQTTClient) Connect ¶
func (c *MQTTClient) Connect() error
func (*MQTTClient) Disconnect ¶
func (c *MQTTClient) Disconnect()
type NeighborInfo ¶
type Node ¶
type Node struct { // User LongName string `json:"longName"` ShortName string `json:"shortName"` HwModel string `json:"hwModel"` Role string `json:"role"` // MapReport FwVersion string `json:"fwVersion,omitempty"` Region string `json:"region,omitempty"` ModemPreset string `json:"modemPreset,omitempty"` HasDefaultCh bool `json:"hasDefaultCh,omitempty"` OnlineLocalNodes uint32 `json:"onlineLocalNodes,omitempty"` LastMapReport int64 `json:"lastMapReport,omitempty"` // Position Latitude int32 `json:"latitude"` Longitude int32 `json:"longitude"` Altitude int32 `json:"altitude,omitempty"` Precision uint32 `json:"precision,omitempty"` // DeviceMetrics BatteryLevel uint32 `json:"batteryLevel,omitempty"` Voltage float32 `json:"voltage,omitempty"` ChUtil float32 `json:"chUtil,omitempty"` AirUtilTx float32 `json:"airUtilTx,omitempty"` Uptime uint32 `json:"uptime,omitempty"` LastDeviceMetrics int64 `json:"lastDeviceMetrics,omitempty"` // EnvironmentMetrics Temperature float32 `json:"temperature,omitempty"` RelativeHumidity float32 `json:"relativeHumidity,omitempty"` BarometricPressure float32 `json:"barometricPressure,omitempty"` LastEnvironmentMetrics int64 `json:"lastEnvironmentMetrics,omitempty"` // NeighborInfo Neighbors map[uint32]*NeighborInfo `json:"neighbors,omitempty"` // key=mqtt topic, value=first seen/last position update SeenBy map[string]int64 `json:"seenBy"` }
func (*Node) ClearDeviceMetrics ¶
func (node *Node) ClearDeviceMetrics()
func (*Node) ClearEnvironmentMetrics ¶
func (node *Node) ClearEnvironmentMetrics()
func (*Node) ClearMapReportData ¶
func (node *Node) ClearMapReportData()
func (*Node) UpdateDeviceMetrics ¶
func (*Node) UpdateEnvironmentMetrics ¶
func (*Node) UpdateMapReport ¶
func (*Node) UpdateNeighborInfo ¶
func (*Node) UpdatePosition ¶
func (*Node) UpdateSeenBy ¶
func (*Node) UpdateUser ¶
Click to show internal directories.
Click to hide internal directories.