private void GetWIFIStatusComplete(string result) { Debug.Log(result); AllAvailableNetwork all = JsonUtil.Deserialize <AllAvailableNetwork>(result); Debug.Log(all.AvailableNetworks.Count); List <string> nameList = new List <string>(); int connectedId = -1; for (int i = 0; i < all.AvailableNetworks.Count; i++) { AvailableNetwork net = all.AvailableNetworks[i]; nameList.Add(net.SSID); if (net.AlreadyConnected) { connectedId = i; } } panel.hololensStatusPanel.SetWifiItemList(nameList, connectedId); panel.hololensStatusPanel.ShowWifiResult(true); }
public void GetNetwork() { WlanInterop.WlanGetAvailableNetworkList(handle, ref guid, 1, IntPtr.Zero, out IntPtr ppAvailableNetworkList); UInt32 dwNumberOfItems = (UInt32)Marshal.ReadInt32(ppAvailableNetworkList, 0); UInt32 dwIndex = (UInt32)Marshal.ReadInt32(ppAvailableNetworkList, sizeof(UInt32)); ppAvailableNetworkList += 2 * sizeof(UInt32); AvailableNetwork[] wlanInterface = new AvailableNetwork[dwNumberOfItems]; Int32 sizeOfStruct = Marshal.SizeOf(typeof(AvailableNetwork)); for (int i = 0; i < dwNumberOfItems; i++) { wlanInterface[i] = (AvailableNetwork)Marshal.PtrToStructure(ppAvailableNetworkList + sizeOfStruct * i, typeof(AvailableNetwork)); } }