none
Using FindTargetFromId to get device from a product instance RRS feed

  • Question

  • I'm using the sample C# code (Hello World) to automate some of our WHCK work. I am attempting to run the tests on a certain SSID/VID of a device, and I'm not having much luck.

    ReadOnlyCollection < TargetData> data = pi.FindTargetFromId("HDAUDIO\\FUNC_01&VEN_10EC&DEV_0889"); (This SSID/VID is purely for example purposes)

    The data collection I get is empty, and I can only assume that's because it didn't find a device with that ID. I'm trying it on an inbox driver, does that make a difference? Also, the actual ID is longer than what is being searched for, does it have to be a character for character match? Thanks.

    Tuesday, October 9, 2012 1:55 PM

Answers

  • Try using Device Manager and look at Details tab to get the hardware ID for the device, then us that string for a test.  I haven't tried this myself, but I suspect the hardware ID is needed here.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Tuesday, October 9, 2012 2:05 PM
  • Figured it out, I had to have the complete Hardware ID in there, not just a subset.
    • Marked as answer by liquidiq Tuesday, October 9, 2012 8:50 PM
    Tuesday, October 9, 2012 8:50 PM

All replies

  • Try using Device Manager and look at Details tab to get the hardware ID for the device, then us that string for a test.  I haven't tried this myself, but I suspect the hardware ID is needed here.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Tuesday, October 9, 2012 2:05 PM
  • Donald is correct that you could look at the hardware ID. The device instance ID also works. It should match the whole ID.


    John -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, October 9, 2012 7:41 PM
  • Figured it out, I had to have the complete Hardware ID in there, not just a subset.
    • Marked as answer by liquidiq Tuesday, October 9, 2012 8:50 PM
    Tuesday, October 9, 2012 8:50 PM
  • Its Simple

    First right click in my computer .... choice Device manager ...  choice the yellow questform ? and reconnect , if the problem still dan you will get a number by tubbel shooting with Microsoft ,

    tnanks

    Wednesday, October 10, 2012 4:45 AM
  • HI,

    Need help

    I am currently doing an automation script to run WHCK tests.

    I am using sample C# code (Hello World)

    In this sample they have used Keyboard device as test target,So they just gave the Device ID of  keyboard for testing.

    In My case I am testing a filter driver as test target which comes in "Software Device" Section in "Selection" Tab.

    I want to call our filter driver through C#.

    Please help me on the same.

    Regards,

    Jeevan

    Thursday, February 21, 2013 7:04 AM
  • You can retrieve targets of type "Filter" from the target machine as:

    $targets=$machine.GetTargets({libraryname}::"Filter")

    once you get targets list from the machine, you can look for the target you want, in the list as:

    foreach ($target in $targets)

    {

    if($target.Name -eq "YourTatgetName")

    {

    # actions on the target

    }

    }

    • Proposed as answer by Nilesh90 Thursday, February 21, 2013 7:27 AM
    Thursday, February 21, 2013 7:26 AM
  • Hi Nilesh,

     Thnaks for ur reply..

    But what is "Libraryname" in this example?


    Thursday, February 21, 2013 8:33 AM
  • $targetData=$machine.getTestTargets([Microsoft.Windows.Kits.Hardware.objectModel.TargetType]::Filter)

    use this.

    Thursday, February 21, 2013 11:04 AM
  • Hi 

    If i want to run systemWHCK automation. 

    Can you please provide the further details for the below scripts.

    "ReadOnlyCollection<TargetData> data = pi.FindTargetFromSystem"

    Friday, September 27, 2013 7:12 AM
  • Here is the API reference:

    http://msdn.microsoft.com/en-us/library/windows/hardware/jj123616.aspx


    This posting is provided AS IS with no warranties, and confers no rights.

    Monday, September 30, 2013 4:13 PM