Hi, I am a newbie and creating an android app which pairs and bonds with dialog 14583. I have a button on the PCB that is pressed. Once the button is pressed, android app needs to listen to the change. Is it possible to achieve it by advertising data? Can a device advertise once its bonded and connected?
Appreciate the help.
Keywords:
Device:
Hi karanshah28,
Please, check the ble_app_sleepmode example of the SDK. This example demonstrates owe to use the wake up controller in order to set up a button interrupt. If you are using extended sleep into you project, you should use the wake up controller to detect the button interrupt because the device goes into sleep between advertising and connection intervals. I suggest you to check the user_periph_setup.c/h for the appropriate button configurations. That you have to do is since you pressing the button, you should update the advertising string. So, please check the ble_app_barebone example of the SDK. This example update the manufacturer specific data when the timer expires after APP_ADV_DATA_UPDATE_TO (10) seconds and then add the add manufacturer specific data dynamically into the advertising string. Please follow the steps below in order to update the advertising string with a button pressing. Be aware that I did that demo into the ble_app_barebone example.
After the steps below, you will see the manufacturer data of the advertising string updated every time you pressing the button after 10 seconds. If you want to reduce the advertising data update timer (APP_ADV_DATA_UPDATE_TO), please configure it with the value that you prefer. It is highly recommended to read theUM-B-050 : DA1458x Software Developers Guide (SDK5)user manual from our support page for getting more information about the ble_app_barebone example (pillar 1) and of the SDK.
Regarding your second question, do you meant that you want to connect the DA1453 with a BLE mobile application, and continue advising since it is connected? Did I understand correctly? If you mean that, when the device get connected, the user_app_connection() callback function will be trigger, so please call the user_app_adv_start() inside it to start advertising again.
Thanks, PM_Dialog
Thank you so much for the response. I will check and update the code and let you know.
Related to my second question what i meant is, I am pairing and bonding the device with the mobile application.Now once its bonded, can i advertise the data to the bonded device?
For example, on first time button press, my circuit wakes up and advertises some data to perform the operation and mobile app reacts to it. On second time of button press I want to advertise different data to the bonded device. On first time button press for example, I will advertise "ABCD". Now circuit is still waked up and I am again pressing the button. On second time I want to advertise "PQRS". On third time button press again "ABCD" and on fourth time button press "PQRS".
Is this possible to achieve? This question is in particular if the mobile device is paired and bonded. For non-paired device i am sure I achieve this functionality.
Appreciate your help.
Best Regards,
Karan
Hi karanshah28,
对不起但我有点困惑与你are trying to accomplish. The advertising procedure is a different procedure from the pairing and bonding. Both pairing and ponding procedures concern the security functionality. Could you please clarify how the mobile application reacts into the DA14583? As I have already mentioned in my previous post, since you are connected to the mobile application, you want to continue advertising and change the advertising data with pressing a button? Please check the tutorial 1 & 5 from the Tutorial tab of our support page in order to get more information about the advertising and security procedures of DA1458x. In case you are newbie with our products and SDK, I strongly suggest you to read the tutorials first.
Thanks, PM_Dialog
Hello, Dialog experts. I have trouble with advertising data. It works around 4 minutes and stops. I use ble_peripherial example.
Hi Sparta,
Apologies, but your question is little bit generic, so could you please provide me additional inputs on your issue? What do you mean that your device stops? Stops advertising? If you mean that, the most possible reason is that your firmware gets stuck somewhere, due to the WDAG expiration or an NMI hit or you get any assertion, so it would be very helpful to run it in debug mode. Also, could you please let me know if you have done any modifications in the ble_app_beripheral project of the SDK?
Thanks, PM_Dialog