//*********************************************************************
        private void ThreadableConnectToAP(String SSID, Connect _conn, AP _connecttoAP)
        {
            bool connectSuccess = false;

            _AssociatedWithAPList.Clear();
            Int32 tRYStOcONNECT = 0;

            _conn.SSID          = _connecttoAP.SSID;
            _conn.Destination   = _connecttoAP.getMACAddress();
            _conn.PacketChannel = _connecttoAP.getOperateChannel();
            _conn.PacketBand    = _connecttoAP.getOperateBand();
            _conn.Reciver       = _connecttoAP.getMACAddress();
            this.setOperateChannel(_connecttoAP.getOperateChannel());
            this.setOperateBand(_connecttoAP.getOperateBand());
            while (!connectSuccess)
            {
                if (!_AssociatedWithAPList.Contains(SSID))
                {
                    if (tRYStOcONNECT < 10)
                    {
                        SendData(_conn);
                        tRYStOcONNECT++;
                        Thread.Sleep(1000);
                    }
                }
                else
                {
                    connectSuccess = true;
                }
            }
            if (connectSuccess && _scanning)
            {
                SpinWait.SpinUntil
                    (() =>
                {
                    return((bool)!_scanning);
                }
                    );
                this.setOperateChannel(_connecttoAP.getOperateChannel());
                this.setOperateBand(_connecttoAP.getOperateBand());
            }
            //  Fix Work Channel under scan
        }
Example #2
0
        private void tbrGUISlow_Tick(object sender, EventArgs e)
        {
            lblMAC.Text     = _ap.getMACAddress();
            lblChannel.Text = _ap.getOperateChannel().ToString();
            lblBand.Text    = _ap.getOperateBand();
            lblSSID.Text    = _ap.SSID;


            ArrayListCounted devicesList = _ap.getAssociatedDevices();

            listStations.Items.Clear();
            foreach (object __o in devicesList)
            {
                string s = (string)__o;
                listStations.Items.Add(s);
                // loop body
            }
        }