air.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. local aircall = {}
  2. dnsproxy = require("dnsproxy")
  3. dhcpsrv = require("dhcpsrv")
  4. httpplus = require("httpplus")
  5. local run_state = false -- 判断本UI DEMO 是否运行
  6. local function stop_call()
  7. end
  8. local function recv_call()
  9. end
  10. local function start_call()
  11. end
  12. function aircall.run()
  13. log.info("aircall.run")
  14. lcd.setFont(lcd.font_opposansm12_chinese) -- 设置中文字体
  15. run_state = true
  16. while true do
  17. sys.wait(10)
  18. -- airlink.statistics()
  19. lcd.clear(_G.bkcolor)
  20. lcd.drawStr(0,80,"需要代码内修改拨打的号码" )
  21. --[
  22. -- 此处可填写demo ui
  23. --]
  24. lcd.showImage(20,360,"/luadb/back.jpg")
  25. lcd.showImage(130,303,"/luadb/stop.jpg") -- 挂断&拒接电话
  26. lcd.showImage(130,350,"/luadb/start.jpg") -- 接电话
  27. lcd.showImage(130,397,"/luadb/start.jpg") -- 拨打电话
  28. lcd.showImage(0,448,"/luadb/Lbottom.jpg")
  29. lcd.flush()
  30. if not run_state then -- 等待结束,返回主界面
  31. return true
  32. end
  33. end
  34. end
  35. function aircall.tp_handal(x,y,event)
  36. if x > 20 and x < 100 and y > 360 and y < 440 then
  37. run_state = false
  38. elseif x > 130 and x < 230 and y > 303 and y < 350 then
  39. sysplus.taskInitEx(stop_call, "stop_call")
  40. elseif x > 130 and x < 230 and y > 350 and y < 397 then
  41. sysplus.taskInitEx(recv_call, "recv_call")
  42. elseif x > 130 and x < 230 and y > 397 and y < 444 then
  43. sysplus.taskInitEx(start_call, "start_call")
  44. end
  45. end
  46. return aircall