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

using Shutoff Mode at initial level

We are working on application which need below implementation.

1.) At starting the device should be in shutoff mode, and on button press it should be awaken and start advertising for 180 seconds

2.) If connection established the device never go again to shutoff mode .

Pls suggest how to achieve above functionalities ?

I have started building up my application using ble_app_template example project.

Thank you !

Parents Reply
  • Hi jonathan, thanks for your reply !

    i have the same use case as mentioned in below link :-

    (+) Beaconing application - begin code with system off, press button to wake up - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com)

    But I didn't find anything useful or any reference to understand and achieve the use-case !

    in the below main function where should i add the sleep mode enter function ?

    static void sleep_mode_enter(void)
    {
    ret_code_t err_code;

    err_code = bsp_indication_set(BSP_INDICATE_IDLE);
    APP_ERROR_CHECK(err_code);

    // Prepare wakeup buttons.
    err_code = bsp_btn_ble_sleep_mode_prepare();
    APP_ERROR_CHECK(err_code);

    // Go to system-off mode (this function will not return; wakeup will cause a reset).
    err_code = sd_power_system_off();
    APP_ERROR_CHECK(err_code);
    }

    int main(void)
    {
    bool erase_bonds;
    ret_code_t err_code;

    // Initialize.
    log_init();
    timers_init();
    buttons_leds_init(&erase_bonds);
    power_management_init();
    ble_stack_init();
    adc_configure();
    gap_params_init();
    gatt_init();
    advertising_init();
    services_init();
    conn_params_init();
    peer_manager_init();

    // Start execution.
    NRF_LOG_INFO("Template example started.");
    application_timers_start();

    advertising_start(erase_bonds);

    // Enter main loop.
    for (;;)
    {
    idle_state_handle();
    }
    }

    1.) Suggest any method to achieve the use case !

    Thank you !

Children
Related