Determine wifi Channel when on Wifi Direct

Jason 1 Reputation point

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.


Universal Windows Platform (UWP)
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,511 questions
{count} votes