Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Max achievable polling frequency using Bluetooth LE GATT profile?

I am trying to understand BLE and GATT in more depth. My interest is in the max achievable number of reads you would able to make per second over the GATT profile.

I am aware of some of the post made on this topic before, for instance: Bluetooth Low Energy - updating a characteristic value repeatedly

However, I am trying to explain these results looking at the BLE specification.

What is the relationship between connection events and GATT? Does each ATT read/write require a new connection event? If not, is it possible to say anything about how many ATT read/writes can be made per connection event?

Say I want to poll a BLE connected light sensor for a single byte value, what would be the max Hz I could achieve? Would it always be best to set the mininum connection interval as low a possible?

Would I be able to achieve better results using "GATT server notifications? In the BLE spec (Core_v4.0) it says that "The master initiates the beginning of each connection event". Then how are GATT server notifications implemented? I would think that would require the server to initiate a connection event.

Finally, if anybody knows about any specific iOS imposed limitations on the throughput I would be able to achieve when polling a sensor intensively, I would love to hear about it.

like image 928
Soren Avatar asked Jun 30 '13 07:06

Soren


People also ask

What is GATT profile in Bluetooth?

GATT is an acronym for the Generic ATTribute Profile, and it defines the way that two Bluetooth Low Energy devices transfer data back and forth using concepts called Services and Characteristics.

What is Gap and GATT in Bluetooth?

GAP provides a standard framework for controlling a BLE device, while GATT provides a standard framework for managing data in a BLE device. As a BLE firmware developer, these two layers are the most layers interacted with in the BLE protocol stack, that is why we will invest some time to master them.

How fast is BLE?

The bit rate is 1 Mbit/s (with an option of 2 Mbit/s in Bluetooth 5), and the maximum transmit power is 10 mW (100 mW in Bluetooth 5).


1 Answers

I can answer a portion of of those questions...

What is the relationship between connection events and GATT?

They're different levels of the protocol. You handle connections and connection events via HCI. GATT is something you use after you've connected.

Does each ATT read/write require a new connection event?

No. Once you're connected you can do multiple read/write or other GATT commands.

If not, is it possible to say anything about how many ATT read/writes can be made per connection event?

I think the best method is to actually benchmark the speed yourself. However, the whole point of BLE is a reduction in power usage at the expense of speed. If you're concerned about speed that you probably shouldn't be doing it with BLE. The whole point of notifications/indications is so you don't have to poll an attribute but only get a message when a certain event has occurred.

Say I want to poll a BLE connected light sensor for a single byte value, what would be the max Hz I could achieve? Would it always be best to set the mininum connection interval as low a possible?

See above 2 answers.

Then how are GATT server notifications implemented?

Once you've implemented a GATT connection there's 2 way communication going on between the master and slave-device. Either device can send events to the other. In order to use notifications, you set a bit on a particular attribute to say you want notifications on that information. Then, depending on how that notification works, you'll get events sent back to you whenever there's something to report. I have a feeling that a lightbulb wouldn't have any sort of notification unless there's some interface on it besides the BLE connection. I typical application would be something like a thermometer where it would send a notification every time the temperature changed by 1 degree.

Conclusion:

If you're polling attributes you're doing it wrong. But it's possible that you have to do it wrong because the device didn't properly implement notifications in the way you need and you can't modify the device. However, polling will ramp up the battery usage significantly and you'll have loss the benefit of using BLE.

like image 82
Tim Tisdall Avatar answered Sep 16 '22 18:09

Tim Tisdall