Reputation: 2873
I am developing for BLE in Android. The Android can send data to BLE device by Gatt.writeCharacteristic
.
But When I write consecutive Characteristic to BLE device (5 times in 1 Second) , I will get GATT_DISCONNECTED
and it return null
when I try to getService
and GetCharacteristic
.
I have seen some BLE LED product in market. It use a color picker in Android like the following picture:
When user change the color fast on the color picker , the BLE LED also change the color immediately.
How to write characteristic fast and stable for BLE in Android like the BLE LED product in market ?
Upvotes: 3
Views: 4215
Reputation: 3694
When you call gatt.writeCharacteristic
you need to do 2 things:
I have found that the best way to read (or write) BLE characteristics fast is to make the request, wait for the callback and make the next request from the callback. If there is a faster or more reliable way, I am unaware of it.
Upvotes: 9