locked
How use the Windows.Devices.Enumeration.Pnp.PnpObject?

    Question

  • Hello, everyone:

    I want to PnpObject.FindallAsync() to find  local network Upnp devices, but can't find right result.

    Why searched the same result either the computer is plugged into local network or not plugged?

    Microsoft's sample is the same.

    How can I do?

     


    Monday, December 26, 2011 3:42 AM

All replies

  • Hi Water,

    If I understand your question correctly, you would see the same devices whether or not the network cable is plugged in.

    What are you trying to accomplish in your code?

    -Jeff


    Jeff Sanders (MSFT)
    Tuesday, December 27, 2011 3:35 PM
    Moderator
  • Hi  jeff,

    Thank you very much for your reply.

     

    I want to search upnp devices in metro app as like IUPnPDeviceFinder::FindByUDN in windows7.

    I has tried to used Windows.Devices.Enumeration.Pnp.Pnpobject to solve the problem, used Microsoft's sample"Device Enumeration Sample" be testing.

    example:

    when the computer is plugged into company local network:

    it can searched out 185 objects.

    when the computer is not plugged into company local network:

    it also can searched out 185 objects.

    I am very confused.

     


    • Edited by water_q Friday, December 30, 2011 8:48 AM
    Friday, December 30, 2011 8:48 AM
  • Think of that list similar to a list of installed device drivers.  The capability exists but the device may not be plugged in.

    -Jeff


    Jeff Sanders (MSFT)
    Friday, December 30, 2011 1:27 PM
    Moderator
  • If I want to search out Upnp devices only, how set about PnpObject.FindallAsync()? 
    Saturday, December 31, 2011 1:33 AM
  • UPnP APIs are not available in WinRT. If your UPnP device supports PNP-X then you can discover and pair your device using metro device settings UI. Once the device is paired, you can enumerate your device using Windows.Devices.Enumeration and retrieve the device properties such as ServiceControlUrl, ServiceDescriptionUrl, ServiceEventSubscriptionUrl and IP address. Check the code snippet posted at http://social.msdn.microsoft.com/Forums/en-US/tailoringappsfordevices/thread/d40b02e1-27cd-4103-879f-913c7658edf1.
    Monday, March 5, 2012 11:26 PM
  • UPnP APIs are not available in WinRT. If your UPnP device supports PNP-X then you can discover and pair your device using metro device settings UI. Once the device is paired, you can enumerate your device using Windows.Devices.Enumeration and retrieve the device properties such as ServiceControlUrl, ServiceDescriptionUrl, ServiceEventSubscriptionUrl and IP address. Check the code snippet posted at http://social.msdn.microsoft.com/Forums/en-US/tailoringappsfordevices/thread/d40b02e1-27cd-4103-879f-913c7658edf1.

    This.

    PnP enumeration in the run time is about devnodes, device containers, interfaces, etc., or in other words KM PnP state.  A UPnP device doesn't have PnP state (devnodes) until it is paired/associated with the PC and is available on the network.  The pairing can be accomplished with the Win32 PNPX APIs, but not in the run time at the moment.  Or, you can manually add it with the add a device UI.

    After it is paired, you will be able to enumerate it using Enumeration.Pnp.


    Friday, August 16, 2013 6:08 PM