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

sd_ble_gattc_char_value_by_uuid_read - again

Hi

I'm fighting to read characteristics of my service with sd_ble_gattc_char_value_by_uuid_read. I'm using SD130 V2.0.1 and SDK11.

Here are some snippets from my central device. I register my custom 128bit UUID in the SD130 like so:

err_code = sd_ble_uuid_vs_add(&m_svc_uuid, &m_uuid_type);
APP_ERROR_CHECK(err_code);

m_uuid.type = m_uuid_type;
m_uuid.uuid = MH_BLE_UUID_SERVICE;

then the normal scan and connect takes place. In the ble connect handler I call:

	m_range.start_handle = 0x0001; // CHAR Start on create: 0x1101
	m_range.end_handle = 0xffff; // CHAR END on create: 0x1105
	err_code = sd_ble_gattc_char_value_by_uuid_read(p_gap_evt->conn_handle, &m_uuid_type, &m_range);

No matter if I add the known characteristic handles or the full range, the error is the same. The function call executes with NRF_SUCCESS, but in the BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP event handler, the returned status is always BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_FOUND 0x010A.

Am I missing something or is my call in the wrong place? It would be great if somebody could supply a more detailed explanation then the one in the docs. I couldn't find any example using the call on devzone or in SDK exmples....

Thanks

  • It seems like the problem is in using the custom service UUID... But I cannot get hold of the problem....

  • Can you please provide RF logs to see what Soft Device does on BLE interface and why it returns NOT_FOUND error?

  • okay, noob question : How do I get the RF logs?

    As I understand the MSC, this message is sent when the discovery is completed. Is my understanding/interporetation of the MSC correct?

  • What is MSC?:) My problem to answer is following: I'm not using this function and from what I see in nRF5 SDK no one actually does (it's ready for serialization but no example or library really uses it). I can tell you how to service discovery works for me but what is wrong with this function and your call, that's up to you. What I do is calling sd_ble_gattc_primary_services_discover with full range and NULL set for UUID and then going through all UUIDs returned in gattc_evt structure. If my UUID is not found (I do compares on UUID type and value separately in plain text) then I need to call that again with modified range. If I reach end of range without finding my UUID then I know that this GATT server doesn't contain it. Maybe Soft Device can do this for me if I would put UUID structure as parameter but it should do the same on radio so better I do it (and have full control).

  • MSC -> Message Sequence Chart :-) Yes, there are some posts reporting it's working and is fast... I want to get rid of db discovery module as it seems extremely slow to me. I thought I will give this function a try, as it looks convienient and fast :-) Then I will go for the full discovery implementation and see how this goes... Anything special to watch out for?

Related