⚠️
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.
6 posts / 0 new
Last post
MADHUSF
Offline
Last seen:1 month 3 weeks ago
加入:2018-01-15 09:22
BLE turnon

Hi,

I want to turn off BLE code and again turn on when needed.

where i have to get the control..simply i want conditional compilitaion over BLE in my main code.

pl help me with clear steps

Device:
PM_Dialog
Offline
Last seen:3 hours 59 min ago
工作人员
加入:2018-02-08 11:03
Hi MADHUSF,

Hi MADHUSF,

You could put the DA14585 into sleep mode, sot the radio will be powered down and when the chips wakes up will be powered on. When the device goes into sleep mode the, the arch_goto_sleep() will be triggered which powers down the BLE Radio by executing the ble_turn_radio_off() and whatever is allowed according to the sleep mode and the state of the system and application. When the system wakes up, the BLE_WAKEUP_LP_Handler is executed and the BLE is powered by the power_up();

Thanks, PM_Dialog

MADHUSF
Offline
Last seen:1 month 3 weeks ago
加入:2018-01-15 09:22
Hi,

Hi,

thank you for reply.

1.I m saying before sleep mode..i want to control the ble turn on operation with controller..

for example i want to define as #ifdef ENABLE_BLE then only the ble starts advertsing and etc.how to implement and which function causing the ble turnon

2.how to put DA14585 into sleep mode,explain with steps

PM_Dialog
Offline
Last seen:3 hours 59 min ago
工作人员
加入:2018-02-08 11:03
Hi MADHUSF,

Hi MADHUSF,

  1. Could you please clarify your question? Do you mean how to start/stop advertising? With the #ifdef ENABLE_BLE, the code will be static!
  2. Please have a look at the ble_app_sleepmode example of the SDK. For more information regarding the aforementioned example of the SDK, I would suggest you to read 7.6 Pillar 5 (Sleep Mode) of theUM-B-080 DA14585 & DA14586 Software Developer's Guide (SDK 6.0.8)user manual. In addition, theTutorial 4: Sleep modes current measurementwill be very helpful.

Thanks, PM_Dialog

MADHUSF
Offline
Last seen:1 month 3 weeks ago
加入:2018-01-15 09:22
Hi,

Hi,

yes.i want to start/stop advertising? With the #ifdef ENABLE_BLE, the code will be static!

PM_Dialog
Offline
Last seen:3 hours 59 min ago
工作人员
加入:2018-02-08 11:03
Hi MADHUSF,

Hi MADHUSF,

The ble_app_sleepmode implements start/stop adverting and putting the device in sleep mode. When the device is powered up or disconnected, it advertises for a defined amount of time APP_ADV_DATA_UPDATE_TO with a default value of 30 s. While the device is in the advertising state its sleep mode is set to Extended sleep with OTP copy (the OTP copy is emulated when the system runs in DEVELOPMENT_DEBUG mode). Please check the user_app_adv_start() callback function in user_sleepmode.c file. After the expiration of the above timeout, and if the device does not enter the connected state, it stops advertising. Please check the adv_data_update_timer_cb() callback which will be triggered when the timer expires. The API for stop advertising is the app_easy_gap_advertise_stop() and if you check its source code you send a GAPM_CANCEL_CMD message toward to the BLE stack. Now the device does nothing and waits for an external event to exit the sleeping state. The user can wake up the device by pressing a button. After the button press the device will start to advertise again for the predefined time. When the device enters the connected state then the sleep mode is turned to Extended sleep without OTP copy.

Thanks, PM_Dialog