As said on the topic "GAP Address types", the random static address can be changed when system boots up. I can't find any content about how to make it. Could anyone offer any tips? best regards!
As said on the topic "GAP Address types", the random static address can be changed when system boots up. I can't find any content about how to make it. Could anyone offer any tips? best regards!
Check out the function "sd_ble_gap_address_set" in ble_gap.h. Here's an example:
ble_gap_addr_t gap_addr;
gap_addr.addr_type = BLE_GAP_ADDR_TYPE_RANDOM_STATIC;
// "my_random_addr" must be random generated.
memcpy(&gap_addr.addr, my_random_addr, sizeof(gap_addr.addr));
gap_addr.addr[5] |= 0xc0; // 2 MSBit must be '11' for RANDOM_STATIC address, see v4.0, Vol 3, Part C, chapter 10.8
err_code = sd_ble_gap_address_set(gap_addr);
APP_ERROR_CHECK(err_code);
Hi Sarah, You can place this code in the init, after ble_stack_init().
Cheers, Håkon
Hi Sarah, You can place this code in the init, after ble_stack_init().
Cheers, Håkon