BT address type changes

flonas
Posts: 3
Joined: Mon Aug 16, 2021 6:11 am

BT address type changes

Postby flonas » Tue Sep 14, 2021 1:40 pm

Hi,

I am currently developing an app for ESP32 using NimBLE, that will pair and bond with an Android and iOS application. I am using "just works" pairing method.

I am setting the address of the ES32 to BLE_OWN_ADDR_RANDOM so that it will work with the iOS app. However, I see that the address types of both phone and ES32 are set to zero (public):

Code: Select all

I (133324) BT_PERIPHERAL: connection established; status=0
I (133325) BT_PERIPHERAL: Connection established
I (133326) BT_PERIPHERAL: handle=0 our_ota_addr_type=1 our_ota_addr=6c:f5:1c:c8:40:5a
I (133337) BT_PERIPHERAL: our_id_addr_type=0 our_id_addr=b8:f0:09:8f:7b:9e
I (133348) BT_PERIPHERAL: peer_ota_addr_type=0 peer_ota_addr=78:e3:de:26:e3:91
I (133359) BT_PERIPHERAL: peer_id_addr_type=0 peer_id_addr=78:e3:de:26:e3:91
I (133360) BT_PERIPHERAL: conn_itvl=24 conn_latency=0 supervision_timeout=72 encrypted=0 authenticated=0 bonded=0
Also, sometimes it changes between public and random:

Code: Select all

I (26610) BT_PERIPHERAL: BLE_GAP_EVENT_REPEAT_PAIRING

I (49114) BT_PERIPHERAL: encryption change event; status=0
I (49115) BT_PERIPHERAL: handle=0 our_ota_addr_type=1 our_ota_addr=6c:f5:1c:c8:40:5a
I (49126) BT_PERIPHERAL: our_id_addr_type=1 our_id_addr=6c:f5:1c:c8:40:5a
I (49127) BT_PERIPHERAL: peer_ota_addr_type=1 peer_ota_addr=5a:5a:40:4c:0f:2b
I (49138) BT_PERIPHERAL: peer_id_addr_type=1 peer_id_addr=5a:5a:40:4c:0f:2b
I (49149) BT_PERIPHERAL: conn_itvl=24 conn_latency=0 supervision_timeout=72 encrypted=1 authenticated=0 bonded=1
I (49163) BT_PERIPHERAL: event->type = 10

I (62253) BT_PERIPHERAL: subscribe event; conn_handle=0 attr_handle=11 reason=2 prevn=0 curn=0 previ=1 curi=0

I (62255) BT_PERIPHERAL: disconnect; reason=531
I (62266) BT_PERIPHERAL: handle=0 our_ota_addr_type=1 our_ota_addr=6c:f5:1c:c8:40:5a
I (62277) BT_PERIPHERAL: our_id_addr_type=0 our_id_addr=b8:f0:09:8f:7b:9e
I (62278) BT_PERIPHERAL: peer_ota_addr_type=0 peer_ota_addr=78:e3:de:26:e3:91
I (62288) BT_PERIPHERAL: peer_id_addr_type=0 peer_id_addr=78:e3:de:26:e3:91
I (62300) BT_PERIPHERAL: conn_itvl=24 conn_latency=0 supervision_timeout=72 encrypted=1 authenticated=0 bonded=1
This behavior seems to affect pairing on the iOS side, since I have to manually forget the previous bonding, in order to be able to bond again. Otherwise, the "Peer removed pairing information" error appears.

Any suggestion would be really helpful.

Florin

imdahisaria
Posts: 4
Joined: Thu Sep 29, 2016 7:40 am

Re: BT address type changes

Postby imdahisaria » Wed Jun 22, 2022 6:55 am

Hi Florin,

I am facing the same issue you have described. Were you able to find the solution ? Your help would be highly appreciated.

Thank you

RD

irahul
Posts: 36
Joined: Fri Jun 18, 2021 10:07 am

Re: BT address type changes

Postby irahul » Wed Jun 22, 2022 10:50 am

For ESP32, it doesn't support controller based privacy. Host based privacy support was enabled for ESP32. Can you check if enabling host based privacy macro "BLE_HOST_BASED_PRIVACY" helps ?

Who is online

Users browsing this forum: Pedro Hugo PSC and 108 guests