Commit graph

36 commits

Author SHA1 Message Date
Daniel Gibson 4214caff70 Derive HIDUniversal from HIDComposite
They were mostly the same, I only had to keep the original
version of Poll() because while the differences are very small,
I don't think that unifying them is possible without needlessly
complicating things.
For this to work I had to make the private fields of HIDComposite
protected instead. I took the "+1" in HIDInterface::epIndex[]
from the original HIDUniversal class.
2021-01-13 15:46:46 +01:00
Daniel Gibson 323de96d6e HIDUniversal: Remove unused member and methods
With the comparing buffer/removing duplicates functionality gone,
prevBuf, BuffersIdentical() and SaveBuffer() aren't used anymore.
2021-01-13 10:59:35 +01:00
tomasyk f66d02d608 Remove comparing bufffer functionality
I am using HID for Oregon Scientific WMRS200, and polling reports removed any sequence of 2 or more identical characters, e.g. instead valid sequence
FF FF 0 42 0 B8 0 2C 3C 0 0 0 62 1
i get
FF 0 42 0 B8 0 2C 3C 0 62 1
There is no need to compare previous buffer with current buffer, as they can be identical and still this should not be ignored. My sequences are built from smaller sequences, where first byte is lenght of sequence to concatenate. Usually it is concatenated from sequences of 1 byte. E.g. 01 FF, 01 FF, 01 00, 01 42 etc. But current code is filtering second 01 FF and result is only one FF in sequence, instead of FF FF. Filtering is not needed, because data are obtained using inTransfer.
2021-01-13 10:56:16 +01:00
Daniel Gibson 6d7984ade2 Log info when not adding Interface/Endpoint because max is reached 2021-01-13 07:14:36 +01:00
Daniel Gibson 59af2be74f HIDUniversal, HIDComposite: Don't overflow hidInterfaces[] or epInfo[]
If a connected device has more than 3 (maxHidInterfaces) HID interfaces,
which is not unusual with modern keyboards, EndpointXtract() wrote
beyond the hidInterfaces[] array and corrupted bHasReportId, PID + VID.

The same could happen with the epInfo[] array.
Now this is fixed by checking bNumIface/bNMumEP before adding new
elements to those arrays.
2021-01-12 01:42:48 +01:00
Kristian Sloth Lauszus 597d389ae6 Fixed bit mask indicating the transfer type when reading the attributes in an endpoint
Fixes #313
2017-09-05 10:37:32 +07:00
Kristian Sloth Lauszus 42948831ce Explicit cast millis() and micros() to uint32_t, as it is uint64_t on the Arduino 101 2017-02-12 16:58:14 +01:00
Kristian Sloth Lauszus 6fb48f48e4 Fix millis() and micros() rollover bug
Also replace long with int32_t, so it is not architecture dependent
2017-02-12 15:10:07 +01:00
Pavel Fatin 969eabb8d7 Compatibility with Arduino's core HID / Mouse / Keyboard libraries
The following collisions resolved:

hid.h -> usbhid.h
hid.cpp -> usbhid.cpp
HID -> USBHID
HID_BOOT_PROTOCOL -> USB_HID_BOOT_PROTOCOL
HID_PROTOCOL_NONE -> USB_HID_PROTOCOL_NONE
HID_PROTOCOL_KEYBOARD -> USB_HID_PROTOCOL_KEYBOARD
HID_PROTOCOL_MOUSE -> USB_HID_PROTOCOL_MOUSE

As a result, it's possible to use the library together with Arduino's bundled HID / Mouse / Keyboard libraries (Leonardo, Micro, or Due).

https://www.arduino.cc/en/Reference/MouseKeyboard
2016-01-16 20:34:16 +01:00
Kristian Sloth Lauszus fb723fcbb0 Don't set epAttribs to 0, as this will set bmNakPower to 0 as well. Instead set bmSndToggle and bmRcvToggle explicit to 0.
Fixes: #184
2015-11-18 00:11:33 +01:00
Kristian Sloth Lauszus a2265ea0a9 All these files changes were changed in: bc8000f782
I suspect Andrew used force push to overwrite the history
2015-03-19 18:11:22 +01:00
Andrew J. Kroll 2412be1bd9 Janitorial tab removal 2015-03-12 18:10:04 -04:00
Andrew J. Kroll d25f28109d all sources to LF 2015-02-22 13:18:45 -05:00
Kristian Lauszus dd600b4895 Don't print incoming serial data if debugging is on by default 2014-06-29 18:06:27 +02:00
Andrew J. Kroll 15974fcd54 Merge branch 'master' of github.com:felis/USB_Host_Shield_2.0 into xxxajk 2014-05-23 00:10:24 -04:00
Andrew J. Kroll d56ed57495 Fix 1 month rollover bug -- Lei Shi found this one in one place, I found the problem all over the library and patched them all. 2014-05-22 23:36:33 -04:00
Kristian Lauszus 67cb06e858 Add space between bytes printed for debugging 2014-05-21 23:29:15 +02:00
Kristian Lauszus 1ebce9b877 Some files were missing copyright section 2014-03-07 02:17:47 +01:00
Kristian Lauszus b25c7d2f3c Made it easy to disable printing incoming data in hiduniversal 2014-02-03 23:11:44 +01:00
Kristian Lauszus da2ee95445 Added support for the PS4 controller via USB
Also improved the PS4BT library
2014-01-18 22:36:01 +01:00
Andrew J. Kroll f1af9b08ec Janitorial, whitespace fixes. No new code. 2013-12-25 05:09:57 -05:00
Andrew J. Kroll 77efe42a71 Fix hidboot not allocating or checking properly on mouse.
Removal of duplicate code: Force all drivers to delay after setting address.
2013-12-18 22:02:51 -05:00
Andrew J. Kroll 5785115cdb Type fixes, new debug macro, debug bug fixes. 2013-12-18 15:18:28 -05:00
Andrew J. Kroll e18eb57752 fix all warnings for ARM, fix a few small bugs 2013-12-04 18:40:23 -05:00
Oleg Mazurov 9e1ea2ac1b fixed Get Conf Descr and delay after SetAddr in hiduniversal 2013-09-10 16:10:34 -06:00
Andrew J. Kroll e01df49bf3 refactor entire library for hex printing 2013-06-17 15:37:09 -04:00
Oleg Mazurov 261e5f1bd2 commit 2013-06-11 21:11:43 -06:00
Andrew J. Kroll 814c2baf55 debugging macro fixes 2013-05-16 16:43:51 -04:00
Andrew J. Kroll 5ec8889fa3 Unify a bunch of debug fail messages to a single point. More needed. 2013-03-30 10:29:16 -04:00
Andrew J. Kroll 904f2ff25a Clean up code formatting to industry standards. 2013-03-28 04:46:43 -04:00
Andrew J. Kroll 629594f957 Merge my debug changes.
Merge my format sanity changes.
Track everything.
2013-03-28 03:26:02 -04:00
Oleg Mazurov f2dd1215bd Logitech Extreme 3D Pro Joystick report parser added 2012-05-08 22:33:00 -06:00
Oleg Mazurov 89ff7d24ed added delays in Get Config 2012-05-08 14:38:04 -06:00
Oleg Mazurov 3d068a0637 HID joystick support and examples 2012-04-03 14:09:04 -06:00
Oleg Mazurov 2c728cd7dd Arduino-1.0 compatibility added 2012-01-10 12:49:42 -07:00
Oleg Mazurov a97fb4bbda PID 0609 added to prolific driver 2011-10-19 17:33:15 -06:00