This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CTS compatibility issues in disconnection after bonding (Disconnected reason 0x16)

Hi Sir/Miss,

I import cts (current time service) as previous topic which is as link.

I have a compatibility issue in different phone.

The tested conditions are as below:

Apple

iPhone 11 (iOS15.1) with nRF connect - OK

iPhone 12 (iOS15.1) with nRF connect - OK

Android

Google pixel 5 (android OS 11) with nRF connect - OK

Google pixel 6 (android OS 12) with nRF connect - Disconnect after pairing and bonding

Redmi note 7 (android OS 10) with nRF connect - Disconnect after pairing and bonding

That is same result as original CTS example (ble_app_cts_c) in nRF52 DK PCA10040.

I use SDK 17.0.2 and softdevice s112 in nrf52810.

I see the disconnected reason is 22 (0x16).

And, call stack window is as below in IAR. It looks like observer issue?

How to avoid disconnection in these android phone?

Please help.

Thank you. 

  • Hi,

    In previous call stack information, I set break point at all case of BLE_GAP_EVT_DISCONNECTED.

    In setting breakpoint at all sd_ble_gap_disconnect(),  I use pca10040e s112 example code, except no used function in pm_hanlder_disconnect_on_sec_failure and pm_handler_disconnect_on_insufficient_sec . It's triggered at BLE_CTS_C_DISCONVERY_FAILED of on_cts_c_evt. That means the phone don't have this service?

    In previous test, I always use pca10040e example. I try to program hex file directly on nRF52 DK recently.(ble_app_cts_c_pca10040e_s112.hex and ble_app_cts_c_pca10040_s132.hex). Both of them have disconnection result.

    Thank you.

  • Hi,

    It looks like google pixel 6 issue. I try use other product with CTS to connect with pixel 6. That also doesn't update time. I think I should avoid disconnect after not support this service.

    Thank you for your assistance.

  • I see. Then I guess it is the line 430 in main.c that was triggered then:

            case BLE_CTS_C_EVT_DISCOVERY_FAILED:
                NRF_LOG_INFO("Current Time Service not found on server. ");
                // CTS not found in this case we just disconnect. There is no reason to stay
                // in the connection for this simple app since it all wants is to interact with CT
                if (p_evt->conn_handle != BLE_CONN_HANDLE_INVALID)
                {
                    err_code = sd_ble_gap_disconnect(p_evt->conn_handle,
                                                     BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
                    APP_ERROR_CHECK(err_code);
                }
                break;

    This is a special case in Bluetooth Low Energy, because usually it is the peripheral that holds the services and the central is the client, but in this case it is the central that "owns" the service, and the peripheral is the client. If the phone doesn't provide the Current Time Service, then this application will disconnect in the above snippet. However, the behavior of the application is completely up to you. If you still want to connect to the phone and use other services, then you are perfectly fine to so so.

    Best regards,

    Edvin

  • Hi,

    Got it. We also update android OS version to 12 on pixel 5. (Version is same as pixel 6). Google pixel 5 is difference with pixel 6. It supports CTS feature.

    Thank you for your help again.

Related