device

package
v0.0.0-...-8f3712b Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package device contains implementation of a device plugin wrappers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConstructDevice

type ConstructDevice struct {
	DeviceName string
	DeviceType enums.DeviceType
	ConfigName string
	RawConfig  string
	Settings   providers.ISettingsProvider
	UOM        enums.UOM

	StatusUpdatesChan chan *UpdateEvent
	DiscoveryChan     chan *NewDeviceDiscoveredEvent
}

ConstructDevice has data required for a new device loader.

type ErrNoDataFromPlugin

type ErrNoDataFromPlugin struct {
}

ErrNoDataFromPlugin defines an empty response from plugin error.

func (*ErrNoDataFromPlugin) Error

func (*ErrNoDataFromPlugin) Error() string

Error formats output.

type ErrUnknownDeviceType

type ErrUnknownDeviceType struct {
}

ErrUnknownDeviceType defines an unknown device type error.

func (*ErrUnknownDeviceType) Error

func (e *ErrUnknownDeviceType) Error() string

Error formats output.

type IDeviceWrapperProvider

type IDeviceWrapperProvider interface {
	providers.ILoadedProvider
	ID() string
	Name() string
	InvokeCommand(enums.Command, map[string]interface{})
	GetUpdateMessage() *bus.DeviceUpdateMessage
	AppendChild(IDeviceWrapperProvider)
}

IDeviceWrapperProvider interface for any loaded devices.

func LoadDevice

func LoadDevice(ctor *ConstructDevice) ([]IDeviceWrapperProvider, error)

LoadDevice validates device type and loads requested plugin. nolint: dupl

func NewDeviceWrapper

func NewDeviceWrapper(ctor *wrapperConstruct) IDeviceWrapperProvider

NewDeviceWrapper constructs a new device wrapper.

type IProcessor

type IProcessor interface {
	IsExtraProperty(enums.Property) bool
	GetExtraSupportPropertiesSpec() []enums.Property
	IsPropertyGood(enums.Property, interface{}) (bool, map[enums.Property]interface{})
}

IProcessor defines device post-processor.

type NewDeviceDiscoveredEvent

type NewDeviceDiscoveredEvent struct {
	Provider IDeviceWrapperProvider
}

NewDeviceDiscoveredEvent is a type used for discovering a new device.

type UpdateEvent

type UpdateEvent struct {
	ID string
}

UpdateEvent is a type used for updates sent by a device.

Jump to

Keyboard shortcuts

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