HID over GATT reading characteristics from Android

6 posts / 0 new
Last post
BB
Offline
Last seen:3 years 8 months ago
Joined:2015-11-03 12:16
HID over GATT reading characteristics from Android

Dear reader,
I have created a HID over GATT profile with a single input and output report. However, when I try to read the input report from Android when the Android version is 5.0 or newer I get "Need BLUETOOTH_PRIVILEGED permission". Is there a way to communicate HID reports with Android?
By the way, it seems that OSX has similar restrictions.

Regards,
Wouter

Device:
MT_dialog
Offline
Last seen:1 month 2 days ago
Staff
Joined:2015-06-08 11:34
Hi BB,

Hi BB,

If i am not mistaken from the android version 5.0.2 you need this permission in order to communicate with an HID device over bluetooth, if you are using a third party application the android won't grand you that priviledge, it seems that its only for the system or manufacturer apps.

Thanks MT_dialog

Joacimwe
Offline
Last seen:1 year 4 months ago
Guru
Joined:2014-01-14 06:45
Is there any particular

Is there any particular reason you want to access the HID characteristics from Android? The system takes care of it properly so you can use BLE devices as standard keyboards, mice etc.

And yes, you can't access them in iOS either.

Note that you will still be able to access the other BLE services in your peripheral from Android and iOS.

BB
Offline
Last seen:3 years 8 months ago
Joined:2015-11-03 12:16
What I want to achieve is

What I want to achieve is that my device (which is a new kind of HID device, so not a keyboard or a mouse) is recognised as a HID device by a host when I connect it either through Bluetooth and USB. I want it to be transparent how the device is connected. I want to use the input and output report to exchange data between the host and the peripheral. I have a report map with a single input and output report.

I noticed that the device information characteristics and the battery service characteristics can be read.

MT_dialog
Offline
Last seen:1 month 2 days ago
Staff
Joined:2015-06-08 11:34
Hi BB,

Hi BB,

有点均的事情nt with HID over GATT on the android phones, if you are trying to read HID characteristics with android your device needs to be rooted in order for your application to be granted with that kind of privilege.

Thanks MT_dialog

techwolf12
Offline
Last seen:3 months 2 weeks ago
Joined:2016-04-13 12:57
Hi,

Hi,

What we do is the following:

Some non rooted phones can have custom recovery firmware where you are able to remount the /system partition as read and write. After doing this you move the app from "/data/app/" to "/system/priv-app/".
The app needs to have the permission

If you reboot your phone you can now use the app.