⚠️ 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.
Can you please clarify your question a little bit more? Would you like to start/stops advertising or enabling/disabling the radio? Also, you are working on SDK5.0.4, aren’t you?
I would suggest you to take a look at the ble_app_sleepmode example of SDK5.0.4. The example starts advertising by default, and after a predefined amount of time, it will stop advertising and the system will go into sleep mode. Let me try to explain you the API which are used in order to start/stop advertising. Please check user_app_adv_start() function for start advertising. The app_easy_gap_undirected_advertise_get_active() is used for getting undirected connectable advertising message with filled parameters. The app_easy_gap_undirected_advertise_start() is the appropriate API for undirected advertising and it will send a GAPM_START_ADVERTISE_CMD towards to the BLE stack. Also, In user_app_adv_start() a timer is set up and as soon as elapses, the adv_data_update_timer_cb() callabk function will be triggered in order to stop advertising. The API which is used is the app_easy_gap_advertise_stop() and it will send a GAPM_CANCEL_CMD message to the stack. The BLE will stay awake as long as it is needed, if there are pending BLE events the kernel will switch on the BLE core serve the pending events schedule the incoming events and then will switch off the BLE core. You don’t have to do anything extra in order to turn off the radio and the BLE, the SDK takes a good care of that.
Imagine i m using BLE as slave,i need to turn on it using command from master.
so in default the BLE is turn on after the chip powered on right.i need to turn on it based on the command.
imagine a flag in SDK controls the BLE turnon/off.
imagine #define BLE if its 1 then ble should on and if its 0 it is off.like that control i need.for that where i have to modify in SDK please help me in detail
Could you please clarify which is the master that you would like to control the BLE? Also, I assume that you would like to start/stop advertising using a command from the master. I would suggest you to have a look at the CodeLess reference application code, in which you could send command over UART and control BLE functionalities. The CodeLess AT commands platform allows control over a local UART connected device as well as a remote device via BLE. The comprehensive set of AT-Commands enables control of the BLE connectivity.
Hi afrid,
Can you please clarify your question a little bit more? Would you like to start/stops advertising or enabling/disabling the radio? Also, you are working on SDK5.0.4, aren’t you?
Thanks, PM_Dialog
Hi,
yes.i like to start/stops advertising or enabling/disabling the radio?
我工作在SDK5.0.4.
Hi afrid,
I would suggest you to take a look at the ble_app_sleepmode example of SDK5.0.4. The example starts advertising by default, and after a predefined amount of time, it will stop advertising and the system will go into sleep mode. Let me try to explain you the API which are used in order to start/stop advertising. Please check user_app_adv_start() function for start advertising. The app_easy_gap_undirected_advertise_get_active() is used for getting undirected connectable advertising message with filled parameters. The app_easy_gap_undirected_advertise_start() is the appropriate API for undirected advertising and it will send a GAPM_START_ADVERTISE_CMD towards to the BLE stack. Also, In user_app_adv_start() a timer is set up and as soon as elapses, the adv_data_update_timer_cb() callabk function will be triggered in order to stop advertising. The API which is used is the app_easy_gap_advertise_stop() and it will send a GAPM_CANCEL_CMD message to the stack. The BLE will stay awake as long as it is needed, if there are pending BLE events the kernel will switch on the BLE core serve the pending events schedule the incoming events and then will switch off the BLE core. You don’t have to do anything extra in order to turn off the radio and the BLE, the SDK takes a good care of that.
Thanks, PM_Dialog
Hi,
thank you for the information.it is help ful.
i need some more information.
Imagine i m using BLE as slave,i need to turn on it using command from master.
so in default the BLE is turn on after the chip powered on right.i need to turn on it based on the command.
imagine a flag in SDK controls the BLE turnon/off.
imagine #define BLE if its 1 then ble should on and if its 0 it is off.like that control i need.for that where i have to modify in SDK please help me in detail
Hi afrid,
Could you please clarify which is the master that you would like to control the BLE? Also, I assume that you would like to start/stop advertising using a command from the master. I would suggest you to have a look at the CodeLess reference application code, in which you could send command over UART and control BLE functionalities. The CodeLess AT commands platform allows control over a local UART connected device as well as a remote device via BLE. The comprehensive set of AT-Commands enables control of the BLE connectivity.
//www.wsdof.com/products/smartbondtm-codeless-commands
Keep in mind that the DA14585 and DA14586 are recommended for new designs.
Thanks, PM_Dialog