This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Connect to a bonded peripheral via Android Smart Device

This was already discussed in several threads but seems to be still unsolved completely. We have some android devices and ios devices. The peripheral is encrypted with LESC.

The SDK is 15.3 and the softdevice is S140. We developed first the iOS app and it is working fine without an issue. The device is paired and afterwards can be reconnected without an issue. If the pair is deleted a new pair can be created.

But the same peripheral has some strange behavior with several android devices:

With Samsung S7 Android 8 it works as expected although we are facing a timeout after 30 seconds. But reconnecting works as expected. But with some Samsung A6 tabs Same Android version it does not work. The sequence received is the following:

<info> peer_manager_smd: BLE_GAP_EVT_SEC_INFO_REQUEST
<debug> peer_manager_handler: Event PM_EVT_CONN_SEC_START
<debug> peer_manager_handler: Connection security procedure started: role: Peripheral, conn_handle: 0, procedure: Encryption
<info> BLE_CONN_HANDLER: Unknown event 0x14
<info> peer_manager_smd: BLE_GAP_EVT_CONN_SEC_UPDATE
<debug> peer_manager_handler: Event PM_EVT_CONN_SEC_SUCCEEDED
<info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Encryption
<debug> peer_manager_handler: Event PM_EVT_PEER_DATA_UPDATE_SUCCEEDED
<debug> peer_manager_handler: Peer data updated in flash: peer_id: 2, data_id: Peer rank, action: Update
<info> BLE_CONN_HANDLER: Connection secured: role: 1, conn_handle: 0x0, procedure: 0.
<info> BLE_CONN_HANDLER: Unknown event 0x1A
<debug> peer_manager_handler: Event PM_EVT_SERVICE_CHANGED_IND_CONFIRMED
<debug> peer_manager_handler: Service Changed indication confirmed.
<info> BLE_CONN_HANDLER: PM_EVT_SERVICE_CHANGED_IND_CONFIRMED
<info> BLE_CONN_HANDLER: Discovery timer stopped
<info> BLE_CONN_HANDLER: Unknown event 0x54
<info> FLASH_STORAGE: FDS Event Handler, 2
<info> FLASH_STORAGE: Update Successful
<debug> peer_manager_handler: Event PM_EVT_PEER_DATA_UPDATE_SUCCEEDED
<debug> peer_manager_handler: Peer data updated: 2, data_id: Service changed pending flag, action: Update
<info> BLE_CONN_HANDLER: Unknown event 0x12
<info> BLE_CONN_HANDLER: Fast advertising.
<info> BLE_CONN_HANDLER: Disconnected.

This is the sequence during reconnection. I do not understand why it fails. Attached is a capture of wireshark sniffer one for iOS and one for Android. I've already checked with the nRF Connect App but the same happens. So it does not seem to be an issue with the Android App.

Parents
  • Okay I can solve it by myself.

    The issue was related to PM_HANDLER_SEC_DELAY_MS. The value was first at 0. But checking the reasing for BLE_GAP_EVT_DISCONNECTED reveals a BLE_HCI_DIFFERENT_TRANSACTION_COLLISION as the reason.

    Googling for this issue gave that the PM_HANDLER_SEC_DELAY_MS might be the reason that the first request was not yet answered while a second request was already send. This produces a collision. Hence by introducing the PM_HANDLER_SEC_DELAY_MS of 100 worked in my case. The retest with iOS gave still the same performance.

    Hence the issue can be closed.

Reply
  • Okay I can solve it by myself.

    The issue was related to PM_HANDLER_SEC_DELAY_MS. The value was first at 0. But checking the reasing for BLE_GAP_EVT_DISCONNECTED reveals a BLE_HCI_DIFFERENT_TRANSACTION_COLLISION as the reason.

    Googling for this issue gave that the PM_HANDLER_SEC_DELAY_MS might be the reason that the first request was not yet answered while a second request was already send. This produces a collision. Hence by introducing the PM_HANDLER_SEC_DELAY_MS of 100 worked in my case. The retest with iOS gave still the same performance.

    Hence the issue can be closed.

Children
No Data
Related