Documentation ¶
Index ¶
- Variables
- func CallLuaConverter(L *lua.LState, method string, raw interface{}) ([]plugin.DeviceData, error)
- func CallLuaEncodeConverter(L *lua.LState, deviceName string, raw interface{}) (string, error)
- func Conv2Float64(value interface{}) (f float64, err error)
- func Conv2Int64(value interface{}) (i int64, err error)
- func Conv2String(value interface{}) (s string, err error)
- func ConvPointType(value interface{}, valueType string) (interface{}, error)
- func FileExists(path string) bool
- func GetChildDir(path string) (list []string, err error)
- func GetChildDirName(path string) (list []string, err error)
- func InitCoreCache(configMap map[string]config.Config) (err error)
- func InitLogger(level string) (err error)
- func InitLuaVM(scriptDir string) (*lua.LState, error)
- func Map2Struct(m interface{}, v interface{}) error
- func PointCacheFilter(deviceData *plugin.DeviceData)
- func PointValueType2EdgeX(valueType string) string
- func SafeCallLuaFunc(L *lua.LState, method string) error
- func Send(deviceName string, mode plugin.EncodeMode, value plugin.PointData) (err error)
- func SendMultiRead(deviceNames []string, pointNames []string) (err error)
- type LuaModule
- type ProtocolProperties
Constants ¶
This section is empty.
Variables ¶
View Source
var CoreCache coreCache
CoreCache 核心缓存
View Source
var Crontab crontab.Crontab // 全局定时任务实例
View Source
var DeviceShadow shadow.DeviceShadow // 本地设备影子
View Source
var DriverConfig config.DriverConfig // 驱动配置
View Source
var Exports []export.Export
View Source
var Logger *zap.Logger
Logger 日志记录器
View Source
var PluginCacheMap = &sync.Map{} // 插件通用缓存
Functions ¶
func CallLuaConverter ¶
CallLuaConverter 调用 Lua 脚本转换器
func CallLuaEncodeConverter ¶
CallLuaEncodeConverter 调用 Lua 脚本编码转换器
func Conv2Float64 ¶
Conv2Float64 转换为 float64 类型
func Conv2String ¶
Conv2String 转换为 string 类型
func ConvPointType ¶
ConvPointType 点位类型转换 仅支持三种数据类型:int、float、string
func GetChildDir ¶
GetChildDir 获取指定路径下所有子目录
func GetChildDirName ¶
GetChildDirName 获取指定路径下所有子目录名称
func InitCoreCache ¶
InitCoreCache 初始化核心缓存
func Map2Struct ¶
func Map2Struct(m interface{}, v interface{}) error
Map2Struct map 转 struct,用于解析连接器配置 m:map[string]interface v:&struct{}
func PointCacheFilter ¶
func PointCacheFilter(deviceData *plugin.DeviceData)
func PointValueType2EdgeX ¶
PointValueType2EdgeX 点位值类型转换为 EdgeX 数据类型 int => Int64、float => Float64、string => String
func SafeCallLuaFunc ¶
SafeCallLuaFunc 安全调用 lua 函数,通过锁机制独占时间片
func SendMultiRead ¶
SendMultiRead 发送多个点位读取命令,多用于 autoEvent
Types ¶
type LuaModule ¶
type LuaModule struct{}
LuaModule go 实现 lua 模块,供脚本内使用
var LuaModuleInstance *LuaModule
type ProtocolProperties ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.