Proper way to obtain WifiDirectDevice handle on device that was paired prior to app startup? RRS feed

  • Question

  • Using the Microsoft UWP "WifiDirect" c# sample application (win 10), I am able to pair a Wifi Direct device and also open a socket and communicate across it.  Works great.  When the pairing is established I can see that a virtual network adapter is created.  While it exists, I can also ping the device.

    When the application closes, the virtual network adapter goes away.  The DeviceWatcher can still find the device and observes that the IsPaired state of the device it true.  Pinging is not successful at this point, probably because the virtual adapter is gone.

    I then fire up a new application session.  I verify that the DeviceWatcher reports that the device is still paired.  I then attempt to use WiFiDirectDevice.FromIdAsync() to get handle on the already paired device.  The call always fails.

    So the question is:

    What is the proper mechanism by which a software session can obtain a handle on a device that is currently paired with the PC?  The pairing was created in a previous software session.

    Is this even possible?

    Currently I have to unpair and then re-pair in order to successfully obtain a new WifiDirectDevice object.  Unfortunately, the documentation is sparse.  

    Here is a reference to the MS sample app mentioned above:


    • Edited by Jason1119 Friday, July 17, 2020 1:10 AM
    Friday, July 17, 2020 12:41 AM

All replies

  • Hello Jason1119,

    This forum is for "Discuss the Microsoft Peer-to-Peer Platform". It is Win32 C++ focused.

    For UWP related issue you can ask a question at Microsoft Q&A - UWP for more professional support. Thanks for your cooperation.

    This “Discuss the Microsoft Peer-to-Peer Platform” Forum will be migrating to a new home on Microsoft Q&A, please refer to this sticky post for more details. 

    Best regards,


    "Win32 API" forum will be migrating to a new home on Microsoft Q&A !
    We invite you to post new questions in the "Win32 API" forum’s new home on Microsoft Q&A !
    For more information, please refer to the sticky post.

    Friday, July 17, 2020 2:57 AM