You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Second connection to a give Windows computer running the sample fails.
To Reproduce
Steps to reproduce the behavior:
Two computers running Windows 11 with WiFi Direct capability are required.
The computers being used must not be paired - Use the Settings-Bluetooth & Devices > Devices "Remove device" option so the computers don't know about each other.
Run the C# WiFi Direct sample on both computers.
Use the sample to make a WiFi Direct connection.
Close the other device on both computers.
Attempt a second connection (this usually requires that you Stop /start advertisement on one machine and Stop/Start the watcher on the other machine or the other machine isn't found).
The machine being connected to shows as "not paired", but you get this error displayed: "PairAsync failed, Status: AlreadyPaired".
Expected behavior
The connection should be successfuil.
Screenshots
Configuration
Language/architecture/flavor: C#
Windows platform and build number: Windows 11, various
Visual Studio version: Various, currently 17.7.4
Additional context
The sample relies on DeviceInformationPairing.IsPaired. It is false in this case. If however, you call CreateFromIdAsync() for the device and ask for "System.Devices.Aep.IsPaired", the "System.Devices.Aep.IsPaired" property will be true. Similarly for DeviceInformationPairing.CanPair and "System.Devices.Aep.CanPair". The documentation implies DeviceInformationPairing.IsPaired is derived from "System.Devices.Aep.IsPaired", whatever that means...
It should be noted that this is a problem on the Connector side only. The Advertiser side uses an additional function, IsAepPaired() to determine if pairing is necessary.
There are various ways of making the sample work should this be an OS "feature". Don't try to pair if CanPair is false seems to work. Probably better is to call CreateFromIdAsync() for the device and use the System.Devices.Aep.IsPaired/System.Devices.Aep.CanPair properties, if present. And finally, I suppose the AlreadyPaired error could be ignored!
The text was updated successfully, but these errors were encountered:
I suppose I should add that if we believe the System.Devices.Aep.IsPaired property, then the "Unpaired" designation in the "Discovered Devices" list is incorrect.
Whether this turns out to be an OS bug or not, the sample should take account of this problem as anyone shipping product will have to use some kind of workaround for this problem.
So, if you ask for System.Devices.Aep.IsPaired in the list of properties passed to DeviceInformation.CreateWatcher(), then the System.Devices.Aep.IsPaired property is copied to DeviceInformation.IsPaired. Similarly for CanPair.
I'd suggest this modification is made to the sample. It fixes both this issue and the misreporting of the pairing status in the Discovered Devices list.
I've not found any documentation of this 'feature'.
Which sample are you reporting a bug in?
WiFiDirect
Describe the bug
Second connection to a give Windows computer running the sample fails.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The connection should be successfuil.
Screenshots
Configuration
Additional context
The sample relies on DeviceInformationPairing.IsPaired. It is false in this case. If however, you call CreateFromIdAsync() for the device and ask for "System.Devices.Aep.IsPaired", the "System.Devices.Aep.IsPaired" property will be true. Similarly for DeviceInformationPairing.CanPair and "System.Devices.Aep.CanPair". The documentation implies DeviceInformationPairing.IsPaired is derived from "System.Devices.Aep.IsPaired", whatever that means...
It should be noted that this is a problem on the Connector side only. The Advertiser side uses an additional function, IsAepPaired() to determine if pairing is necessary.
There are various ways of making the sample work should this be an OS "feature". Don't try to pair if CanPair is false seems to work. Probably better is to call CreateFromIdAsync() for the device and use the System.Devices.Aep.IsPaired/System.Devices.Aep.CanPair properties, if present. And finally, I suppose the AlreadyPaired error could be ignored!
The text was updated successfully, but these errors were encountered: