Learn MoreFAQsTutorials

4 posts / 0 new
Last post
Rajapurerohit
Offline
Last seen:6 months 1 week ago
Joined:2017-04-20 09:17
DA1458X beacon mode

Hello Dialog_Support,

I am new to beacon concept and working on da14580 board.
want to develop project which advertise the data in form of beacon packet. i have referred forum and build sample code using ble_peripheral example.
i have changed the USER_ADVERTISE_DATA, as per dialog frame for beacon able to see my device in iBeacon format.
Now my next task is to change payload using mobile application and update the payload and based on that take action and send status to app.

For example:
I have one characteristic, using that in user_implement file if i write a code for switch interrupt means, if i press switch once my device should start advertise and send beacon packet to app with updated payload.
I am bit confuse how to do and where to change and in which file.
Please help me it is urgent for me solve issue.

Thanks and Regards
Rohit

Keywords:
Device:
PM_Dialog
Offline
Last seen:44 min 17 sec ago
Staff
Joined:2018-02-08 11:03
Hi Rajapurerohit,

Hi Rajapurerohit,

I am not in position to understand what exactly you mean in your question. From what you have referred in your post, I imagine that your project should advertise in iBeacon format and the payload on it should be changed by using a mobile application through a BLE connection. Have I understood correctly the overview implementation of your project? Could you please clarify your question in order to understand exactly what you want to implement into your project and be able to help you?

Thanks PM_dialog

Rajapurerohit
Offline
Last seen:6 months 1 week ago
Joined:2017-04-20 09:17
Hello PM_dialog,

Hello PM_dialog,

Sorry for the confusion.
My requirement is change the advertising data on push button and reflect on USER_ADVERTISING_DATA and send to mobile app.
I am not getting how to work out .Please help me to solve the issue.

Thanks and Regards
Rohit

PM_Dialog
Offline
Last seen:44 min 17 sec ago
Staff
Joined:2018-02-08 11:03
Hi Rajapurerohit,

Hi Rajapurerohit,

The ble_app_sleepmode example of the SDK demonstrates a button implementation. The device gets in deep sleep mode, after a defined amount of time (default 10 sec), and the user can wake up the device by pressing a button. The ble_app_barebone example of the SDK updates dynamically specific bytes of the advertising string. For your application, I suggest you to combine these two example and modify the ble_app_sleepmode example. The first includes the push button implementation and the second the update of the advertising string. I will give you some steps as example that I have done in order to modify the ble_app_sleepmode project and update the advertising data by pressing a push button.

1) Comment out the app_easy_timer() that is invoked into the user_app_adv_start() function. This timer excecutes the adv_data_update_timer_cb() function that stop advertising every APP_ADV_DATA_UPDATE_TO seconds by app_easy_gap_advertise_stop() function.
2) Regarding the update of the advertising string you should stop adverting, then update dynamically your data and then start again advertising. In the app_wakeup_cb() function add the app_easy_gap_advertise_stop() to stop advertising.
3) Add the app_button_enable into the user_app_adv_start() in order to upadate the advertising data by pressing the button
4) Then in the user_app_adv_undirect_complete() comment out the arch_ble_ext_wakeup_on() and the app_button_enable() and add user_app_adv_start(). The user_app_adv_start() will start the advertising after the update of the advertising data.

The app_button_enable() function sets up the button as wakeup trigger event and sets up the wakeup controller. The wkupct_register_callback() registers the app_button_press_cb() function which is going to be invoked in the wakeup controller. Also, wkupct_enable_irq() selects the GPIO in which the button is connected and will triggered when the wake up interrupt will be happened.

Thanks PM_dialog