Determine wifi Channel when on Wifi Direct

Jason 1 Reputation point
2020-12-14T20:27:50.933+00:00

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.

Thanks

Universal Windows Platform (UWP)
C#
C#
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.
11,121 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.