Determine wifi Channel when on Wifi Direct
Environment: C# / Windows 10
I have a working system in which an application starts a WiFiDirectAdvertisementPublisher. A wifi device connects to the Wifi Direct session and communicates as expected.
In order to assist Wifi sniffing diagnostics, I have been asked to report the Channel number (eg: 1, 6, 11, etc) being used. I have looked through the publisher, listener, WifiDirectDevice, and various other objects of the Windows.Devices.WiFiDirect namespace but have been unable to find anything that will report the Channel being used.
Is the Channel information available in the current WiFiDirect API?
If not, is there some other way to determine it?
I started investigating P/Invoke from c# using WlanQueryInterface and requesting the wlan_intf_opcode_channel_number but wasnt sure if this would provide me what I needed. Seems like a lot of work just to get the operating wifi Channel. Initial attempts have not yet been successful.
Any info on the topic would be appreciated.
@Jason You could try to use the WiFiAvailableNetwork.ChannelCenterFrequencyInKilohertz Property to get the channel center frequency of the band on which the 802.11 Beacon or Probe Response was received, and then get the channel number by comparing with the channel width(such as channel 1 is 2412 MHz, channel 6 is 2437 MHz, and channel 11 is 2462 MHz).
Thank you for the quick response. Your proposed solution sounds reasonable, however....
Using the Microsoft UWP "WifiScan" c# sample application, I added the ChannelCenterFrequencyInKilohertz property. The property shows up in the UI for each detected SSID within range of my PC (as expected).
The problem is that I never see the WiFi Direct SSID in the scanned list IF that SSID is being hosted on the current machine (A). I can move to another PC (B) and see the SSID hosted from A, but that doesn't help me. I am currently using WiFi Direct Legacy mode, but I believe I experienced the same thing when using normal WiFi Direct in the past.
So the question is... how to get the WifiScan sample app to detect a WiFi Direct SSID if that SSID is hosted from the same PC that is running WifiScan.
@Jason We are consulting other engineers, there may be some delays.
@Jason After consulting other engineers, it is likely that your requirement that getting the WifiScan sample app to detect a WiFi Direct SSID is hosted from the same PC that is running WifiScan sample is not supported.
Sign in to comment