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

BLE device services are not detected on iOS nRF Connect app

When I use the nRF connect app on android phones, the services and characteristics can be detected and controlled correctly, as below.

But when I switch to iOS nRF Connect app, the app can scan and connect the device, but there is not any services nor characteristics presented. There is another issue that the name shown after connecting is different than the one from scanning. "Nordic_CSC" is the example that I used for figuring out where the problem is. My code was modified from this example code, but I'm pretty sure that all the Names have been changed.  Another issue is that I can't find the device from iPad->Setting->Bluetooth Setting.

I am not sure if I these issues are related, but this seems to be some cache issue?

   

  • I just found the solution from here and here.

    Seems like that the the iOS device negotiates with the MTU size when establishing the connection, and the GATT module is different since I migrated the code from S132 to S332 softdevice. In older version softdevices, the "BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST" event is handled in nrf_ble_gatt.c. But In the newer version(in my case it's s332 5.0.0) it uses different way.

    So I added #include "nrf_ble_gatt.h" in main.c and deal with the BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST event manually in ble_evt_handler, and the connection works fine now.

    case BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST:
        	err_code=sd_ble_gatts_exchange_mtu_reply(p_ble_evt->evt.gatts_evt.conn_handle, 23);
        	APP_ERROR_CHECK(err_code);
    	break;

Related