Hi,
Use the following function can generate private IEEE address (random),
When a random address was changed. can get the private address from "GAP_RANDOM_ADDR_CHANGED_EVENT" event.
GAP_ConfigDeviceAddr( ADDRTYPE_PRIVATE_RESOLVE, (uint8 *)NULL );
when CC2541 device power on reset the private address will be different.
I want to using the same private address, but I don't know what to do.
Try to set IRK for using the same private address, the situation is still the same.
if ( newState == GAPROLE_STARTED ) { uint8 abIrk[16] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; GAPRole_SetParameter(GAPROLE_IRK, 16, &abIrk); GAP_ConfigDeviceAddr( ADDRTYPE_PRIVATE_RESOLVE, (uint8 *)NULL ); }
try used ADDRTYPE_PRIVATE_NONRESOLVE can change to the private address,
in Window 8 can't fond the BLE device, but android or IOS system can.
GAP_ConfigDeviceAddr( ADDRTYPE_PRIVATE_NONRESOLVE, (uint8 *)abBD_Addr );