基础接口
应用基础接口
set_handler
函数原型
function api:set_handler(handler, watch_data)
end参数说明
示例代码
local api = sys:data_api()
api:set_handler({
on_comm = function(src_app, dev_sn, dir, timestamp, ...) end, -- watch_data = true
on_stat = function(src_app, dev_sn, state, prop, value, timestamp) end, -- watch_data = true
on_input = function(src_app, dev_sn, input, prop, value, timestamp, quality) end, -- watch_data = true
on_add_device = function(src_app, dev_sn, props) end, -- watch_data = true
on_del_device = function(src_app, dev_sn, props) end, -- watch_data = true
on_mod_device = function(src_app, dev_sn) end, -- watch_data = true
on_output = function(src_app, dev_sn, output, prop, value, timestamp) end, -- 数据输出项回调
on_output_result = function(src_app, priv, result, err) end, -- 数据输出项请求执行结果回调
on_command = function(src_app, dev_sn, command, params) end, -- 命令回调
on_command_result = function(src_app, priv, result, err) end, -- 命令请求执行结果回调
on_ctrl = function(src_app, command, params) end, -- 应用控制接口
on_ctrl_result = function(src_app, priv, result, err) end, -- 应用控制执行结果回调
})list_devices
函数原型
add_device
函数原型
参数说明
示例代码
del_device
函数原型
get_device
函数原型
send_ctrl
函数原型
cleanup
函数原型
_dump_comm
函数原型
_fire_event
函数原型
Last updated
Was this helpful?