Description
Description
The c# WiFiDirectAdvertisementPublisher
class doesn't update its status after it's network is Started.
What works: the WiFi Direct Legacy network will not start and Publisher.Status
will be Aborted
if the publisher is started with WiFi switched off through the Modern UI Settings (e.g. via the taskbar or via ms-settings:network-wifi).
What doesn't work: when the publisher is started with WiFi swiched on the network starts as expected, but switching the WiFi off while it's in the Started state will seemingly shut down the network and disconnect any connected devices without changing the Publisher.Status
or invoking Publisher.StatusChanged
.
I'm hoping this is the right repo to report this to.
I have a reproduction using .NET 9 that shows the above behaviour on both a Windows 11 Dell XPS 15 and a Windows 10 Lenovo Thinkpad E550.
https://github.com/TomWilloughby/WiFi-Direct-No-Status-Update/blob/main/README.md
I've also seen this issue on .NET Framework 4.8.0 on the Windows 11 Dell XPS 15.
Steps To Reproduce
- Create an instance of the
WiFiDirectAdvertisementPublisher
class. - Set
Publisher.Advertisement.IsAutonomousGroupOwnerEnabled = True
,Publisher.Advertisement.LegacySettings.IsEnabled = true
,Publisher.Advertisement.LegacySettings.Ssid = "HelloWorld"
,Publisher.Advertisement.LegacySettings.Passphrase.Password = "Pa$$w0rd"
. - Hook up
Publisher.StatusChanged
to log the new statuses. - Call
Publisher.Start()
. - Run the code.
- Notice that the network has started successfully.
- Connect another device to the network.
- Turn off WiFi using the toggle switch in the
ms-settings:network-wifi
screen. - Notice that the connected device disconnects, but the WiFi network status does not update.
- Close the app, and start it again with WiFi already switched off.
- Notice that the network does not start successfully, and the status is
Aborted
Expected Behavior
If the WiFi is switched off after the Publisher is Started, the Publisher status should change to Aborted. This would be consistent with what happens when the WiFi is already switched off while the Publisher is being Started.
I'm not sure what the expected behaviour is for when the WiFi network is off and then switched back on - at the moment I'm just checking if the Publisher status is Started every 30 seconds and, if not, I stop and restart the Publisher.
Version Info
.NET 9 on Windows 11 v10.0.26100 and Windows 10 v10.0.18363 and .NET Framework v4.8.0 Windows 11 v10.0.26100
Additional Context
No response