Hey there everybody…
I have a problem that i’ve been researching for a while now, and can’t seem to grasp all aspects of it.
I’m looking for a way to connect a USB prototype device (HID compliant) to unity, and use it in a web player build. I am using the pro version, so plug-ins are an option. In device manager inside windows it doesn’t appear as a gamepad, just as a standart HID device. No special driver involved.
As I understand it, this means NO native code plug-ins.
The problem is that the libraries that I’ve found so far (LibUsb, LibUsb-Win32, #usblib, LibUsbDotNet) and other solutions (such as the one in here: A USB HID Component for C# - CodeProject) all eventually use either hid.dll (windows) or libusb0.dll (sort-of-windows).
Now, let’s skip the part where I get tons of DllNotFoundExceptions… please? :roll: Even if I get it running in single player builds, this will not do in the end…
What solution exactly WILL work here?
Lets say that I’m willing to code from scratch (or hire people to do that for a nice fee). What programming language am I allowed to use here, and is it even possible? Do I need to write drivers for both Windows and OSx on the kernel level?
Is there a way to write plug-ins in C# on the Mono or Visual Studio frameworks that will access the USB interface? (And BTW- Does it matter if it’s on VS or Mono?).
How about XCode? There is plenty of code floating around about HID devices, but again… isn’t it C++, C or Objective C? I’m a novice when it comes to programming for OSx, so maybe I’m missing something here?
The closest thing in that area that I could come up with is using System.IO.Ports in Mono, but it only lets you access serial ports… So no go.
A possible (dirty) solution I am considering is maybe having a tiny application to run in the background that will handle the communication between unity and the device using local networking. I rather avoid that one, if possible.
Any insight will help here guys and girls. I appreciate any thought you might have on the matter…