ukarahan
Posts: 3
Joined: Fri Jul 24, 2015 6:33 am

Windows 10 iot Hid Communication

Fri Jul 24, 2015 7:00 am

Hello all ,

We have usb hid device that is connected to rapsberry 2 via usb.
I need to read and write some data to HID device.
I have tried hidapi (http://www.signal11.us/oss/hidapi/) but got
an exception.
(device_info_set = SetupDiGetClassDevsA(&InterfaceClassGuid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);)

Do you have alternative solution for this problem. (alternative library , source code ,driver example )

Thank you for your time .

System : raspberry 2, windows 10 iot ,visual studio 2015

fruitoftheloom
Posts: 24061
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Windows 10 iot Hid Communication

Fri Jul 24, 2015 7:32 am

ukarahan wrote:Hello all ,

We have usb hid device that is connected to rapsberry 2 via usb.
I need to read and write some data to HID device.
I have tried hidapi (http://www.signal11.us/oss/hidapi/) but got
an exception.
(device_info_set = SetupDiGetClassDevsA(&InterfaceClassGuid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);)

Do you have alternative solution for this problem. (alternative library , source code ,driver example )

Thank you for your time .

System : raspberry 2, windows 10 iot ,visual studio 2015
Did you also ask on the MSDN Forum ?

https://dev.windows.com/en-us/iot
Thinking outside the box is better than burying your head in the sand...

ukarahan
Posts: 3
Joined: Fri Jul 24, 2015 6:33 am

Re: Windows 10 iot Hid Communication

Fri Jul 24, 2015 8:23 am

Yes ,

I have posted but there is no reply yet

User avatar
Clanzer
Posts: 27
Joined: Wed Jun 13, 2012 1:42 pm
Location: UK
Contact: Website

Re: Windows 10 iot Hid Communication

Sat Aug 01, 2015 5:32 pm

There is an example project for VS2013 https://code.msdn.microsoft.com/Custom- ... s-40c3aa8f in C# and C++

So porting over as a universal application may not be to bad.

It is written with the VID/PID for the SuperMUTT device but just change these values in the package manifest and the constants.cs file to suit the VID/PID of your device.

This end I have been playing with interfacing one of our machines ARM interface with the Raspberry PI 2 and Windows 10 IOT.
The ARM interface communication is done via USB, but seems easier to change it to use SPI and make it as a Raspberry PI HAT design that plugs straight onto the board and keeps it all neat and tidy.



Cheers

Sean.
******************************
http://www.pthat.com
******************************

g0189a
Posts: 3
Joined: Sun Aug 02, 2015 8:32 pm

Re: Windows 10 iot Hid Communication

Thu Aug 06, 2015 2:14 am

I recently tried the same thing.

I got the robot kit project and thought it would work with my Logitech F310. But alas, no.

https://www.hackster.io/windowsiot/robot-kit

Then I found that the HCI device was hard coded in the code. So on to search for how to make my Logitech work....

The Windows driver kit has a sample program called HCI Client that will inspect the elements so you can find the right device. Run that in Visual Studio on your PC to get the values of the usage Page and usage ID at a minimum. This can take a while to download if you don't already have it.

Back in the robot kit source code files, the Controllers.cs file had this line with the XBox contorller hard coded. So i changed it to the method that included the vendor ID and product ID revealed by the HCI Client program. Now I have a Logitech joystick for the robot program.

Code: Select all

            string deviceSelector = HidDevice.GetDeviceSelector(0x01, 0x04, 0x46d, 0xc216);

User avatar
Clanzer
Posts: 27
Joined: Wed Jun 13, 2012 1:42 pm
Location: UK
Contact: Website

Re: Windows 10 iot Hid Communication

Sun Aug 16, 2015 2:59 pm

Have been playing with the Microsoft HidDevice class creating a Universal Application in Visual Studio and running into a lot of bugs.

Posted over on the MSDN forum which I will link from here and save repeating all the details.

https://social.msdn.microsoft.com/Forum ... WindowsIoT

So at the point now where I can connect, transmit and receive from my HID device and works great if I compile for X86 local Windows 10 machine. But as soon as I build and deploy to the RaspberryPI running Windows 10 IOT, then bytes being sent out from the application get corrupt by the time they hit the HID device. Data coming back from the HID device to the Raspberry PI seems fine though.

Anyone else playing with the HID class and getting any weird results, when comparing built code on local machine compered to remote device ?

Thanks

Sean.
******************************
http://www.pthat.com
******************************

User avatar
Clanzer
Posts: 27
Joined: Wed Jun 13, 2012 1:42 pm
Location: UK
Contact: Website

Re: Windows 10 iot Hid Communication

Mon Sep 28, 2015 8:26 am

Okay new Windows 10 IOT Release 10.0.10531.0 now fixes these issues and USB HID works !

Now to test the speed and see if it usable !
******************************
http://www.pthat.com
******************************

Return to “Windows 10 for IoT”