Commit graph

40 commits

Author SHA1 Message Date
Kristian Sloth Lauszus b4bbfecd09 Store the timestamp of the last Bluetooth DATA input report received on the interrupt channel
This can be used detect if the connection to a Bluetooth device is lost fx if the battery runs out or it gets out of range
2021-01-26 23:43:59 +01:00
Kristian Sloth Lauszus 9a0a4940b3 Setting the LED, lightbar, rumble via Bluetooth is now working 2021-01-19 20:28:47 +01:00
Kristian Sloth Lauszus 23ba34da47
Merge pull request #517 from fraca7/control-report-callback
Add a ParseBTHIDControlData virtual method similar to ParseBTHIDData,
2020-11-16 12:58:29 +01:00
Kristian Sloth Lauszus f500cc9b4c Only use simple pairing with the Xbox One S controller, as it did not work with the PS4 2020-11-15 19:18:57 +01:00
Kristian Sloth Lauszus 102746ef6b Xbox One S controller support is now finally working 2020-11-15 19:14:30 +01:00
Kristian Sloth Lauszus ad9360b865 Yet another go at getting the Xbox One S controller working
It just connects and opens a SDP channel it then disconnects the SDP channel and I get a "Paring Faild: 05 (Authentication Failure)"

For some reason I never receive the "IO Capability Request" event
2020-11-15 19:14:30 +01:00
Kristian Sloth Lauszus 7714e807f6 Added SDP support to the BTHID, as needed for the Xbox One S controller 2020-11-15 19:13:54 +01:00
Kristian Sloth Lauszus a347b3bace Enable simple paring mode 2020-11-15 19:13:49 +01:00
Jérôme Laheurte f075ea3025 Add a ParseBTHIDControlData virtual method similar to ParseBTHIDData,
for reports that are sent through the control pipe. This happens for
instance in response to a GET_REPORT.
2020-02-28 18:03:16 +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 Lauszus 285b21cdbc Check HCI Handle using function in BluetoothService class 2014-09-09 16:38:42 -07:00
Kristian Lauszus 106aff6411 Call registerBluetoothService in BluetoothService constructor
I needed to move the BluetoothService class down after the BTD class in order for it to work
2014-09-09 16:32:46 -07:00
Kristian Lauszus 25c8d87ba2 Added several variables to BluetoothService class
Also moved attachOnInit function into BluetoothService class, but this really belong somewhere else
2014-09-02 02:02:17 -07:00
Kristian Lauszus 7806212132 Removed some unnecessary functions and some other cleanup 2014-02-03 23:06:27 +01:00
Kristian Lauszus 2a1db31cf1 Can now read the IMU and touchpad values of the PS4 controller via Bluetooth as well
Thanks to Frank Zhao - see: http://eleccelerator.com/wiki/index.php?title=DualShock_4#0x11
2014-01-22 05:13:49 +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
Kristian Lauszus eea5c44b96 Now onInit() works with the PS4 library as well 2014-01-12 17:20:18 +01:00
Kristian Lauszus e9bd896ca2 Added support for the PS4 controller via Bluetooth 2014-01-10 17:44:51 +01:00
Kristian Lauszus fcdf6abfa0 Check protocol in setProtocol before sending it to the device 2013-12-30 16:11:19 +01:00
Andrew J. Kroll 14fda1372c Fix annoying warnings and provide an optimization. 2013-12-29 23:53:24 -05:00
Andrew J. Kroll f1af9b08ec Janitorial, whitespace fixes. No new code. 2013-12-25 05:09:57 -05:00
Kristian Lauszus ddaa6f0220 Fixed “comparison between signed and unsigned integer expressions” warning 2013-12-18 23:01:01 +01:00
Andrew J. Kroll fcaef6f5a2 Merge branch 'xxxajk' of github.com:felis/USB_Host_Shield_2.0 into xxxajk 2013-12-18 15:19:29 -05:00
Andrew J. Kroll 5785115cdb Type fixes, new debug macro, debug bug fixes. 2013-12-18 15:18:28 -05:00
Kristian Lauszus 471a8d9163 Set pin even if it should not pair to a device
Needed by some Bluetooth mice that always want authentication
2013-12-13 10:41:59 +01:00
Kristian Lauszus 1ef78c3674 Do not hardcode identifier when disconnecting 2013-12-13 10:38:41 +01:00
Kristian Lauszus 084c3f5478 Removed non-generic case 2013-12-12 01:01:50 +01:00
Kristian Lauszus 809e80a1b0 Clear and set flags in a more readable way 2013-12-11 09:59:58 +01:00
Kristian Lauszus b100677354 Fixed bug - epMUL was already defined 2013-12-05 07:39:28 +01:00
Kristian Lauszus 237a8a5800 Formatting 2013-12-01 18:36:19 +01:00
Kristian Lauszus 6004d61de2 Removed some unused code and cleanup 2013-11-27 00:07:58 +01:00
Kristian Lauszus bcc4afede5 Set protocol shouldn’t have it’s own state, as it will then sometimes not call the other states afterwards 2013-11-25 19:01:20 +01:00
Kristian Lauszus 627c390191 Minor 2013-11-25 18:46:10 +01:00
Kristian Lauszus a31cc42585 Use reinterpret_cast to cast from BTHID to HID class, so it can be used in the parser 2013-11-25 17:39:59 +01:00
Kristian Lauszus 5f49b321cb Print data receiving on the L2CAP control channel for debugging 2013-11-25 02:58:33 +01:00
Kristian Lauszus 253b43c06f Set protocol before establishing interrupt channel 2013-11-25 02:15:33 +01:00
Kristian Lauszus 4099314100 Can now set the LEDs on a keyboard 2013-11-25 01:45:24 +01:00
Kristian Lauszus 0735774a46 Forgot to init protocolMode 2013-11-25 00:32:06 +01:00
Kristian Lauszus aba004b047 Use the HIDBoot class to parse the incoming data 2013-11-24 23:51:45 +01:00
Kristian Lauszus f783b97cb9 Initial commit for BTHID library
To see incoming data uncomment PRINTREPORT in BTHID.cpp
2013-11-24 21:55:15 +01:00