im trying to get my nrf51822 connecting only to my phone, I set the phone mac address on white list, but I cant connect to my phone (android) wiht nrf master control.
How can I set only the phone with the following mac address to be connected. I tried with and without device_manager
initialization but nothing changed
both advertising_init
and sd_ble_gap_adv_start
succeed (return NRF_SUCCESS
). when I configure adv_params.fp = BLE_GAP_ADV_FP_FILTER_BOTH
nrf51822 cant be connected to any devcie including the one with the right mac address, so the mac address in not valid?? I put the phone mac address
I followed this link but it doesnt work for me.
I joined my code :main.c
static void advertising_start(void)
{
uint32_t err_code;
ble_gap_adv_params_t adv_params;
ble_gap_whitelist_t whitelist;
// Initialize advertising parameters with defaults values
memset(&adv_params, 0, sizeof(adv_params));
memset(&whitelist, 0, sizeof(whitelist));
ble_gap_addr_t temp2;
memset(&temp2, 0, sizeof(temp2));
temp2.addr[0] = 0x54;
temp2.addr[1] = 0xe3;
temp2.addr[2] = 0xb1;
temp2.addr[3] = 0x27;
temp2.addr[4] = 0x2e;
temp2.addr[5] = 0x84;
temp2.addr_type = BLE_GAP_ADDR_TYPE_RANDOM_STATIC;
ble_gap_addr_t *whitelist_addr[1];
/* Setup whitelist */
whitelist_addr[0] = &temp2;
whitelist.pp_addrs = whitelist_addr;
whitelist.addr_count = 1;
whitelist.pp_irks = NULL;
whitelist.irk_count =0;
adv_params.type = BLE_GAP_ADV_TYPE_ADV_IND;
adv_params.p_peer_addr = NULL;
adv_params.fp = BLE_GAP_ADV_FP_FILTER_BOTH;
adv_params.interval = 64;
adv_params.timeout = APP_ADV_TIMEOUT_IN_SECONDS;
adv_params.p_whitelist = &whitelist;
advertising_init(BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED);
// Start advertising.
err_code = sd_ble_gap_adv_start(&adv_params);
if (err_code !=NRF_SUCCESS) {
nrf_gpio_pin_clear(LED_GREEN);
}
APP_ERROR_CHECK(err_code);
}
enter code here
the name of my device on nrf master control is SECURITE
the phone with the desired MAC address (coded in the code)
another phone