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

Is it possible to use ble_gattc with S110?

Hi,

I have an nRF51822-based peripheral with S110 softdevice, and it would be handy if I could nose around central's capabilities when it connects my device (I'd like to read out GAP device name, for starters).

The API to make GATTC stuff is present in S110, though when I call functions like sd_ble_gattc_primary_services_discover() I receive BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP with evt->evt.gattc_evt.params.prim_srvc_disc_rsp.count == 0 even though I am quite positive there is at least GAP service exposed in the central.

So, is it possible to read central characteristics with S110, or do I need at least S130 (peripheral+central SD) to do GATTC things?

Thank you.

  • Success! You were absolutely right about the 1-based indexing. Both sd_ble_gattc_primary_services_discover(conn_handle, 1, NULL) and ble_gattc_handle_range_t range = { 1, 0xffff } used in sd_ble_gattc_char_value_by_uuid_read() and sd_ble_gattc_characteristics_discover() must start with index 1 instead of zero. Weird thing that Windows10 are so tolerant about starting index, that it actually worked with zeroes. Anyway, thank you very much!

Related