3

I'm developing an application that connects to a Bluetooth Low Energy Device. The architecture of the program requires it to collect data from this device in bursts. Example: Collect data for 30 seconds once every 3 minutes. It is very important for this to be battery efficient.

For this device I have subscribed to notifications from a BluetoothGattCharacteristic. Unfortunately read permission is not given on this characteristic, so notifications must be used.

descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);     
mBluetoothGatt.writeDescriptor(descriptor);

and

mBluetoothGatt.setCharacteristicNotification(characteristic, true);

My first idea is to simply set

mBluetoothGatt.setCharacteristicNotification(characteristic, false);

when not scanning for data. Will this still consume lots of battery life? I assume the callbacks are still listening. Would I be required to change the descriptor back to its non-notification state?

Another idea would be to connect only when reading data from sensors, and disconnect when done. This would mean reconnecting ~20 times an hour.

DeeCeptor
  • 167
  • 6

1 Answers1

0

Suggestion

I will suggest reading characteristic values instead of setting them for notification. This way you will only require to communicate when you need data from BLE Device.

Questions

1) How frequently do you think Characteristic data will change at BLE device side.

2) Are you worried about battery drain at BLE Device side or of phone Battery??

AAnkit
  • 27,299
  • 12
  • 60
  • 71
  • Thanks for answering. Unfortunately the characteristic I'm interested in can only be viewed by Notifications (no read permission given). 1. The characteristic information is sent via notifications once every second. 2. Preferably both, but the phone's battery is more important in this case. – DeeCeptor May 27 '15 at 16:17
  • isn't the this value available in advertisement data? If this is the case I will suggest making connection every 3 minute and read the characteristics notifications. – AAnkit May 28 '15 at 03:34