updateaplist.lua 477 B

1234567891011121314
  1. local function storelist(t)
  2. -- connection:send(cjson.encode(t))
  3. -- print(cjson.encode(t))
  4. file.remove("http/aplist.json")
  5. file.open("http/aplist.json","w+")
  6. file.writeline(cjson.encode(t))
  7. file.close()
  8. end
  9. return function(connection,args)
  10. wifi.sta.getap(storelist)
  11. connection:send("HTTP/1.0 200 OK\r\nContent-Type: application/json\r\nCache-Control: private, no-store\r\n\r\n")
  12. connection:send('{"error":0, "message":"OK"}')
  13. end