nrf5-zephyr: store random address as fake public address, similar to hci-uart firmware

This commit is contained in:
Matthias Ringwald 2016-11-10 22:16:26 +01:00
parent 2527d18c69
commit ab5c2d9296

View File

@ -361,10 +361,18 @@ void main(void)
// nRF5 chipsets don't have an official public address // nRF5 chipsets don't have an official public address
// Instead, they use a Static Random Address set in the factory // Instead, they use a Static Random Address set in the factory
bd_addr_t addr; bd_addr_t addr;
#if 0
// set random static address
big_endian_store_16(addr, 0, NRF_FICR->DEVICEADDR[1] | 0xc000); big_endian_store_16(addr, 0, NRF_FICR->DEVICEADDR[1] | 0xc000);
big_endian_store_32(addr, 2, NRF_FICR->DEVICEADDR[0]); big_endian_store_32(addr, 2, NRF_FICR->DEVICEADDR[0]);
gap_random_address_set(addr); gap_random_address_set(addr);
printf("Random Static Address: %s\n", bd_addr_to_str(addr)); printf("Random Static Address: %s\n", bd_addr_to_str(addr));
#else
// make Random Static Address available via HCI Read BD ADDR as fake public address
little_endian_store_32(addr, 0, NRF_FICR->DEVICEADDR[0]);
little_endian_store_16(addr, 4, NRF_FICR->DEVICEADDR[1] | 0xc000);
ll_address_set(0, addr);
#endif
// inform about BTstack state // inform about BTstack state
hci_event_callback_registration.callback = &packet_handler; hci_event_callback_registration.callback = &packet_handler;