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

err_code = device_instance_free(index); doesn't work

I use SDK9 s130 nRF51 in central mode. When I save 2 devices in my central, all ok. In a

m_peer_table[index].id_bitmap

i see that value 0xFF changed to 0XFC

But when I want to delete one of this bounded devices, I call function

device_instance_free(1);

and I can see in watch window that first m_peer_table[1].id_bitmap changed to 0xFF than after 1 sec this value return to 0XFC value. Therefore I can't to delete my bounded devices. Why?

Parents
  • void ble_reinit() {

    		softdevice_handler_sd_disable();
    
    	char device_name[2 * MAX_STRING_SIZE];
    	memset (device_name, 0, 2 * MAX_STRING_SIZE);
    	strncat(device_name, /*(const char*)*/hex.name, hex.name_lenght);
    	strncat(device_name, /*(const char*)*/hex.serial_number, hex.serial_number_lenght);
    		
    	ble_stack_init();
    	ble_gap_params_init(device_name, (uint8_t *)pass.passkey, get_tx_power());			
    

    }

Reply
  • void ble_reinit() {

    		softdevice_handler_sd_disable();
    
    	char device_name[2 * MAX_STRING_SIZE];
    	memset (device_name, 0, 2 * MAX_STRING_SIZE);
    	strncat(device_name, /*(const char*)*/hex.name, hex.name_lenght);
    	strncat(device_name, /*(const char*)*/hex.serial_number, hex.serial_number_lenght);
    		
    	ble_stack_init();
    	ble_gap_params_init(device_name, (uint8_t *)pass.passkey, get_tx_power());			
    

    }

Children
No Data