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

White-list without bond manager

Hi

Is possible to use GAP White-list to restrict connections without the bond manager system ? Just by save the white-list with pstorage.....

for exemple, first open connection: retrieve peer caracteristics with ble_gap_evt_connected_t https://devzone.nordicsemi.com/documentation/nrf51/5.2.0/html/a00225.html

and save them in whitelist... https://devzone.nordicsemi.com/documentation/nrf51/5.2.0/html/a00247.html

Parents
  • I've changed declaration ( i declared a ble_gap_whitelist_t directly, not a pointer) The Hardfault doesn't occur.

    But now, my sd_ble_gap_adv_start function return me the NRF_ERROR_INVALID_PARAM code. So i verified adv_params but i don't find anything..

    Do i forgot something ?

    static ble_gap_whitelist_t whitelist;					
    
    
    whitelist.addr_count = 0x00;
    whitelist.pp_addrs = NULL;
    
    static void advertising_start(void)
    {
        uint32_t             err_code;
        ble_gap_adv_params_t adv_params;
    
    		protection_mode = true;
    		connection_state = false;
    	
        // Start advertising
        memset(&adv_params, 0, sizeof(adv_params));
        
        dv_params.type        = BLE_GAP_ADV_TYPE_ADV_IND; //adv
        adv_params.p_peer_addr = NULL;
        adv_params.fp          = BLE_GAP_ADV_FP_FILTER_BOTH; // both with whitelist //
        adv_params.interval    = APP_ADV_INTERVAL;
        adv_params.timeout     = APP_ADV_TIMEOUT_IN_SECONDS;
    		adv_params.p_whitelist = &whitelist;
    
        err_code = sd_ble_gap_adv_start(&adv_params);
        APP_ERROR_CHECK(err_code);
     
    }
    
Reply
  • I've changed declaration ( i declared a ble_gap_whitelist_t directly, not a pointer) The Hardfault doesn't occur.

    But now, my sd_ble_gap_adv_start function return me the NRF_ERROR_INVALID_PARAM code. So i verified adv_params but i don't find anything..

    Do i forgot something ?

    static ble_gap_whitelist_t whitelist;					
    
    
    whitelist.addr_count = 0x00;
    whitelist.pp_addrs = NULL;
    
    static void advertising_start(void)
    {
        uint32_t             err_code;
        ble_gap_adv_params_t adv_params;
    
    		protection_mode = true;
    		connection_state = false;
    	
        // Start advertising
        memset(&adv_params, 0, sizeof(adv_params));
        
        dv_params.type        = BLE_GAP_ADV_TYPE_ADV_IND; //adv
        adv_params.p_peer_addr = NULL;
        adv_params.fp          = BLE_GAP_ADV_FP_FILTER_BOTH; // both with whitelist //
        adv_params.interval    = APP_ADV_INTERVAL;
        adv_params.timeout     = APP_ADV_TIMEOUT_IN_SECONDS;
    		adv_params.p_whitelist = &whitelist;
    
        err_code = sd_ble_gap_adv_start(&adv_params);
        APP_ERROR_CHECK(err_code);
     
    }
    
Children
Related