library

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Drivers = make(map[string]*glua.LState)

Functions

func LoadLibrary

func LoadLibrary(libType Type, driverKey string) error

加载指定key的驱动

func UnloadDeviceDrivers

func UnloadDeviceDrivers()

卸载驱动

Types

type DeviceDecodeRequest

type DeviceDecodeRequest struct {
	DeviceId string             `json:"id"` // 设备ID
	Points   []plugin.PointData `json:"points"`
}

设备驱动解码请求

type DeviceDecodeResult

type DeviceDecodeResult struct {
	//解码结果
	Points []plugin.PointData `json:"points"`
	//解码错误信息
	Error error `json:"error"`
}

设备驱动解码结果

func DeviceDecode

func DeviceDecode(driverKey string, req DeviceDecodeRequest) *DeviceDecodeResult

设备上行数据解码,该接口主要功能如下: 1. 对读到的数据进行点位值加工 2. 将读到的点位值,同步到本设备的另外一个点位上

type DeviceEncodeRequest

type DeviceEncodeRequest struct {
	DeviceId string // 设备ID
	Mode     plugin.EncodeMode
	Points   []plugin.PointData
}

设备驱动编码请求

type DeviceEncodeResult

type DeviceEncodeResult struct {
	Points []plugin.PointData `json:"points"`
	Error  error
}

设备驱动编码结果

func DeviceEncode

func DeviceEncode(driverKey string, req DeviceEncodeRequest) *DeviceEncodeResult

设备下行指令编码,该接口试下如下功能: 1. 写操作时,对点位值进行加工 2. 针对点位A发起的读写操作,通过编码可变更为点位B 3. 对单点位发起的读写请求,通过编码可扩展为多点位。例如:执行空开的开关操作,会先触发解锁,再执行开关行为。

type Type

type Type string
const (
	//设备层驱动
	DeviceDriver Type = "driver"
	//物模型
	DeviceModel Type = "model"
	//协议层驱动
	ProtocolDriver Type = "protocol"
)

Jump to

Keyboard shortcuts

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