2019-05-16 09:27 AM
I am new to Bluetooth development so maybe the answer is obvious.
I would like to use BLE on a wearable for indoor localization with Eddystone beacons, so far so good. At the same time (or in a timeframe) I would like to transmit information via BLE from the wearable to other devices, does Bluetooth protocol contemplate this feature? Should the localized device switch profile in real-time for localizing, and then for data transmission? Data to be transmitted are integer numbers changing sporadically, I don't need speed but robustness (the integer number must be delivered when a change happens). Moreover, I have the full control regarding the devices receiving data from the wearable, the wearable is equipped with a STM32WB. Thanks!
2019-05-16 06:53 PM
Hi Andrea,
Yes. Eddystone beacons are advertising packets, and you've done well making the wearable device scan them.
To transmit information, you may need to connect to that device, and information can be transmitted with commands like aci_gatt_read_char_value(), aci_gatt_write_char_value(), etc.
The devices does not need to switch profiles. It just acts in different mode: before connection it advertises, after connection it sends or receives data.
It is recommended to read PM0257 - BlueNRG-1, BlueNRG-2 BLE stack v2.x programming guidelines
https://www.st.com/resource/en/programming_manual/dm00294449.pdf
Best Regards,
Winfred
2019-05-17 02:35 AM
Hello @Winfred LU , thanks for your fast reply.
so basically in a portion of a timeframe I set the mode as scanning for Eddystone packets, then I switch it to advertising in order to establish a connection with the nearest collecting device, is it right? Moreover, could I just advertise my data and avoid direct connection in order to save some time (if the payload is small enough and collecting devices cover the entire area)?
Thanks for the reads, I will go through them as soon as possible. Are they valid even for STM32WB ?
Regards,
Andrea
2019-05-19 07:25 PM
Yes, you are free to advertise data directly if the data payload is small enough.
The advertising data may have up to 31 bytes. If including scan response, it can be up to 62 (31*2) bytes.
The Bluetooth programming guidelines are valid for both BlueNRG series STM32WB series.