Commit Graph

198 Commits

Author SHA1 Message Date
Alan Ott 6ad666c5b5 Updated Binary. hidapi-0.6.0 2011-04-08 20:05:11 -04:00
Alan Ott d7f5f2cca5 Binary on Mac OS X 2011-04-08 19:39:54 -04:00
Alan Ott 3f341d2468 Merge branch 'master' of github.com:signal11/hidapi 2011-04-08 19:35:31 -04:00
Alan Ott f61cea6e69 Makefiles for MinGW 2011-04-08 18:48:12 -04:00
Alan Ott c54aba0897 Merge branch 'master' of github.com:signal11/hidapi 2011-02-09 08:43:02 -05:00
Alan Ott 0123bb91b7 Merge branch 'master' of github.com:signal11/hidapi 2011-02-09 08:37:34 -05:00
Alan Ott 265cefb1d3 Print error when hid_read() fails. 2011-02-09 08:37:11 -05:00
Ludovic Rousseau f808275822 Detach from the kernel only if needed
We first check that the HID device is managed by the kernel before
calling libusb_detach_kernel_driver(). This will avoid side effects of
libusb_detach_kernel_driver() like also doing a
libusb_release_interface()

Ludovic's original patch modified by Alan Ott <alan@signal11.us>
2011-02-08 09:38:46 -05:00
Alan Ott 746873f9cc Merge branch 'master' of github.com:signal11/hidapi 2011-01-18 23:07:38 -05:00
Alan Ott eebf197414 Change interface to interface_number in hid_device_info struct.
Forgot to add to previous commit.
2011-01-18 23:05:58 -05:00
Alan Ott cbdd2a6e14 Merge branch 'master' of github.com:signal11/hidapi 2011-01-18 23:04:37 -05:00
Alan Ott 98639e1f77 Change interface to interface_number in hid_device_info struct.
Forgot to add to previous commit.
2011-01-18 23:03:45 -05:00
Alan Ott 92fa9d8ee3 Merge branch 'master' of github.com:signal11/hidapi 2011-01-18 23:03:10 -05:00
Alan Ott 3290860713 Change interface field to interface_number in hid_device_info struct.
Change field named interface to interface_number because Visual Studio uses
interface as a keyword for managed C++.
2011-01-18 23:00:59 -05:00
Alan Ott 7384f39ec5 Merge branch 'master' of github.com:signal11/hidapi 2011-01-18 22:54:41 -05:00
Alan Ott a93cdfbeac Add the interface number to hid_device_info on Linux/libusb implementation.
The interface number is added to the hid_device_info struct. Since the
Linux/libusb implementation can't put the Usage and Usage Page in the
hid_device_info struct because it requires detaching the kernel driver, the
interface number is added instead so that users with composite HID devices
can differentiate between the interfaces on the device.
2011-01-18 22:52:06 -05:00
Alan Ott a0f8bec509 Remove the Usage and Usage Page code from the libusb/Linux implementation.
This is removed because it requres detaching the kernel driver for the
device.  This is too invasive to be done on a call to hid_enumerate().
2011-01-18 22:46:54 -05:00
Alan Ott 7108ca446b Merge branch 'master' of github.com:signal11/hidapi 2011-01-18 21:41:01 -05:00
Alan Ott f3009ca22e Merge branch 'master' of github.com:signal11/hidapi 2011-01-18 21:38:17 -05:00
Alan Ott 0dd77c86be Add release_number to hidtest.
Added a printf() with the release number to the hidtest test program.
2011-01-18 21:33:53 -05:00
Bastaan Veelo ba51d59a4e hid_device_info with bcdDevice release number. 2011-01-18 18:38:35 -05:00
Alan Ott 1cd43e9d30 Fixed a bug I introduced when cleaning up. 2011-01-15 01:26:40 -05:00
Bastaan Veelo b04545e118 Fill in the Usage Page and Usage values on Mac. 2011-01-14 18:54:38 -05:00
Alan Ott 993919fa8d Initial stab at support for composite devices. To do this, 3 tings
had to happen:
1. Create a hid_device_info struct for each interface which
   reports to be HID, rather than one for each device.
2. Parse and report the Usage Page and Usage for each.
2011-01-14 18:51:54 -05:00
Alan Ott 64daa8adbc Support for Usage Page and Usage for each device in the hid_device_info struct. 2011-01-13 19:48:44 -05:00
Bastaan Veelo 897c45f360 Fill in the Usage Page and Usage values on Mac. 2011-01-13 19:44:07 -05:00
Alan Ott 3a4192eb45 Support for Usage Page and Usage for each device in the hid_device_info struct. 2011-01-11 23:59:12 -05:00
Alan Ott f5dceac5b9 Support for Usage Page and Usage for each device in the hid_device_info struct. 2011-01-11 23:38:15 -05:00
Alan Ott c3c0c9062a Took out register_error() to prevent warning, but marked it with TODO. 2011-01-07 10:23:40 -05:00
Ludovic Rousseau 49122c26d5 Append instead of overwrite CFLAGS
The user may have a custom CFLAGS with debug flags like -Wextra. These
flags should be used instead of overwritten
2011-01-07 10:17:39 -05:00
Ludovic Rousseau 02c55187a7 Use explicit file names
*.o does not match ../hidtest/hidtest.o so we must use an explicit list
of .o file names
2011-01-07 10:17:30 -05:00
Ludovic Rousseau 81382f21d8 Make "make clean" idempotent
Do not fail if the files to remove do not exist
2011-01-07 10:17:24 -05:00
Alan Ott 5e594ebc95 Ensure that -1 is returned on Linux after a device has been disconnected (unplugged). 2010-12-28 11:23:08 -05:00
Alan Ott 486fe65d94 skip is defaulted to 1. There is no need to re-set it to 1. 2010-12-22 00:08:39 -05:00
Alan Ott ec07bca7a9 When devices are unplugged, libusb devices will fail (and return failure).
More of these cases are now checked for.
2010-12-22 00:04:35 -05:00
Alan Ott afc41b7b1d Moved the cleanup of libusb transfer objects to hid_close(), and out of the
read_thread().  This way the sequence of disconnecting the device and then
calling hid_close() will not cause a crash.
2010-12-21 13:24:26 -05:00
Alan Ott 02b5007fc4 Made the Mac implementation robust to disconnects and re-connects while a device has an open handle. 2010-12-21 00:55:04 -05:00
Alan Ott c11c1bc463 new binary 2010-12-09 14:17:54 -07:00
Alan Ott 7a6ef4a7b5 Merge branch 'master' of github.com:signal11/hidapi 2010-12-08 13:38:34 -07:00
Alan Ott cc41195b5c Fixed a 64-bit issue. The code in the Apple docs doesn't work for 64-bit. On 64-bit systems long is 64-bits, but on 32-bit systems it's 32-bits. The function get_long_property() was changed to be get_int_property(), and references to long were changed to int32_t.
Thanks to Ulf Soderberg and Ludovic Rossuau for pointing out this problem.
2010-12-08 13:32:31 -07:00
Ludovic Rousseau 83483325bb Do not use printf() unconditionally
The problem is that the file descriptor 1 used by printf() may not be
stdout but somethink else. For example a daemon may close fds 0, 1 and 2
and reuse them to open files or sockets. So using printf() may send data
on a file or socket opened by the application.

Errors will now be logged to stderr only if DEBUG_PRINTF is defined.
2010-11-29 12:28:28 -05:00
Ludovic Rousseau 8f3ccc3ec2 Avoid double inclusion of hidapi.h
Use HIDAPI_H__ instead of __HIDAPI_H__
2010-11-29 12:23:02 -05:00
Ludovic Rousseau b09db7eb66 Avoid double inclusion of hidapi.h
Use the classic
 #ifndef __HIDAPI_H__
 #define __HIDAPI_H__
 ...
 #endif
2010-11-29 12:22:52 -05:00
Alan Ott ddda2e4e9e License files showing modified, but they aren't. Probably a line-ending problem. 2010-11-21 20:02:32 -05:00
Ludovic Rousseau f9c06d35b2 Check libusb_get_active_config_descriptor return value
Avoids a crash if libusb_get_active_config_descriptor() returns with an
error code.
2010-11-21 16:18:41 -05:00
Ludovic Rousseau 025d81a5a3 use pkg-config to find udev library 2010-11-21 16:18:09 -05:00
Ludovic Rousseau b91198473f Remove 2 useless lines
intf pointer value is reset at each step of the for() loop. So no need
to increment it at the end of the loop.
2010-11-16 23:22:06 -05:00
Alan Ott dbc0ee08de Changed the logic a bit to make it more concise. 2010-11-16 23:18:37 -05:00
Ludovic Rousseau 9fac48e44b Wait for cancellation to complete
read_thread(): if a transfer was in progress then
libusb_cancel_transfer() will return with no error, then we must wait to
the transfer cancellation to complete. Otherwise the transfer will/may
complete after the resources have been freed and we get a crash.
2010-11-16 23:12:09 -05:00
Alan Ott 6c34bbf06b Merge branch 'master' of github.com:signal11/hidapi 2010-11-16 22:50:48 -05:00