Example #1
0
 public SEBWlanNetworkSelector()
 {
     this.InitializeComponent();
     try
     {
         this.wlanClient    = new WlanClient();
         this.wlanInterface = this.wlanClient.Interfaces[0];
         this.RefreshNetworks();
     }
     catch (Exception ex)
     {
         this.listNetworks.Enabled = false;
         this.listNetworks.Items.Add((object)SEBUIStrings.WlanNoNetworkInterfaceFound);
         Logger.AddError("No Network interface found", (object)this, ex, (string)null);
     }
 }
        public SEBWlanNetworkSelector()
        {
            InitializeComponent();

            try
            {
                //Find a wlan interface
                wlanClient = new WlanClient();
                wlanInterface = wlanClient.Interfaces[0];
                RefreshNetworks();
            }
            catch (Exception ex)
            {
                listNetworks.Enabled = false;
                listNetworks.Items.Add(SEBUIStrings.WlanNoNetworkInterfaceFound);
                Logger.AddError("No Network interface found",this,ex);
            }
        }
        public SEBWlanNetworkSelector()
        {
            InitializeComponent();

            try
            {
                //Find a wlan interface
                wlanClient    = new WlanClient();
                wlanInterface = wlanClient.Interfaces[0];
                RefreshNetworks();
            }
            catch (Exception ex)
            {
                listNetworks.Enabled = false;
                listNetworks.Items.Add(SEBUIStrings.WlanNoNetworkInterfaceFound);
                Logger.AddError("No Network interface found", this, ex);
            }
        }
        public SEBWlanToolStripButton()
        {
            this.Alignment = ToolStripItemAlignment.Right;
            try
            {
                //Find a wlan interface
                wlanClient = new WlanClient();
                wlanInterface = wlanClient.Interfaces[0];

                //Start the update timer
                timer = new Timer();
                timer.Tick += (x,y) => Update();
                timer.Interval = 1000;
                timer.Start();
            }
            catch (Exception ex)
            {
                Logger.AddError("No WiFi interface found",this,ex);
                base.Enabled = false;
                Update();
            }
        }
Example #5
0
File: WlanApi.cs Project: t00/seb
 internal WlanInterface(WlanClient client, Wlan.WlanInterfaceInfo info)
 {
     this.client = client;
     this.info = info;
 }
Example #6
0
 internal WlanInterface(WlanClient client, Wlan.WlanInterfaceInfo info)
 {
     this.client = client;
     this.info   = info;
 }
        private void OnWlanNotification(ref Wlan.WlanNotificationData notifyData, IntPtr context)
        {
            WlanClient.WlanInterface wlanInterface;
            this.ifaces.TryGetValue(notifyData.interfaceGuid, out wlanInterface);
            switch (notifyData.notificationSource)
            {
            case Wlan.WlanNotificationSource.ACM:
                switch ((Wlan.WlanNotificationCodeAcm)notifyData.notificationCode)
                {
                case Wlan.WlanNotificationCodeAcm.ScanFail:
                    int num = Marshal.SizeOf(typeof(int));
                    if (notifyData.dataSize >= num)
                    {
                        Wlan.WlanReasonCode reasonCode = (Wlan.WlanReasonCode)Marshal.ReadInt32(notifyData.dataPtr);
                        if (wlanInterface != null)
                        {
                            wlanInterface.OnWlanReason(notifyData, reasonCode);
                            break;
                        }
                        break;
                    }
                    break;

                case Wlan.WlanNotificationCodeAcm.ConnectionStart:
                case Wlan.WlanNotificationCodeAcm.ConnectionComplete:
                case Wlan.WlanNotificationCodeAcm.ConnectionAttemptFail:
                case Wlan.WlanNotificationCodeAcm.Disconnecting:
                case Wlan.WlanNotificationCodeAcm.Disconnected:
                    Wlan.WlanConnectionNotificationData?connectionNotification1 = WlanClient.ParseWlanConnectionNotification(ref notifyData);
                    if (connectionNotification1.HasValue && wlanInterface != null)
                    {
                        wlanInterface.OnWlanConnection(notifyData, connectionNotification1.Value);
                        break;
                    }
                    break;
                }
                break;

            case Wlan.WlanNotificationSource.MSM:
                switch (notifyData.notificationCode)
                {
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                case 9:
                case 10:
                case 11:
                case 12:
                case 13:
                    Wlan.WlanConnectionNotificationData?connectionNotification2 = WlanClient.ParseWlanConnectionNotification(ref notifyData);
                    if (connectionNotification2.HasValue && wlanInterface != null)
                    {
                        wlanInterface.OnWlanConnection(notifyData, connectionNotification2.Value);
                        break;
                    }
                    break;
                }
                break;
            }
            if (wlanInterface == null)
            {
                return;
            }
            wlanInterface.OnWlanNotification(notifyData);
        }