OnMtuChanged callback gives wrong device address

Hey,
I have an app that uses BluetoothManager for BLE connectivity.
I noticed a strange behaviour lately, my android acts as a peripheral, and once a central connects to it,
the callback OnMtuChanged gives different Address from the callback OnConnectionStateChange,
but not just any address, but the previous address the central had (the central swaps its addresses from time to time and I've read that its part of the security mechanism of BLE to preserve anonymity of the device)
My guess is that this is happening due to some underlying cache layer that BluetoothManager class has, and that the
OnMtuChanged callback called before the addresses were swapped, but its just a guess.

The thing is, because of that, i can't map the device address to the device MTU for proper communication.

Is there an explicit way to ask for the MTU as an android peripheral when connected to a central?

Or is there a way to map old address to new address? or maybe address is not the correct field for this scenario?

Thank you in advance.
Roy

Sign In or Register to comment.