Main Site Documentation

Populate Dropdown list on Glide with available Wifi networks


#1

Hello,
I am trying to populate a drop down list on the T43 screen with all of the available wifi networks. I am using a raptor, RS21, and T43 on NETMF4.3.I am scanning ok and can see the networks if I manually debug the specific numbers. I am having trouble with the code to populate the Glide.List with a for loop to add object from an array list. I cannot figure out how to run a for loop with the number of available networks and turn that into a dropdown list on the screen. Below is my code, which I know isn’t correct but will help demonstrate what I am trying to do.

Thank you,
Jordan

 if (scans != null && scans.Length > 0)
            {
                /*ArrayList options = new ArrayList()
                {
                    new object [2] {"SGW", scans[0].Ssid}

                };*/

                ArrayList options = new ArrayList()
                {
                    for (int i = 0; i < noofnetworks; i++)
                    {
                        new object [2] {scans[i].Ssid.ToString, scans[i].Ssid}
                    }
                };               

                list = new List(options, 150);
            }
           
        }

#2

@ L1256937 - Will something like the below work?


var scans = wifi.Scan();
var options = new ArrayList();

if (scans.Length == 0)
	options.Add(new object[2] { "N/A", "N/A" });

foreach (var scan in scans)
	options.Add(new object[2] { scan.Ssid, scan.Ssid });

var list = new List(options, 150);


#3

Worked great. Thanks!..now to connect to the one I want.

I am sure there will be more questions.

Thanks a ton.

Jordan