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

sleep after disconnect

Hi

what is the best way to implement a sleep after disconnect? We are using a custom board and I implemented it this way:

on connect : turn advertisement off on disconnect : event set WDT interval to longer interval, go to system-off on wakeup : read original WDT interval from eeprom

Still I'm getting alot of advertisement packages after the disconnect. Is this a problem in my FW?

Parents
  • Hi sorry, I can't paste large code snips as this is a customer project. I will try to break down the code. The thing is I have over 1000 devices, that need to be scanned, connected, read, disconnected in intervals. I want to implement a "sleep after talk" on the peripheral device - the central continues to scan for the next device after disconnect.

    switch (p_ble_evt->header.evt_id)
    {
        case BLE_GAP_EVT_CONNECTED:
            m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
        	battery_level_update();
            break;
            
        case BLE_GAP_EVT_DISCONNECTED:
        	sd_ble_gap_adv_stop();
            m_conn_handle = BLE_CONN_HANDLE_INVALID;
            // set after connect wakeup to eeprom.
            set_wdt_time(STATE_AFTER_CONNECT);
            power_off();
            break;
    }
    

    But this still leaves me with advert packets received on the central...

Reply
  • Hi sorry, I can't paste large code snips as this is a customer project. I will try to break down the code. The thing is I have over 1000 devices, that need to be scanned, connected, read, disconnected in intervals. I want to implement a "sleep after talk" on the peripheral device - the central continues to scan for the next device after disconnect.

    switch (p_ble_evt->header.evt_id)
    {
        case BLE_GAP_EVT_CONNECTED:
            m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
        	battery_level_update();
            break;
            
        case BLE_GAP_EVT_DISCONNECTED:
        	sd_ble_gap_adv_stop();
            m_conn_handle = BLE_CONN_HANDLE_INVALID;
            // set after connect wakeup to eeprom.
            set_wdt_time(STATE_AFTER_CONNECT);
            power_off();
            break;
    }
    

    But this still leaves me with advert packets received on the central...

Children
No Data
Related