Hi folks,
I have an adonit jot pixel bluetooth stylus. Adapting someone else's
code (source http://gerev.github.io/laptop-cintiq/) I have it working
with uinput, posting ABS_PRESSURE and BTN_1/2 event codes and so on.
I'm running upstream.
What I'm wondering is; as the stylus relies on a bluetooth connection,
is it a suitable device to develop a kernel input driver for? And if
yes, are there any reference drivers you'd recommend I look at?
Many thanks in advance
David
On Tue, Jan 24, 2017 at 5:12 AM, David Farrell [off-list ref] wrote:
Hi folks,
I have an adonit jot pixel bluetooth stylus. Adapting someone else's
code (source http://gerev.github.io/laptop-cintiq/) I have it working
with uinput, posting ABS_PRESSURE and BTN_1/2 event codes and so on.
I'm running upstream.
What I'm wondering is; as the stylus relies on a bluetooth connection,
is it a suitable device to develop a kernel input driver for? And if
yes, are there any reference drivers you'd recommend I look at?
Hi,
Coincidentally, I talked to Peter yesterday about this very same
stylus. I can only talk for the Wacom Creative Stylus 2, which I have,
but which I believe is similar to yours in many aspects.
So if your stylus is similar to mine, it uses BLE (or Bluetooth 4).
And in that case, you don't really need to write a kernel driver, but
more a bluez plugin in the same way HID over GATT (HID over BLE) is
working. This requires connecting over BLE to the stylus, then create
a uhid device (and you will have to write the report descriptors
matching your device by reverse engineering it), and inject that uhid
device in the same way bluez does for HID over GATT. Then you just
need to forward the raw events from the device to the uhid node and
the kernel will simply translate the events for you.
As a starter, you can have a look at profiles/input/hog.c and
profiles/input/hog-lib.c in the bluez repository.
Of course, if the stylus is not using BLE, then it perfectly makes
sense to write a full kernel driver for it (but I strongly suspect it
uses BLE).
Cheers,
Benjamin
Many thanks in advance
David
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Benjamin,
Ah that makes sense, it was Peter who directed me towards a
driver-based solution. Thank you for your detailed response, this is
everything I need to get started.
David
On 25 January 2017 at 05:19, Benjamin Tissoires
[off-list ref] wrote:
On Tue, Jan 24, 2017 at 5:12 AM, David Farrell [off-list ref] wrote:
quoted
Hi folks,
I have an adonit jot pixel bluetooth stylus. Adapting someone else's
code (source http://gerev.github.io/laptop-cintiq/) I have it working
with uinput, posting ABS_PRESSURE and BTN_1/2 event codes and so on.
I'm running upstream.
What I'm wondering is; as the stylus relies on a bluetooth connection,
is it a suitable device to develop a kernel input driver for? And if
yes, are there any reference drivers you'd recommend I look at?
Hi,
Coincidentally, I talked to Peter yesterday about this very same
stylus. I can only talk for the Wacom Creative Stylus 2, which I have,
but which I believe is similar to yours in many aspects.
So if your stylus is similar to mine, it uses BLE (or Bluetooth 4).
And in that case, you don't really need to write a kernel driver, but
more a bluez plugin in the same way HID over GATT (HID over BLE) is
working. This requires connecting over BLE to the stylus, then create
a uhid device (and you will have to write the report descriptors
matching your device by reverse engineering it), and inject that uhid
device in the same way bluez does for HID over GATT. Then you just
need to forward the raw events from the device to the uhid node and
the kernel will simply translate the events for you.
As a starter, you can have a look at profiles/input/hog.c and
profiles/input/hog-lib.c in the bluez repository.
Of course, if the stylus is not using BLE, then it perfectly makes
sense to write a full kernel driver for it (but I strongly suspect it
uses BLE).
Cheers,
Benjamin
quoted
Many thanks in advance
David
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html