OliverDeLange
OliverDeLange

Reputation: 633

Android BLE logcat error: E/bt_btif: bta_gattc_process_indicate, ignore HID ind/notificiation

I have an app which communicates with a BLE device. It sends data packets @ 40hz to the phone. I'm using RxAndroidBle and everything works as it should (mostly anyway)

I'm currently trying to optimise for cpu and battery, and noticed for each packet received from the BLE device, i see the following in logcat: E/bt_btif: bta_gattc_process_indicate, ignore HID ind/notificiation

This can't be great for cpu/battery consumption, logging at 40hz... it also means useful logs dissapear as they're pushed out by these chatty ones. My device isn't a HID - as far as i can work out.

Q1: What does this log even mean? Q2: How do i stop it?

Sorry for asking a previously answered question, but there aren't any good answers and i wanted to ask under #rxandroidbe to see if there's something configurable in the libary.

Upvotes: 2

Views: 769

Answers (1)

Victor Ude
Victor Ude

Reputation: 433

I ran into this exact error in onCharacteristicChanged. It turned out that I was doing too much work in onCharacteristicChanged. For reasons that I can't remember I thought that it was a good idea to launch a Kotlin coroutine in that callback on every notification for streaming data. We're talking something like 100 notifications per second and every one was launching a coroutine. It was actually a terrible idea.

Once I cleaned up that method the error spam went away. I searched pretty extensively before arriving at that point and could not find any meaningful way to decipher the error from ADB Logcat so I started poking around in the source. Hopefully that info helps somebody else out in the future.

source: bta_gattc_act.c

Upvotes: 1

Related Questions