2017-08-16 07:58 AM
Hello everyone,
I have the BLUENRG-1 running and working ( advertising, creating connections, sleeping ).
Now I would like to write a unique ID in each bluenrg-1 and then read it when the application starts up but not really sure how I should do it.
Can anyone help me on this.
Thanks
2017-10-23 10:18 PM
Hi Jamp,
You can use a random() function to create a random 6 bytes Mac Address, then save those 6 bytes in your Flash.
Once power up, for the very 1'st time, those 6 bytes might be all 0xff - then you might apply the random() function and save those 6 bytes to the Flash, next Power up time if those bytes are different then 0xff , use those bytes from flash as Mac Address. or if your BLE client is a mobile app, you can have a small utility which sends any 6 bytes of Mac address and then the Server (advertiser) will save those to Flash and use those as defined Mac.Thanks, Micha
2017-10-24 03:32 AM
Hello Micha,
Thanks for your answer, we have got how to do it already but thank you.
Kind regards
2017-10-25 04:43 AM
Hi Jamp,
each BlueNRG-1 device has natively a unique random static address that can be retrieved using the following ACI API:
uint8_t address[6];
uint8_t data_len_out;
aci_hal_read_config_data(CONFIG_DATA_RANDOM_ADDRESS, &data_len_out, address);
On the other hand, if you need to overwrite it, you can use:
hci_le_set_random_address(random_address);
Kind regards
Andrea