wifi.lua 869 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --module(..., package.seeall)
  2. -- require "pm"
  3. -- pm.wake("WIFI")
  4. -- require "pins"
  5. -- sys.taskInit(function()
  6. -- pmd.ldoset(6, pmd.LDO_VLCD)
  7. -- local urtIO = pins.setup(15, 0)
  8. -- urtIO(0)
  9. -- sys.wait(5000)
  10. -- print("pins.setup")
  11. -- urtIO(1)
  12. -- end)
  13. ril_wifi = require "ril_wifi"
  14. _G.link = require "link_wifi"
  15. _G.socket = require "socket_wifi"
  16. _G.net = {
  17. switchFly = function(f)
  18. log.info("net", "switchFly", f)
  19. end,
  20. startQueryAll = print
  21. }
  22. local unlod = {
  23. socket = true,
  24. link = true,
  25. net = true
  26. }
  27. local require_wifi = _G.require
  28. _G.require = function(name)
  29. if not unlod[name] then
  30. require_wifi(name)
  31. end
  32. end
  33. _G.point = function(...)
  34. local name = debug.getinfo(2).short_src:sub(6, -5)
  35. local line = debug.getinfo(2).currentline
  36. print("[" .. name .. " : " .. line .. "]", ...)
  37. end