Other Parts Discussed in Thread: BLE-STACK
Hello, eveyone
I'm working on a secure connection,and I want to use white list to do that.
Intended purpose is only to allow the specified device can scan this device,
means that is peripheral device only advertise to specified central device.
So I search on the internet and follow this thread: ( https://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538/t/417407 )
I try to add codes in case GAPROLE_CONNECTED like the thread provide and did a little changes like
uint8 adv_filter = GAP_FILTER_POLICY_WHITE;
uint8 remoteBdAddr[B_ADDR_LEN] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};
// set the white list for advertise and scan
GAPRole_SetParameter( GAPROLE_ADV_FILTER_POLICY, sizeof( uint8 ), &adv_filter );
HCI_LE_ClearWhiteListCmd();
HCI_LE_AddWhiteListCmd( HCI_PUBLIC_DEVICE_ADDRESS, remoteBdAddr );
This codes that I want, not to use bonding address to add to white list, it using my specified address to add.
And seems like it can advertise to 0x050403020100 address after reconnect.(My phone can't scan this peripheral device)
But I want it to advertise to this specify address when peripheral device start at the first time.
So I move these codes to SimpleBLEPeripheral_init function and set them at the bottom.
Hope it will only advertise to this address when device start up.
But when I runs it, it looks like the same as before, is somthing set up I have to change?
Or does it have other option to do that?