コード例 #1
0
        public bool recv_ap(ref nsapi_wifi_ap ap)
        {
            var result = new List <string>();
            int sec;
            var ret = _parser.recv(@"+CWLAP:\(([0-9]+),""([^""]+)"",([0-9]+),""([0-9a-fA-F]+):([0-9a-fA-F]+):([0-9a-fA-F]+):([0-9a-fA-F]+):([0-9a-fA-F]+):([0-9a-fA-F]+)"",([0-9]+)\)", result);

            sec = Int32.Parse(result[0]);
            //ap.security = sec < 5 ? (nsapi_security_t)sec : NSAPI_SECURITY_UNKNOWN;

            return(ret);
        }
コード例 #2
0
        public int scan(nsapi_wifi_ap[] res, int limit)
        {
            var cnt = 0;

            if (!init_end)
            {
                lock (_smutex) {
                    startup();
                }
                Thread.Sleep(1500);
            }

            lock (_smutex) {
                setTimeout(5000);
                if (!_parser.send("AT+CWLAP"))
                {
                    return(NSAPI_ERROR_DEVICE_ERROR);
                }

                nsapi_wifi_ap ap = new nsapi_wifi_ap();
                while (recv_ap(ref ap))
                {
                    if (cnt < limit)
                    {
                        res[cnt] = ap;
                    }

                    cnt++;
                    if ((limit != 0) && (cnt >= limit))
                    {
                        break;
                    }
                    setTimeout(500);
                }
                setTimeout(10);
                _parser.recv(@"OK");
                setTimeout();
            }

            return(cnt);
        }
コード例 #3
0
 public WiFiAccessPoint(nsapi_wifi_ap ap)
 {
     this.ap = ap;
 }