<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Read character with custom 128 bit UUID</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/88499/read-character-with-custom-128-bit-uuid</link><description>Hello, I am currently working on the nrF52840 module with the soft device s140. 
 
 My job is to read the values ​​from different characteristics. 
 The characteristics are configured via individual 128-bit uuids. (UUID char 1: 470230b9-28cc-4c91-9a73</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Jun 2022 17:06:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/88499/read-character-with-custom-128-bit-uuid" /><item><title>RE: Read character with custom 128 bit UUID</title><link>https://devzone.nordicsemi.com/thread/370749?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 17:06:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ea86f01-777d-4da1-9572-bec755705827</guid><dc:creator>Kenneth</dc:creator><description>[quote user="KonstantinK"]I don&amp;#39;t know why I am not getting the event after&amp;nbsp;sd_ble_gattc_char_value_by_uuid_read() call..[/quote]
&lt;p&gt;Me neither, I suggest you try to continue to debug,&amp;nbsp;and just try and fail a bit, e.g. try with another peer for testing, try to add some delays between calling api calls etc.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read character with custom 128 bit UUID</title><link>https://devzone.nordicsemi.com/thread/370687?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 12:08:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e804108f-ae2e-448a-9fad-e869f20fdb3a</guid><dc:creator>KonstantinK</dc:creator><description>&lt;p&gt;I implemented the error check afterwards and there is no error returned by either of the API calls. I also implemented the function for discovering the characteristics and there are all characteristics returned at the&amp;nbsp;BLE_GATTC_EVT_CHAR_DISC_RSP event with type 0x02 (which is the same which is returned at the sd_ble_gattc_char_value_by_uuid_read() call). This means the custom base uuid is assigned correctly, or am I wrong?&lt;br /&gt;&lt;br /&gt;I don&amp;#39;t know why I am not getting the event after&amp;nbsp;sd_ble_gattc_char_value_by_uuid_read() call..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read character with custom 128 bit UUID</title><link>https://devzone.nordicsemi.com/thread/370681?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 11:53:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5cdad3a-7d4b-4d27-8aba-676a3592f830</guid><dc:creator>Kenneth</dc:creator><description>[quote user="KonstantinK"]Do you now why it returns NRF_SUCCESS but I doesn&amp;#39;t even get the BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP&amp;nbsp; event?[/quote]
&lt;p&gt;No, so please double check that neither api calls return an error, I can at least from the code snippet you shared see that you are not checking err_code for neither of the api calls.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read character with custom 128 bit UUID</title><link>https://devzone.nordicsemi.com/thread/370673?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 11:39:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19838b33-2490-4d9f-948a-e8a27fcb2966</guid><dc:creator>KonstantinK</dc:creator><description>&lt;p&gt;Yes, I am checking at&amp;nbsp;sd_ble_uuid_vs_add and&amp;nbsp;sd_ble_gattc_char_value_by_uuid_read and it always return NRF_SUCCESS.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The strange thing is that I am not getting the event when I use the UUID.type from&amp;nbsp;&lt;span&gt;sd_ble_uuid_vs_add(). Only if I set it to 0x01.&lt;br /&gt;&lt;br /&gt;Do you now why it returns NRF_SUCCESS but I doesn&amp;#39;t even get the BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP&amp;nbsp; event?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read character with custom 128 bit UUID</title><link>https://devzone.nordicsemi.com/thread/370670?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 11:31:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d562691f-323c-4851-aa18-d1eb0af6f992</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Are you checking the err_code for each call?&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read character with custom 128 bit UUID</title><link>https://devzone.nordicsemi.com/thread/370645?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 10:21:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e93d3929-ee05-4650-b54d-2e6542e9f861</guid><dc:creator>KonstantinK</dc:creator><description>&lt;p&gt;Hello, thanks for the reply.&amp;nbsp;I have edited my code and it looks like this currently:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;read_char_uuid.uuid = 0x30b9;

ble_uuid128_t const base_read_char_uuid =
{
		{
				0x96, 0x4B, 0x56, 0x94, 0xC0, 0x6D, 0x73, 0x9A,
				0x91, 0x4C, 0xCC, 0x28, 0xb9, 0x30, 0x02, 0x47
		}
};


//assign custom uuid to ble stack
err_code = sd_ble_uuid_vs_add(&amp;amp;base_read_char_uuid, &amp;amp;read_char_uuid.type);

ble_gattc_handle_range_t read_handle_range = {0x0001, 0xffff}; 

//call read function
err_code = sd_ble_gattc_char_value_by_uuid_read(m_conn_handle, &amp;amp;read_char_uuid, &amp;amp;read_handle_range);

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;With this implementation I don&amp;#39;t even get a&amp;nbsp;BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP event. So I can&amp;#39;t even check if the attribute is found or not.&lt;br /&gt;&lt;br /&gt;If I change the read_char_uuid.type = 0x01, I get the event but obviously no correct response data. Since I don&amp;#39;t even get an event with my&amp;nbsp;&lt;span&gt;read_char_uuid.type&amp;nbsp;from&amp;nbsp;sd_ble_uuid_vs_add(), do you think there is an issue with the base uuid or how should I provide it?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The UUID for this characteristics is displayed like this on the nrf Connect mobile app:&amp;nbsp;470230b9-28cc-4c91-9a73-6dc094564b96&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Or should I call the&amp;nbsp;sd_ble_gattc_char_value_by_uuid_read more often with new handle_range.start?&lt;br /&gt;&lt;br /&gt;I tried the things from the posts you mentioned already...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your help&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;EDIT: I got the event now and if I check the gattc_status like you mentioned I get the status&amp;nbsp;BLE_GATT_STATUS_ATTERR_INVALID_HANDLE 0x0101.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you know where the problem might be or what does this mean?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read character with custom 128 bit UUID</title><link>https://devzone.nordicsemi.com/thread/370634?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 09:52:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70a914e2-fc71-4a7f-84ba-61f07fb7b347</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I suspect that if you check&amp;nbsp;&lt;span&gt;p_ble_evt&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;evt&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;gattc_evt&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;gatt_status on&amp;nbsp;&lt;/span&gt;BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP event you can find that&amp;nbsp;&lt;span&gt;p_ble_evt&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;evt&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;gattc_evt&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;gatt_status is&amp;nbsp;&lt;/span&gt;BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_FOUND.&lt;/p&gt;
&lt;p&gt;I suspect that your UUID is not formatted correct, e.g. when calling&amp;nbsp;sd_ble_gattc_char_value_by_uuid_read() you need to both have&amp;nbsp;read_uuid.type from&amp;nbsp;sd_ble_uuid_vs_add() and&amp;nbsp;read_uuid.uuid = 0x30b9;&lt;/p&gt;
&lt;p&gt;If still problems you need to look at the byte orders (e.g. MSB and LSB). Some possible useful threads:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/86291/read-value-from-several-characteristics-as-central-to-a-custom-service"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/86291/read-value-from-several-characteristics-as-central-to-a-custom-service&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/52251/read-added-custom-characteristic-value-from-peripheral/"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/52251/read-added-custom-characteristic-value-from-peripheral/&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/20924/sd_ble_gattc_char_value_by_uuid_read---again"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/20924/sd_ble_gattc_char_value_by_uuid_read---again&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>