Bonding and advertising data in dialog 14583

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at https://www.dialog-semiconductor.com/support . We’ll be fixing bugs / optimising the searching and tagging over the coming days.
6 posts / 0 new
Last post
karanshah28
Offline
Last seen: 2 years 7 months ago
Joined: 2018-07-14 11:10
Bonding and advertising data in dialog 14583

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.

Device: 
PM_Dialog
Offline
Last seen: 6 months 3 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi karanshah28,

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.

  1. Do the button configurations into user_periph_setup.c/h files
  2. Comment out the mnf_data_update() function from the user_app_adv_start() of the user_bare_bone.c file
  3. Add static the void app_button_enable(void); into user_bare_bone.c header file.
  4. Add the attached code snippet into user_bare_bone.c
  5. Call the app_button_enable() into user_app_adv_start() and in user_app_init().

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 the UM-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

Attachment: 
karanshah28
Offline
Last seen: 2 years 7 months ago
Joined: 2018-07-14 11:10
Thank you so much for the

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

PM_Dialog
Offline
Last seen: 6 months 3 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi karanshah28,

Hi karanshah28,

Sorry but I am a little bit confused with what you 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

Sparta
Offline
Last seen: 2 years 5 months ago
Joined: 2016-03-14 14:22
Hello, Dialog experts. I have

Hello, Dialog experts. I have trouble with advertising data. It works around 4 minutes and stops. I use ble_peripherial example.

PM_Dialog
Offline
Last seen: 6 months 3 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi Sparta,

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