iOS: Bluetooth name caching and cannot connect to BLE

We are developing an application related to BLE connection to the speaker. Currently when doing connect BLE and triggering the bonding process to the speaker, we are experiencing the following phenomenon:

  1. Scan BLE and discover Speaker 1
  • Peripheral: <CBPeripheral: 0x283f50aa0, identifier = 76D8D754-3F0F-82CD-18F2-37BAA4AFB638, name = (mac-address of speaker 1), mtu = 0, state = disconnected> - kCBAdvDataManufacturerData: (advertising data of device 1)
  1. Implement BLE connect and trigger bonding process to the speaker (pair): speaker 1 is connected to BLE and BL-classic at the same time. After pairing and connecting, the peripheral's name has changed to the one we see in the Bluetooth system.

  2. Turn off speaker 1 and turn on speaker 2. We scan and discover speaker 2:

  • Peripheral: <CBPeripheral: 0x283f58fa0, identifier = E290BB25-9046-FF4A-010D-CE5F2DA87527, name = (name of speaker 1), mtu = 0, state = disconnected> - kCBAdvDataManufacturerData: (advertising data of device 2)
  1. Implement BLE connect and trigger bonding process to the speaker (pair): we can't connect BLE to speaker 2 and always return to delegate centralManager(_:didDisconnectPeripheral:error:).

=> You can see we have scanned 2 speakers with different kCBAdvDataManufacturerData but somehow the 2nd peripheral shows the same name as the 1st peripheral and we can't connect to the 2nd peripheral. It seems as though the iOS device is caching the peripheral information.

Does anyone know if there is a way to clear the cache or refresh to get the current/valid status of the device from the app side?

iOS: Bluetooth name caching and cannot connect to BLE
 
 
Q