hansmbakker
hansmbakker

Reputation: 1234

Developing an HID input device driver for a BLE GATT device on Windows 10

(This is a crosspost from the MSDN forums since there hasn't been any response there for quite some time and I thought I would get better answers here.)

I have a BLE device containing a custom GATT service, of which I cannot modify the firmware. I want to listen for the GATT characteristic events from that service, and make Windows consume them as HID reports to make Windows recognize it as another device. How would I go about doing this?

I conducted some research, and found the information below:

My question is, what approach is needed here to create this driver?

Are GATT Profile drivers even still allowed on Windows 10, since it seems it is not allowed to create filter drivers for BthLeEnum?

Update

I really appreciate that Alain took the time to answer the question and therefore I marked his answer as answer to the question; however for me the question is not completely answered yet. Seeing that the question already got more than 10 votes, I think it deserves a more extensive answer. Points that could be improved / added are:

Update 2

I suppose that Alain recommended a UMDF HID minidriver over VHF because VHF requires writing a KMDF driver. UMDF has the benefits of easier debugging (can be debugged on local pc), less security (and signing) restrictions and no risk of bugchecking a machine when there is a bug in the driver.

Update 3

In order to make it possible to create a client application that injects RadialController events (rather than having to write a driver which is a very high barrier for private developers), I posted a request for it on Feedback Hub. Please consider voting for it if you think that is worth supporting.

Upvotes: 14

Views: 4289

Answers (3)

hansmbakker
hansmbakker

Reputation: 1234

I got this working as a Proof of Concept, but not reliably. Developing Windows drivers turned out to be too steep of a learning curve for the time I have available to invest in this.

Besides, as a private person I would never be able to distribute this to other people since drivers need to go through a signing and publishing process.

For the sake of knowledge exchange:

Upvotes: 0

JackR1
JackR1

Reputation: 81

In regards to the BLE GATT Profile driver samples in WDK 8.0, you can compile with VS2017 / WDK10 by following the steps here

I was able to compile the WpdHealthHeartRateService.

Upvotes: 0

Alain
Alain

Reputation: 71

The best approach to this would be to create a UMDF HID driver (https://learn.microsoft.com/en-us/windows-hardware/drivers/wdf/creating-umdf-hid-minidrivers) that installs on the bthleenum device node that is created for the device's custom service and use the new Bluetooth LE UWP apis (https://learn.microsoft.com/en-us/uwp/api/windows.devices.bluetooth.genericattributeprofile).

There is some ambiguity about the use of UWP Apis from non store application, but this is incorrect. These Apis are usable in pretty much every conditions. In case you need help setting up your project, here is a C++/UWP sample that can help you get started.

I hope this helps! Alain

Upvotes: 2

Related Questions