This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

Disconnecting on Generic Attribute PrimaryService(0x1801) discovery

Hi! I use S130 on nRF51822 device. After device is connected as peripheral I try to discover services using Master Control Panel but device disconnects. In Master Control Panel I see that central tries to get ServiceChanged characteristics of Generic Attribute service (0x1801). Please look at attached screenshot:image description

I tried it on S110 and it works well. So, is it bug in S130 SoftDevice?

  • FormerMember
    0 FormerMember

    If service discover fails in your application in Master Control Panel, the problem is most likely that the event BLE_GATTS_EVT_SYS_ATTR_MISSING is not being handled. If the application doesn't support boding, it can for example be handled the following way in on_ble_evt(..) in main.c:

    case BLE_GATTS_EVT_SYS_ATTR_MISSING:
            err_code = sd_ble_gatts_sys_attr_set(m_peripheral_conn_handle, NULL, 0);
            APP_ERROR_CHECK(err_code);
            break;
    
  • Not sure this is the only reason, as I have exactly the code as you've recommended, and still get disconnect.

    I am using S110.

    Specifically, I have a "write-only" characteristic defined (handle 10), and Service Discovery using will generate: [15:38:01.7] No response received for ReadRequest on handle 0x0010. Disconnecting.. [15:38:01.7] Lost connection to device. Reason: BTLE_LOCAL_HOST_TERMINATED_CONNECTION

    and the debug output shows that the call to sd_ble_gatts_sys_attr_set returned without error:

    DEBUG:BLE_GAP_EVT_SYS_ATTR_MISSING(0x52)[on_ble_evt()] DEBUG:am: error_code (0)[on_ble_evt()] DEBUG:BLE_GAP_EVT_DISCONNECTED(0x11)[on_ble_evt()]

    I can't find any documentation on what BLE_GATTS_EVT_SYS_ATTR_MISSING actually means. Why am I getting it?

  • Thank you for answer! It works for me.

Related