⚠️ 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//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
它是可能的to switch from an iBeacon mode to Advertising dynamically. We have a application were the peripheral needs to wake up an application on a central (phone).
I am not able to get what you mean. The iBeacon is a type of format in the adverting string when your device is in iBeacon mode. You can change the mode of your device and advertise dynamically by configuring your code. Please try to use the ble_app_barebone example of the SDK which demonstrates this kind of behavior. What would you like to do into your application? Could you please clarify your question?
My question would be what would be the order of steps to perform this. Do I have to stop the advertising and then change the advertising data then restart?
The Beacon application has the option to advertise the iBeacon data dynamically, but it is quite complicated if you are a beginner in BLE. As I referred you in the previous post, you can try to use the ble_app_barebone example of the SDK, which is a simplier application than the Beacon. In order to update the advertising data, all ongoing Bluetooth activities must be stopped first.
Regarding to the ble_app_barebone example, when the device is ready to start advertising, it will call user_app_adv_start() function that sets up a timer by the adv_data_update_timer_cb() callback function. This callback stops the advertising immediately by the app_easy_gap_advertise_stop() function. When the advertisement was canceled, the user_app_adv_undirect_complete callback function is invoked in order to call again the user_app_adv_start() function. Then the manufacturer data will be updated dynamically by the mnf_data_update() function and the updated data will be added into the advertising string. Finally, the device starts advertising the updated advertising string by the app_easy_gap_undirected_advertise_start() function.
Hi redcobaltbluedragon,
I am not able to get what you mean. The iBeacon is a type of format in the adverting string when your device is in iBeacon mode. You can change the mode of your device and advertise dynamically by configuring your code. Please try to use the ble_app_barebone example of the SDK which demonstrates this kind of behavior. What would you like to do into your application? Could you please clarify your question?
PM_Dialog
My question would be what would be the order of steps to perform this. Do I have to stop the advertising and then change the advertising data then restart?
Hi redcobaltbluedragon,
The Beacon application has the option to advertise the iBeacon data dynamically, but it is quite complicated if you are a beginner in BLE. As I referred you in the previous post, you can try to use the ble_app_barebone example of the SDK, which is a simplier application than the Beacon. In order to update the advertising data, all ongoing Bluetooth activities must be stopped first.
Regarding to the ble_app_barebone example, when the device is ready to start advertising, it will call user_app_adv_start() function that sets up a timer by the adv_data_update_timer_cb() callback function. This callback stops the advertising immediately by the app_easy_gap_advertise_stop() function. When the advertisement was canceled, the user_app_adv_undirect_complete callback function is invoked in order to call again the user_app_adv_start() function. Then the manufacturer data will be updated dynamically by the mnf_data_update() function and the updated data will be added into the advertising string. Finally, the device starts advertising the updated advertising string by the app_easy_gap_undirected_advertise_start() function.
Thanks PM_dialog
Thanks, this really helps.