Пример #1
0
            /// получить RSSI, Quality, SSID
            private bool WiFiPars()
            {
                bool
                    wifiOn = false;
                uint
                    uQual = 0;

                if (!DLBarcodeScanner.bIsX4)
                {
                    wifiOn             = this.rsWF.IsAssociated();
                    base.SignalPercent = this.rsWF.GetSignalLevel();
                    ushort
                        uLev = 0;
                    this.rsWF.GetSignal(ref uLev);
                    base.SignalQuality = uLev;
                    base.SSID          = xWiFiPars.GetSSID();
                }
                else
                {
                    wifiOn = Device.GetWiFiPowerStatus();
                    if (wifiOn)
                    {
                        WiFiStatus status = Datalogic.API.WiFi.GetCurrentStatus();
                        base.SignalPercent = base.RSS2Level(MINRSS, MAXRSS, status.Rssi);
                        Datalogic.API.Device.WiFiGetSignalQuality(out uQual);
                        base.SignalQuality = (int)uQual;

                        //String active = Datalogic.API.WiFi.GetActiveConfig();
                        //if (active != "")
                        //{
                        //    StandardWiFiConfig cfg = Datalogic.API.WiFi.GetConfig(active);
                        //    base.SSID = cfg.Base.SSID;
                        //}
                        base.SSID = "";
                    }
                }

                return(wifiOn);
            }
Пример #2
0
 public bool StartAp()
 {
     string setting = start;
     Cmds.Clear();
     Cmds.Add(setting);
     try
     {
         Runcmd();
         WiFiStatus = WiFiStatus.Running;
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
Пример #3
0
        public bool StopAp()
        {
            string setting = stop;
            Cmds.Clear();
            Cmds.Add(setting);
            try
            {
                Runcmd();
                WiFiStatus = WiFiStatus.Stop;
                return true;
            }
            catch
            {

                return false;
            }
        }
Пример #4
0
 public void Dispose()
 {
     if (WiFiStatus==WiFiStatus.Running)
     {
         if(StopAp())
         {
             WiFiStatus = WiFiStatus.Stop;
             Disallow();
         }
     }
     else
     {
         Disallow();
     }
 }