device

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DevInit

func DevInit(configmapPath string) error

DevInit initialize the device datas.

func DevStart

func DevStart()

DevStart start all devices.

Types

type GetStatus

type GetStatus struct {
	Client *driver.BleClient
	Status string
	// contains filtered or unexported fields
}

GetStatus is the timer structure for getting device status.

func (*GetStatus) Run

func (gs *GetStatus) Run()

Run timer function.

type TwinData

type TwinData struct {
	BleClient            *driver.BleClient
	Name                 string
	Type                 string
	BleVisitorConfig     configmap.BleVisitorConfig
	Result               string
	Topic                string
	FindedCharacteristic interface{}
}

TwinData is the timer structure for getting twin/data.

func (*TwinData) ConvertReadData

func (td *TwinData) ConvertReadData(data []byte) float64

ConvertReadData is the function responsible to convert the data read from the device into meaningful data. If currently logic of converting data is not suitable for your device, you can change ConvertReadData function manually.

func (*TwinData) Run

func (td *TwinData) Run()

Run timer function.

Jump to

Keyboard shortcuts

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