I'm working nrf52832 , SDK V15.3.0 and S132. I have implemented whitelist in application and its working fine. I need to add one phone as master device so i need to hard coded the device irk key(16byte). But its not working . Previously i was using nrf51822,SDKV10,S110 and i was implemented same thing that was working fine. But SDKV15.3 is not working.
im also adding the working code snippet of SDKV10,nrf51822 below .
ble_gap_whitelist_t whitelist; ble_gap_irk_t* p_whitelist_irk[6]; ble_gap_addr_t* p_whitelist_addr[1]; static ble_gap_irk_t whitelist_asusZenfone = {{0xAB,0x7F,0x6B,0xED,0xF5,0xD8,0x30,0x1F,0x87,0x7D,0x2F,0xA9,0xFC,0xF1,0xA8,0xDB}}; whitelist.addr_count = 1; whitelist.irk_count = 2; whitelist.pp_addrs = p_whitelist_addr; whitelist.pp_irks = p_whitelist_irk; err_code = dm_whitelist_create(&m_app_handle, &whitelist); APP_ERROR_CHECK(err_code); if (whitelist.addr_count ==1) { SEGGER_RTT_printf(0,"Entering to addr mode\n"); p_whitelist_irk[0] = &whitelist_asusZenfone; whitelist.addr_count = 1; whitelist.irk_count =1; whitelist.pp_addrs = p_whitelist_addr; whitelist.pp_irks = p_whitelist_irk; } else if (whitelist.irk_count >=1) { SEGGER_RTT_printf(0,"Entering to irk mode\n"); p_whitelist_irk[1] = &whitelist_asusZenfone; whitelist.addr_count = 0; whitelist.irk_count = 2; whitelist.pp_addrs = p_whitelist_addr; whitelist.pp_irks = p_whitelist_irk; } err_code = ble_advertising_whitelist_reply(&whitelist); APP_ERROR_CHECK(err_code);
-----------------------------------------------------------------------------------------------------------------------
code snippet of SDKV15.3.0/S132/ nrf52832 but it not working
case BLE_ADV_EVT_WHITELIST_REQUEST: SEGGER_RTT_printf(0,"[Adv] BLE_ADV_EVT_WHITELIST_REQUEST\n"); ble_gap_addr_t whitelist_addrs[BLE_GAP_WHITELIST_ADDR_MAX_COUNT]; ble_gap_irk_t whitelist_irks[BLE_GAP_WHITELIST_ADDR_MAX_COUNT]; uint32_t addr_cnt = BLE_GAP_WHITELIST_ADDR_MAX_COUNT; uint32_t irk_cnt = BLE_GAP_WHITELIST_ADDR_MAX_COUNT; static ble_gap_irk_t whitelist_moto_irk = {{0x33,0x01,0xC2,0xDE,0x35,0x2C,0xED,0xD2,0x21,0x22,0x92,0x9A,0xD4,0x84,0xB9,0xCD}}; static ble_gap_addr_t whitelist_moto_addr = {0,0,{0x89,0x38,0x60,0xC6,0x63,0xD4}}; err_code = pm_whitelist_get(whitelist_addrs, &addr_cnt, whitelist_irks, &irk_cnt); APP_ERROR_CHECK(err_code); SEGGER_RTT_printf(0,"pm_whitelist_get returns %d addr in whitelist and %d irk whitelist\n", addr_cnt, irk_cnt); // Set the correct identities list (no excluding peers with no Central Address Resolution). identities_set(PM_PEER_ID_LIST_SKIP_NO_IRK); if(irk_cnt >= 1) { whitelist_irks[1] = whitelist_moto_irk; whitelist_addrs[1] = whitelist_moto_addr; addr_cnt =2; irk_cnt =2; SEGGER_RTT_printf(0,"ble_advertising with whitelist reply \n"); // Apply the whitelist. err_code = ble_advertising_whitelist_reply(&m_advertising, whitelist_addrs, addr_cnt, whitelist_irks, irk_cnt); APP_ERROR_CHECK(err_code); } break;
Please help me to add device irk in whitelist for SDKV15.3 ?