This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ble_app_beacon with sleep mode

ble_app_beacon.rarhello there i used ble_app_beacon example. i want to make some modifications. i want to put it in sleep mode after some time and again wake up after some time? can you tell me how to do this?? should i use timer interrupt example??

Parents
  • Hi rushin

    Thank you for your question and sorry for my late response on your case

    When softdevice is enabled (as with the ble_app_beacon example) the nRF51 will periodically sleep between BLE events. Further info on how that works is given in the nRF51 current consumption guide, section "Low power mode with BLE softdevice"

    In e.g. the ble_app_bps in nRF51 SDK 10.0.0, application timers are set up to periodically generate interrupts in the application. You need to do three things in your application to implement an application timer:

    1. Initialize your timer, as done in timer_init() function in the ble_app_bps example
    2. Start your timer, as done in the application_timers_start() function
    3. Implement a timer callback function, as done in the battery_level_meas_timeout_handler() function

    How to connect to the device with Master Control Panel is described in this tutorial, and also how to connect with your smartphone, in the section "Connecting to the nRF51 DK"

  • the delay is 100 ms. The advertising interval will be 100 ms in this case which means the device will periodically advertise every 100ms. The device will in fact advertise for approximately 2ms and then sleep for 98ms (if you have not set any other activity in your application).

    As it says in the comment for this define, you can configure this advertising interval from 100ms to 10,240 ms. It is your choice how frequently you want your device to advertise. If you choose short advertising interval, advertising information will appear quickly on a BLE scanning device.

Reply
  • the delay is 100 ms. The advertising interval will be 100 ms in this case which means the device will periodically advertise every 100ms. The device will in fact advertise for approximately 2ms and then sleep for 98ms (if you have not set any other activity in your application).

    As it says in the comment for this define, you can configure this advertising interval from 100ms to 10,240 ms. It is your choice how frequently you want your device to advertise. If you choose short advertising interval, advertising information will appear quickly on a BLE scanning device.

Children
No Data
Related