locked
can not open build-in hid device

    Question

  • I have a notebook PC with a touch screen build-in, the touch screen is a hid device,  and it  has two interfaces, one  for report touch event and the other for debug;  

    I need to open the debug interface to read debug information.  In my code

    DeviceInformationCollection devInfo = await DeviceInformation.FindAllAsync(dev.Selector);
    if(devInfo.Count==1)
    {
    	await HidDevice.FromIdAsync(devInfo[0].Id, FileAccessMode.ReadWrite).AsTask().ContinueWith((Task<HidDevice> deviceTask) =>
    	{
         	  hidDevice = deviceTask.Result;
         	  if (hidDevice != null)
         	  {
                 hidDevice.InputReportReceived += hidInputReportReceived;
         	  }
         	  else
         	  {
                 var deviceAccessStatus = DeviceAccessInformation.CreateFromId(devInfo.Id).CurrentStatus;
    

    It can find the device , but when it opens the device, return null;  
    DeviceAccessInformation.CreateFromId() throws an exception "element not found".

    and I find devInfo[0].Name is the PC's name not my device's name ,but  devInfo[0].Id is my device's id.

    I disable the touch screen and insert another touch screen(its firmware is same as the build-in touch screen) into the usb port , it works well.

    the only difference is that one is build-in and the other is removeable.

    • Edited by whl_tingyu Friday, November 1, 2013 7:31 AM complete the description
    Friday, November 1, 2013 6:48 AM

Answers

  • it seems to be related to the divce or the windows store api,  unfortunately debugging your code with your device is beyond the scope of a forum post. Please feel free to open a support incident. Please go here: http://aka.ms/storesupport.

    regards,

    Jenny

    • Marked as answer by whl_tingyu Friday, November 15, 2013 6:50 AM
    Friday, November 15, 2013 6:29 AM

All replies

  • Hi whl_tingyu,

    According to your description, I think all is right, the build-in device you want to access represents itself just with the pc's name. And the name is just a display name, you should not treat it as other uses.

    Could you share with me more detail info about the build-in device? Or maybe you need to make sure that you could do so after seeking advice from the manufacturer.

    Regards!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, November 4, 2013 1:42 AM
    Moderator
  • Hi Xiaoliang,

    thanks,

    I am the manufacturer of the touch screen,and the notebook PC manufacturer made our product built-in;
    Our touch screen debug tools is developed with Win32API,and it works well;
    Now we want to develop a windows store app which can display the debug information,
    because some tablets with windows 8 maybe do not have traditional desktop.

    Our touch screen is recognized by windows 8.1 as two HID devices in Device Manager: 
    1,HID-compliant touch screen;
    2,HID-compliant vendor-defined device;

    "HID-compliant vendor-defined device" is the debug interface, I export the "HID-compliant vendor-defined device" information from the Registry.

    the difference is the field of "ContainerID" and  "Driver";

    built-in touch screen:

    Key Name:          HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\VID_27C6&PID_0002&MI_01\7&4d2ef96&0&0000
    Class Name:        <NO CLASS>
    Last Write Time:   11/1/2013 - 10:07 PM
    Value 0
      Name:            Capabilities
      Type:            REG_DWORD
      Data:            0xe0
    Value 1
      Name:            ConfigFlags
      Type:            REG_DWORD
      Data:            0
    Value 2
      Name:            ContainerID
      Type:            REG_SZ
      Data:            {00000000-0000-0000-ffff-ffffffffffff}
    Value 3
      Name:            HardwareID
      Type:            REG_MULTI_SZ
      Data:            HID\VID_27C6&PID_0002&REV_1025&MI_01
                       HID\VID_27C6&PID_0002&MI_01
                       HID_DEVICE_UP:FF00_U:0001
                       HID_DEVICE_UPR:FF00-FFFF
                       HID_DEVICE
    Value 4
      Name:            CompatibleIDs
      Type:            REG_MULTI_SZ
      Data:            
    Value 5
      Name:            ClassGUID
      Type:            REG_SZ
      Data:            {745a17a0-74d3-11d0-b6fe-00a0c90f57da}
    Value 6
      Name:            DeviceDesc
      Type:            REG_SZ
      Data:            @input.inf,%hid_device_vendor_defined_range%;HID-compliant vendor-defined device
    Value 7
      Name:            Driver
      Type:            REG_SZ
      Data:            {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0026
    Value 8
      Name:            Mfg
      Type:            REG_SZ
      Data:            @input.inf,%stdmfg%;(Standard system devices)
    Key Name:          HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\VID_27C6&PID_0002&MI_01\7&4d2ef96&0&0000\Device Parameters


    plug-in touch screen:

    Key Name:          HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\VID_27C6&PID_0002&MI_01\7&3acba3bf&0&0000
    Class Name:        <NO CLASS>
    Last Write Time:   11/1/2013 - 4:19 AM
    Value 0
      Name:            Capabilities
      Type:            REG_DWORD
      Data:            0xe0
    Value 1
      Name:            ConfigFlags
      Type:            REG_DWORD
      Data:            0
    Value 2
      Name:            ContainerID
      Type:            REG_SZ
      Data:            {5790c3eb-37e2-11e3-9b57-240a6468dd46}
    Value 3
      Name:            HardwareID
      Type:            REG_MULTI_SZ
      Data:            HID\VID_27C6&PID_0002&REV_1025&MI_01
                       HID\VID_27C6&PID_0002&MI_01
                       HID_DEVICE_UP:FF00_U:0001
                       HID_DEVICE_UPR:FF00-FFFF
                       HID_DEVICE
    Value 4
      Name:            CompatibleIDs
      Type:            REG_MULTI_SZ
      Data:            
    Value 5
      Name:            ClassGUID
      Type:            REG_SZ
      Data:            {745a17a0-74d3-11d0-b6fe-00a0c90f57da}
    Value 6
      Name:            DeviceDesc
      Type:            REG_SZ
      Data:            @input.inf,%hid_device_vendor_defined_range%;HID-compliant vendor-defined device
    Value 7
      Name:            Driver
      Type:            REG_SZ
      Data:            {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0082
    Value 8
      Name:            Mfg
      Type:            REG_SZ
      Data:            @input.inf,%stdmfg%;(Standard system devices)
    Key Name:          HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\VID_27C6&PID_0002&MI_01\7&3acba3bf&0&0000\Device Parameters


    • Edited by whl_tingyu Monday, November 4, 2013 3:16 PM complete the description
    Monday, November 4, 2013 3:12 PM
  • Hi whl_tingyu,

    Welcome back!

    As I have no device for testing, I will escalate it to more professional engineer.

    Thanks for your understanding!

    Regards!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, November 7, 2013 6:08 AM
    Moderator
  • Hi there,

    try to check device capability declarations for HID in the manifest.

    you can refer to http://msdn.microsoft.com/en-us/library/windows/apps/dn263091.aspx or sample: http://code.msdn.microsoft.com/windowsapps/Custom-HID-Device-Access-40c3aa8f

    FYI demo :http://channel9.msdn.com/Events/Build/2013/2-924b

    Regards,

    Jenny

    Wednesday, November 13, 2013 8:58 AM
  • Hi Jenny,

    Thanks,

    The device capability declarations for HID in the manifest is correct . The problem is that the app works well with the plug-in touch-screen but not with the built-in touch-screen. But the program writen with win32API works both well. So I think the problem maybe related with the windows store app sdk.

        I try to take the notebook apart,and take the built-in touch-screen off from the master-board,  and connect it to the notebook's external USB port, then the app works well. 

    The device capability declaration:

    <DeviceCapability Name="humaninterfacedevice">
        <Device Id="vidpid:27c6 0002">
          <Function Type="usage:ff00 0001"/>
        </Device>
    </DeviceCapability>


    Friday, November 15, 2013 4:39 AM
  • it seems to be related to the divce or the windows store api,  unfortunately debugging your code with your device is beyond the scope of a forum post. Please feel free to open a support incident. Please go here: http://aka.ms/storesupport.

    regards,

    Jenny

    • Marked as answer by whl_tingyu Friday, November 15, 2013 6:50 AM
    Friday, November 15, 2013 6:29 AM
  • Thanks.
    Friday, November 15, 2013 6:50 AM