I am trying to understand under what kind of context would a peripheral-central connection be superior to a passive observer-broadcaster relationship.
I am trying to understand under what kind of context would a peripheral-central connection be superior to a passive observer-broadcaster relationship.
Hi,
When a peripheral and central form a connection, they are able to do a lot of operations that are difficult to pull off in a observer/broadcaster relationship. One of them is reliable, multi-directional data transfer, where data is guaranteed to arrive - and in the order it was sent. You will also get acknowledgment packets telling you that certain data packets arrived. This allows for higher and more reliable throughput. With slave latency enabled, it is also possible to sleep completely for long periods of time when there is no data to be sent. If a peer gets out of reach, you will get notified by a disconnection event after supervision timeout has passed.
Secondly, you have security and encryption built-in. This allows you not only to send data securely, but for both sides to "authenticate" the peer by using a pre-shared encryption key. With encryption it is also possible to have access control for your GATT characteristics, ensuring that data cannot be written by a rogue peer.
Lastly you have GATT. While you are able to send and receive data as a observer/broadcaster, GATT allows you to set up a storage database with access control functionality. GATT allows any peer, even if they not know you or your services at all, to discover your GATT services ("features") in a generic way, and then only focus on the services it can understand. This allows forward-compatibility with newer devices, and makes interoperability with them much easier.
The price of all of this is of course increased power consumption, but in certain use-cases the central/peripheral connection will make your life much easier. One is burst data transfer, where you want to send a huge amount of data to a single client, sleep for some time, then wake up again to quickly send more data. Another would be for encryption and authentication.
Thanks. But what is restricting the number of connections? I have not read anywhere about a maximum number of connections allowed in BLE, unlike in classic bluetooth where 7 slave connections is the maximum. Is it due to lack of RAM, hardware resources at the Central?
Thanks. But what is restricting the number of connections? I have not read anywhere about a maximum number of connections allowed in BLE, unlike in classic bluetooth where 7 slave connections is the maximum. Is it due to lack of RAM, hardware resources at the Central?