From: Jaco <ja...@jd...> - 2019-09-29 05:46:28
|
Thanks for the reply. It is a very simple interface. You send a command and get a response string. I have it all working using serial. But now there is a USB version of the device and it uses the same protocol. You send it a command asking for data and then will receive the data. The reason I use Pascal is we use Lazarus the open- source X-Platform dev tool. I build the software once and it will run on Linux and Windows. I know Python, Java, C++, etc. Lazarus, in this case, in this case makes it very easy to develop for the Raspberry Pi. Regards. -----Original Message----- From: Ларионов Даниил <scu...@ya...> Sent: 28 September 2019 11:37 PM To: Jaco <ja...@jd...>; lib...@li... Subject: Re: [libusb] Using LibUSB to communicate with HID ? That depends on the device(s). Common perception is that HID protocol is ridiculously complicated and if you use naked LibUSB for it you'll re-do a lot of work already implemented in HIDAPI. However, that is true only if (a) you don't know what device you'll be talking to (except that it will be a HID device), and thus you have to make a flexible "omnivorous" interface; or (b) if you do know the device, but its configuration is very sophisticated (a multi-layer tree of data channels of different types; I haven't seen anything like that yet, but it's surely a possibility within HID standard). If you know exactly the device you'll be talking to AND it is not too complicated (~1...5 data channels), then using naked LibUSB might actually be more convenient AND faster to implement than learning the HIDAPI, well, API. That being said, there is no reason whatsoever to use Pascal in 2019 unless that's the only language you've been taught in school and you haven't had any time or opportunity to learn C++ since then. If this is the case, you have no other option except to embrace the pain. -- Даниил Ларионов 28.09.2019, 23:13, "Jaco" <ja...@jd...>: > Hi all. Sorry if this has been asked before. I am new to USB. I am slowly figuring out how USB works. It is not as simples as serial. I see in the documentation that it is recommended to use another library (HIDAPI library) if you want to communicate with HID devices. The thing is I am using Pascal to do the development and there is a wrapper / binding for LibUSB that works very well. So can I use LibUSB to do the same works as the HID libraries would?. It seems some of them sit ontop of LibUSB anyway. > > ,, > > _______________________________________________ > libusb-devel mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-devel |