<?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/write chracteristics by handle value without service discovery.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51386/read-write-chracteristics-by-handle-value-without-service-discovery</link><description>Hi Nordic, 
 I am trying an application where both central and peripheral devices are based on nRF52. 
 I have to create custom services and characteristics for the same. 
 These are going to be battery operated and power sensitive devices. 
 Hence as</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Sep 2019 13:26:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51386/read-write-chracteristics-by-handle-value-without-service-discovery" /><item><title>RE: Read/write chracteristics by handle value without service discovery.</title><link>https://devzone.nordicsemi.com/thread/207705?ContentTypeID=1</link><pubDate>Tue, 03 Sep 2019 13:26:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef6221f5-4147-40a9-9262-9014de8e264c</guid><dc:creator>Shishir</dc:creator><description>&lt;p&gt;checking for&amp;nbsp;&lt;span style="background-color:transparent;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:21px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;BLE_GAP_EVT_DATA_LENGTH_UPDATE&lt;/span&gt; and than attempting to access the parameter did the trick and now I am able to run in my attached sample app as wel.&lt;/p&gt;
&lt;p&gt;Thanks a lot Hung Bui !!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read/write chracteristics by handle value without service discovery.</title><link>https://devzone.nordicsemi.com/thread/207466?ContentTypeID=1</link><pubDate>Mon, 02 Sep 2019 15:58:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a27932a-c52a-43f8-9f53-4a3fd5f15e39</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Shishir,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Attached is the main.c file of the ble_app_uart_c project I modified.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It will execute a&amp;nbsp;sd_ble_gattc_read() to read the ble_app_uart device name (handle 03) when&amp;nbsp;BLE_GAP_EVT_DATA_LENGTH_UPDATE event occurs.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You just need to replace main.c in ble_app_uart_c and test it with a ble_app_uart peripheral. You can see the log in RTT. (SDK 15.0)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-2644d63f9b7d443fafd5e6718cb71e63/main.c"&gt;devzone.nordicsemi.com/.../main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I guess the trick is to wait until MTU exchange and DLE Update is finished.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read/write chracteristics by handle value without service discovery.</title><link>https://devzone.nordicsemi.com/thread/207256?ContentTypeID=1</link><pubDate>Sun, 01 Sep 2019 14:55:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdb3bcc0-6dc0-4d65-936b-78faf33ce10a</guid><dc:creator>Shishir</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;Sorry for the delayed response but I tried putting 1 - 5 sec delay before and after read request for handle number but still the same error. From the logs it looks like MTU size change is being made after my handle read request so tries delay after read handle request also. still I am getting the same error.&lt;/p&gt;
&lt;p&gt;Can you point me any working sample application where we do a read by handle or write by handle without service discovery.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Shishir&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read/write chracteristics by handle value without service discovery.</title><link>https://devzone.nordicsemi.com/thread/206653?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2019 13:36:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b365769-a201-46c2-9e07-da4fbcf2d738</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Instead of doing a read right after connection, could you try to do it after the MTU exchange is finished and the Data Length extension is updated ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you tried to add a delay or retry doing read ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you want to do the read command right after the connection, you would need to make sure there is no other process at the same time (for example MTU update, DLE update)&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read/write chracteristics by handle value without service discovery.</title><link>https://devzone.nordicsemi.com/thread/206390?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 12:48:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7411749d-d8b2-4716-bdf2-e1d2e75bf9f7</guid><dc:creator>Shishir</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Below are my peripheral and central application individual logs.&lt;/p&gt;
&lt;p&gt;You can see that as soon as connection gets establishes central device attempts a read request on handle 19 and error is returned as error 17.&lt;/p&gt;
&lt;p&gt;Its happening even if both devices are reset and first time connection/comm happens.&lt;/p&gt;
&lt;p&gt;I am no more using&amp;nbsp;APP_ERROR_CHECK against this error to stop micro getting reset.&lt;/p&gt;
&lt;p&gt;Logs from Peripheral device:&lt;/p&gt;
&lt;p&gt;&amp;lt;info&amp;gt; app: Heart Rate Sensor example started.&lt;br /&gt;&amp;lt;info&amp;gt; app: Fast advertising.&lt;br /&gt;&amp;lt;info&amp;gt; app: Connected.&lt;br /&gt;&amp;lt;info&amp;gt; app: PERIPHERAL: Random Number Sent[0x0000], Calculated Cipher[0x0000]&lt;br /&gt;&amp;lt;info&amp;gt; app: GATT ATT MTU on connection 0x0 changed to 247.&lt;br /&gt;&amp;lt;info&amp;gt; app: advertising_init -&amp;gt; err_code [0]&lt;br /&gt;&amp;lt;info&amp;gt; app: services_init -&amp;gt; err_code [0]&lt;br /&gt;&amp;lt;info&amp;gt; app: ble_fas_init -&amp;gt; err_code [0]&lt;br /&gt;&amp;lt;info&amp;gt; app: ble_fas_init -&amp;gt; err_code [0]&lt;br /&gt;&amp;lt;info&amp;gt; app: ble_fas_init -&amp;gt; err_code [0]&lt;br /&gt;&amp;lt;info&amp;gt; app: ble_fas_init -&amp;gt; err_code [0]&lt;br /&gt;&amp;lt;info&amp;gt; app: services_init -&amp;gt; err_code [0]&lt;br /&gt;&amp;lt;info&amp;gt; app: Heart Rate Sensor example started.&lt;br /&gt;&amp;lt;info&amp;gt; app: Fast advertising.&lt;br /&gt;&amp;lt;info&amp;gt; app: Connected.&lt;br /&gt;&amp;lt;info&amp;gt; app: PERIPHERAL: Random Number Sent[0x0000], Calculated Cipher[0x0000]&lt;br /&gt;&amp;lt;info&amp;gt; app: GATT ATT MTU on connection 0x0 changed to 247.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;================================================================================================&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Logs from&amp;nbsp;Central device:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;lt;info&amp;gt; app: Heart Rate collector example started.&lt;br /&gt;&amp;lt;info&amp;gt; app: Starting scan.&lt;br /&gt;&amp;lt;info&amp;gt; app: [09:DB:61:25:4F:6D]&lt;br /&gt;&amp;lt;info&amp;gt; app: [03]&lt;br /&gt;&amp;lt;info&amp;gt; app: [09:DB:61:25:4F:6D]&lt;br /&gt;&amp;lt;info&amp;gt; app: [03]&lt;br /&gt;&amp;lt;info&amp;gt; app: [09:DB:61:25:4F:6D]&lt;br /&gt;&amp;lt;info&amp;gt; app: [03]&lt;br /&gt;&amp;lt;info&amp;gt; app: [09:DB:61:25:4F:6D]&lt;br /&gt;&amp;lt;info&amp;gt; app: [03]&lt;br /&gt;&amp;lt;info&amp;gt; app: [09:DB:61:25:4F:6D]&lt;br /&gt;&amp;lt;info&amp;gt; app: [03]&lt;br /&gt;&amp;lt;info&amp;gt; app: [14:4F:D7:20:1B:9F]&lt;br /&gt;&amp;lt;info&amp;gt; app: [00]&lt;br /&gt;&amp;lt;info&amp;gt; app: [09:DB:61:25:4F:6D]&lt;br /&gt;&amp;lt;info&amp;gt; app: [03]&lt;br /&gt;&amp;lt;info&amp;gt; app: [09:DB:61:25:4F:6D]&lt;br /&gt;&amp;lt;info&amp;gt; app: [03]&lt;br /&gt;&amp;lt;info&amp;gt; app: [09:DB:61:25:4F:6D]&lt;br /&gt;&amp;lt;info&amp;gt; app: [03]&lt;br /&gt;&amp;lt;info&amp;gt; app: [09:DB:61:25:4F:6D]&lt;br /&gt;&amp;lt;info&amp;gt; app: [03]&lt;br /&gt;&amp;lt;info&amp;gt; app: [09:DB:61:25:4F:6D]&lt;br /&gt;&amp;lt;info&amp;gt; app: [03]&lt;br /&gt;&amp;lt;info&amp;gt; app: [09:DB:61:25:4F:6D]&lt;br /&gt;&amp;lt;info&amp;gt; app: [03]&lt;br /&gt;&amp;lt;info&amp;gt; app: [09:DB:61:25:4F:6D]&lt;br /&gt;&amp;lt;info&amp;gt; app: [03]&lt;br /&gt;&amp;lt;info&amp;gt; app: [EC:02:AE:C8:0D:16]&lt;br /&gt;&amp;lt;info&amp;gt; app: [01]&lt;br /&gt;&amp;lt;info&amp;gt; app: Address match send connect_request.&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x0.&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_ble_gatt: Updating data length to 251 on connection 0x0.&lt;br /&gt;&amp;lt;info&amp;gt; app: Connected.&lt;br /&gt;&amp;lt;info&amp;gt; ble_mgmt_c: Reading by Handle 19, error[17]&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_ble_gatt: Peer on connection 0x0 requested an ATT MTU of 247 bytes.&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_ble_gatt: Updating ATT MTU to 247 bytes (desired: 247) on connection 0x0.&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_ble_gatt: ATT MTU updated to 247 bytes on connection 0x0 (response).&lt;br /&gt;&amp;lt;info&amp;gt; app: GATT ATT MTU on connection 0x0 changed to 247.&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_ble_gatt: Data length updated to 251 on connection 0x0.&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_octets: 251&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_octets: 251&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_time: 2120&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_time: 2120&lt;br /&gt;&amp;lt;info&amp;gt; app: Data length for connection 0x0 updated to 251.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read/write chracteristics by handle value without service discovery.</title><link>https://devzone.nordicsemi.com/thread/206282?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 08:45:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e36660f4-6867-4c94-b0fc-53598b11e367</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Shishir,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Error 17 means&amp;nbsp;&lt;span&gt;NRF_ERROR_BUSY most likely there was other procedure already on going. Do you have other code or repetitive code that call read request and write request ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you put a delay and then retry do you have the same issue ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read/write chracteristics by handle value without service discovery.</title><link>https://devzone.nordicsemi.com/thread/206171?ContentTypeID=1</link><pubDate>Mon, 26 Aug 2019 15:59:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa837fda-6552-46c0-8a55-2c366acd3b3b</guid><dc:creator>Shishir</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;In central application ble_app_wbh_c file main.c function ble_evt_handler -&amp;gt; case BLE_GAP_EVT_CONNECTED is the place where I call the handle read operation in place of service discovery.&lt;/p&gt;
&lt;p&gt;err_code = ble_common_read_by_handle(p_gap_evt-&amp;gt;conn_handle, BLE_FAS_HDL_OLD_ID_RANDOM_NUMBER_CLEAR);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;Internally this API is calling&lt;/p&gt;
&lt;p&gt;err_code = sd_ble_gattc_read(conn_handle,&lt;br /&gt; handle,&lt;br /&gt; 0);&lt;/p&gt;
&lt;p&gt;This is the place where I am getting error 17.&lt;/p&gt;
&lt;p&gt;Also The handle value&amp;nbsp;is&amp;nbsp;19 and correct.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll send my nRF debug logs.&lt;/p&gt;
&lt;p&gt;Also I&amp;#39;ll try to setup for sniffer and send the logs ASAP.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Shishir&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read/write chracteristics by handle value without service discovery.</title><link>https://devzone.nordicsemi.com/thread/206156?ContentTypeID=1</link><pubDate>Mon, 26 Aug 2019 14:25:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c48a5f1-7c08-4457-96be-b6ea682855bf</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Shishir,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It should work with the direct value read without service discovery, as long as you use the correct handle value.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you tell what exactly throws error 17 ? And I assume it&amp;#39;s&amp;nbsp;NRF_ERROR_BUSY ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you capture a &lt;a href="https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Sniffer"&gt;sniffer trace&lt;/a&gt; of both when you do service discovery (to find the actual handle value) and when you do a read without doing service discovery ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>