device

package
v0.0.0-...-eb4e6e4 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyData = errors.New("device or device model list is empty")

Functions

func GetObservedDesiredValue

func GetObservedDesiredValue() string

func SetObservedDesiredValue

func SetObservedDesiredValue(Value string)

Types

type DevPanel

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

func NewDevPanel

func NewDevPanel() *DevPanel

NewDevPanel init and return devPanel

func (*DevPanel) DealDeviceTwinGet

func (d *DevPanel) DealDeviceTwinGet(deviceID string, twinName string) (interface{}, error)

DealDeviceTwinGet get device's twin data

func (*DevPanel) DevInit

func (d *DevPanel) DevInit(deviceList []*dmiapi.Device, deviceModelList []*dmiapi.DeviceModel) error

DevInit initialize the device

func (*DevPanel) DevStart

func (d *DevPanel) DevStart()

DevStart start all devices.

func (*DevPanel) GetDevice

func (d *DevPanel) GetDevice(deviceID string) (interface{}, error)

GetDevice get device instance

func (*DevPanel) GetModel

func (d *DevPanel) GetModel(modelID string) (common.DeviceModel, error)

GetModel if the model exists, return device model

func (*DevPanel) GetTwinResult

func (d *DevPanel) GetTwinResult(deviceID string, twinName string) (string, string, error)

GetTwinResult Get twin's value and data type

func (*DevPanel) RemoveDevice

func (d *DevPanel) RemoveDevice(deviceID string) error

RemoveDevice remove device instance

func (*DevPanel) RemoveModel

func (d *DevPanel) RemoveModel(modelID string)

RemoveModel remove device model

func (*DevPanel) UpdateDev

func (d *DevPanel) UpdateDev(model *common.DeviceModel, device *common.DeviceInstance)

UpdateDev stop old device, then update and start new device

func (*DevPanel) UpdateDevTwins

func (d *DevPanel) UpdateDevTwins(deviceID string, twins []common.Twin) error

UpdateDevTwins update device's twins

func (*DevPanel) UpdateModel

func (d *DevPanel) UpdateModel(model *common.DeviceModel)

UpdateModel update device model

type TwinData

type TwinData struct {
	DeviceName      string
	DeviceNamespace string
	Client          *driver.CustomizedClient
	Name            string
	Type            string
	ObservedDesired common.TwinProperty
	VisitorConfig   *driver.VisitorConfig
	Topic           string
	Results         interface{}
	CollectCycle    time.Duration
	ReportToCloud   bool
}

func (*TwinData) GetPayLoad

func (td *TwinData) GetPayLoad() ([]byte, error)

func (*TwinData) PushToEdgeCore

func (td *TwinData) PushToEdgeCore()

func (*TwinData) Run

func (td *TwinData) Run(ctx context.Context)

func (*TwinData) SetObservedDesiredValue

func (td *TwinData) SetObservedDesiredValue()

Jump to

Keyboard shortcuts

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