8 local conn = ubus.connect()
10 error("Failed to connect to ubus")
24 conn:reply(req, {message="foo"});
25 print("Call to function 'hello'")
26 for k, v in pairs(msg) do
27 print("key=" .. k .. " value=" .. tostring(v))
29 end, {id = ubus.INT32, msg = ubus.STRING }
33 conn:reply(req, {message="foo1"});
34 conn:reply(req, {message="foo2"});
35 print("Call to function 'hello1'")
36 end, {id = ubus.INT32, msg = ubus.STRING }
40 conn:reply(req, {message="wait for it"})
41 local def_req = conn:defer_request(req)
42 uloop.timer(function()
43 conn:reply(def_req, {message="done"})
44 conn:complete_deferred_request(def_req, 0)
45 print("Deferred request complete")
47 print("Call to function 'deferred'")
57 print("Call to test event")
58 for k, v in pairs(msg) do
59 print("key=" .. k .. " value=" .. tostring(v))