Commit Graph

32 Commits

Author SHA1 Message Date
Ludovic Rousseau bfb2b5924d Linux: Remove unused function register_error()
Fix compiler warning
hid.c:93:13: warning: 'register_error' defined but not used [-Wunused-function]
2012-09-21 10:49:09 -04:00
Ludovic Rousseau 61757847c4 Linux: Fix warning: enumeration value not handled in switch
hid.c:282:5: warning: enumeration value 'DEVICE_STRING_COUNT' not handled in switch [-Wswitch-enum]
2012-09-21 10:49:03 -04:00
Ludovic Rousseau 6761e3f5ba Linux: Fix warning: no previous prototype
hid.c:190:1: warning: no previous prototype for 'parse_uevent_info' [-Wmissing-prototypes]
2012-09-21 10:48:54 -04:00
Ludovic Rousseau 367fc3f3aa linux: Fix bug on mbstowcs() usage
In case of error mbstowcs() returns (size_t) -1
It is not a negative value since mbstowcs() returns a size_t (unsigned)

Fix compiler warning:
hid.c: In function 'utf8_to_wchar_t':
hid.c:105:3: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
2012-09-21 10:48:36 -04:00
Thomas Perl 807afbc35c Linux: Fix return value handling of mbstowcs() 2012-07-17 22:31:05 -04:00
Alan Ott 48352615f0 Linux: Small refactoring of Thomas's previous patch 2012-07-17 22:31:05 -04:00
Thomas Perl 36f7dec134 linux/hid.c: Fix enumeration for Bluetooth devices 2012-07-16 01:09:13 -04:00
philip 1186ca26c7 All: Make serial_number parameter to hid_open() const.
This prevents a warning when passing in a literal.
2012-03-28 18:05:49 -04:00
Vadim Zaliva 8717b87398 Linux/hidraw: Fix return value string functions
get_serial_number()
	get_manufacturer_string()
	get_product_string()

This matches the documentation in header file to return 0 on success and -1
on error.
2012-02-28 11:26:22 -05:00
Alan Ott b57e8f6dac Linux: Don't set locale if it's already been set
Adapted from a patch received from Axel Rohde <axel.rohde@gmail.com>
2012-02-27 12:10:29 -05:00
Alan Ott 2a599c2387 Fixed simple logic error.
Emailed to me by Frode Austvik <edorfaus@xepher.net>
2011-09-15 14:12:22 -04:00
Frode Austvik 686acc0507 Implemented the USB interface number for Linux/hidraw implementation.
Initial code by Frode Austvik <edorfaus@xepher.net>
Some modification and documentation by Alan Ott <alan@signal11.us>
2011-09-15 09:15:46 -04:00
Alan Ott c41e806042 Add empty hid_init() and hid_exit to linux/hid.c 2011-09-10 17:47:08 -04:00
Alan Ott abd82e6037 Fix memory leaks in linux/hidraw implementation.
Zbigniew Czapiga noticed that some of the udev objects in linux/hid.c weren't
being freed properly.
2011-08-29 11:20:09 -04:00
Alan Ott 8066251aa8 Add ioctl definitions
Added the HIDIOCSFEATURE and HIDIOCGFEATURE ioctl macros to hid.c so that it
will compile with older kernel headers. This of course doesn't make it _run_
with older kernels. Some distros ship older kernel headers than the running
kernel.
2011-08-08 21:16:09 -04:00
Alan Ott e62dba691d hid_read_timeout() (Linux and Windows).
hid_read_timeout() will execute a blocking read up until a timeout has been
reached or data has been received.

This patch implements it on all platforms and comes from Urs Fleisch.
Commit log message by Alan Ott.

Signed-off-by: Urs Fleisch <urs.fleisch@gmail.com>
Tested-by: Alan Ott <alan@signal11.us>
2011-08-08 21:01:37 -04: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 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
Bastaan Veelo ba51d59a4e hid_device_info with bcdDevice release number. 2011-01-18 18:38:35 -05:00
Alan Ott 09cb41aada Additional licenses. HIDAPI is now GPLv3, BSD, or the original license,
at the discretion of the user. This should provide maximum flexibility and
freedom.
2010-09-13 11:15:24 -04:00
Alan Ott 17c4c9251c Changed hid_error() to return const. 2010-08-21 13:22:03 -04:00
Alan Ott 65331407a7 Made the hid_error() return wchar_t* so we can get translated error messages. 2010-08-10 14:58:59 -04:00
Alan Ott 54c8061ec5 Fixed compile warning. 2010-07-28 21:43:51 -04:00
Alan Ott 65264446c3 Cleaned up output (printf()) 2010-07-28 21:43:11 -04:00
Alan Ott 6983cb4da0 Made hid_close() NULL-tolerant. 2010-07-28 21:14:36 -04:00
Alan Ott da1ab35011 Fixed up the header comments. 2010-07-28 20:32:41 -04:00
Alan Ott aa3d51925a Changed the interface to use a pointer instead of an int as the device handle.
This is only implemented on Linux so far.
2010-07-24 11:05:36 -04:00
Alan Ott 844fd35c0c Set/Get Feature Support for Linux. 2010-07-10 21:48:24 -04:00
Alan Ott d2489f8755 Support for getting USB strings (Manufacturer, Product, Serial) from
the device during runtime (as opposed to enumerate-time).
2010-07-07 23:48:29 -04:00
Alan Ott d6db1ec8ca Worked around a problem in Linux kernels prior to 2.6.34.
Fixed non-blocking operation.
2010-07-03 15:33:22 -04:00
Alan Ott ebc18502b7 Added the hidapi_enumerate() interface on Linux.
Added manufacturer and product strings to the hid_device struct.
2010-07-01 17:39:24 -04:00
Alan Ott 6c0ee6befc Made the hidapi_enumerate() functional.
Added non-blocking operation.
2010-07-01 17:10:45 -04:00