wifi.setmode(wifi.STATION) function printap(ap) for k,v in pairs(ap) do --遍历table中元素 print(k.."="..v) --k表示键,v表示值 end end --注册一个状态监听方法 wifi.sta.eventMonReg(wifi.STA_GOTIP,function() wifi.sta.getap(printap) --getap()返回的是一个table end) --启动状态监听 wifi.sta.eventMonStart()