Page 1 of 2

Question about XHC-HB04 pendant plugin.

PostPosted: Thu May 10, 2018 3:32 pm
by kig23
I'm working on a new project and have to deal with HID/USB device. I'm wondering if somebody knows which library is used to write the XHC-HB04 plugin or maybe is used P/Invoke.

Thanks in advance

Re: Question about XHC-HB04 pendant plugin.

PostPosted: Thu May 10, 2018 4:27 pm
by Haik
For that Xamarin "OpenTK.Input" is used. Check out https://developer.xamarin.com/api/namespace/OpenTK.Input/

Keep in mind it's not .Net 2 compatible. Hope this helps. :)

- Haik

Re: Question about XHC-HB04 pendant plugin.

PostPosted: Thu May 10, 2018 4:45 pm
by kig23
Thanks Haik. Maybe Balazs can answer this question. But i think that they didn't use openTK.input, because of the fact that openTK.input doesn't work with .Net Framework 2.0 like you told me. UCCNC ver. 1.2047 requiers .NetFramework 2.0 and the XHC-HB04 plugin is written by cncdrive (i think), so the plugin should work with .NetFramework 2.0.

Re: Question about XHC-HB04 pendant plugin.

PostPosted: Thu May 10, 2018 6:20 pm
by Robertspark
You won't get much info out of cncdrive on the xhc-hb04, because it took them a fair bit of time to reverse engineer the pendant which is fair enough.

If you search you may find some discussions on it and other pendants (I had a go at one a long time ago dabble)

If you have a look at the shuttle Xpress pendant I attempted (it works, never quite finished) I listed how I tried to do it and I think listed the source code etc.

Re: Question about XHC-HB04 pendant plugin.

PostPosted: Thu May 10, 2018 7:16 pm
by kig23
Thanks Rob.

Re: Question about XHC-HB04 pendant plugin.

PostPosted: Thu May 10, 2018 9:51 pm
by cncdrive
Hi,

Yes, Rob is right. We do not give out the source of the pendant plugin, because it took us lots of time to make it work and concurency then might use our code if it will go public.
That pendant has an API too made by the manufacturer of the pendant which you could use to communicate with the pendant, you can find the API posted somewhere. (I don't recall now where did we find it)
But the issue with that API library is that it is pretty buggy. So finally we did not use it, but we sniffed the USB packets between the API and the pendant and wrote our own HID library for it.
As said this took us an awful amount of time is why we don't want to make the source code public.

Re: Question about XHC-HB04 pendant plugin.

PostPosted: Fri May 11, 2018 5:57 am
by kig23
Hi Balazs,
thanks, but i think you misunderstood me. I'm not interested in the souce code of the pendant. I asked only which library is used to write the plugin. Thanks again.

Re: Question about XHC-HB04 pendant plugin.

PostPosted: Fri May 11, 2018 6:01 am
by Robertspark
I expect it used a few libraries

What do you want the library to do?

Which bit are you having problems with?

Is it the usb communication side of things you are asking about?

Re: Question about XHC-HB04 pendant plugin.

PostPosted: Fri May 11, 2018 6:09 am
by cncdrive
Hi,

We did not use any premade library, we implemented our own HID device using the hid.dll Windows API and sent and received data via data stream using user32.dll and setupapi.dll and kernel32.dll Windows API functions.

Re: Question about XHC-HB04 pendant plugin.

PostPosted: Fri May 11, 2018 6:40 am
by Robertspark
DLL = dynamic link library... So you did use "premade" libraries, and a few of them, just they were the inbuilt Microsoft API ones and not created by others with licencing / credit /copyright acknowledgement required