jr.
jr.

Reputation: 4675

Using BLE Notify characteristic characteristic to send a list of data?

I am working on a BLE interface to setup wifi on a device. I need to send a list of available networks back from the device. Should I have 10 characteristics (one for each available SSID) or just one characteristic which I send 10 notifies on.

What is the risk of using one option vs. the other? How reliable are the notifications of the values? I assume repeated notifications on one characteristic are likely as reliable as a single notification on multiple characteristics?

Upvotes: 1

Views: 519

Answers (1)

Youssif Saeed
Youssif Saeed

Reputation: 13295

My recommendation is to use one characteristic for this purpose. It's not really about the risk as option 1 and option 2 should work fine, but it is more about the architecture of your code; i.e. If a new network is found, it is relatively easier and more logical to send data on one characteristic than associate the found SSID with a new characteristic. Moreover, you would have unutilized characteristics if you end up finding less than 10 SSIDs. Finally, if you wanted to expand the functionality of your device, you can than start using other characteristics for new features which will make things more modular for the remote device.

As both you and Emil have said, having a single characteristic firing notifications should not be an issue on any platform.

Upvotes: 0

Related Questions