2 Star 0 Fork 0

四川佳石信息技术有限公司/plugtype

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
plugtype.go 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
wangyang 提交于 2024-08-07 11:32 +08:00 . Add GetSysInfo interface
// plug 接口定义
package plugtype
// 资源接口
type Resource interface {
Open() error
Close()
Write(val []byte) error
Read() []byte
Control(opcode string, value ...interface{})
}
// IOT 设备对象
type IotDevice interface {
GetAllResource() map[string]Resource // 获取模型中所有的资源表
GetResource(id string) Resource // 获取指定的资源
StartWork(state string, value string) // 开始状态变迁
StopWork(state string, value string) // 结束状态变迁
UpdateState(state string, value string) // 直接更新状态
GetProperity(prop string) interface{} // 获取自定义属性
GetIotState(state string) (string, bool)
GetSysInfo() []byte // 获取运行设备的基本信息
}
// IOT 设备输入输出处理模块
type Handler interface {
Start() // 启动, 加载iot设备
Stop() // 停止iot设备
OnData(string, []byte) // 数据回调 参数1为资源名称, 参数2为接收到的数据
ExecStateChange(state string, value string) // 执行状态变迁
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/jiasion/plugtype.git
git@gitee.com:jiasion/plugtype.git
jiasion
plugtype
plugtype
v1.0.0

搜索帮助