<?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>bt_gatt_read only reads 22 bytes from BLE characteristic, while it should return 240 bytes</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98860/bt_gatt_read-only-reads-22-bytes-from-ble-characteristic-while-it-should-return-240-bytes</link><description>Hi, 
 I am trying to read characteristics from a BT device via the NRF9160DK. I have configured this NRF9160DK with dual-chip configuration, where NRF9160 contains the application code, and the NRF52840 chip runs the BLE HCI driver. The application code</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Apr 2023 13:59:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98860/bt_gatt_read-only-reads-22-bytes-from-ble-characteristic-while-it-should-return-240-bytes" /><item><title>RE: bt_gatt_read only reads 22 bytes from BLE characteristic, while it should return 240 bytes</title><link>https://devzone.nordicsemi.com/thread/421069?ContentTypeID=1</link><pubDate>Tue, 18 Apr 2023 13:59:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9bf8850-e9a1-4b87-9f35-b23961435ab2</guid><dc:creator>Dirk_</dc:creator><description>&lt;p&gt;Thank you. This did the trick for me.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The BT_GATT_ITER_CONTINUE return&amp;nbsp;value is indeed mentioned in the callback function documentation.&lt;/p&gt;
&lt;p&gt;Somehow I&amp;nbsp;overlooked that.&lt;/p&gt;
&lt;p&gt;The new output adds up to the 240 bytes as expected.&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f601.svg" title="Grin"&gt;&amp;#x1f601;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:149px;max-width:375px;" alt=" " height="149" src="https://i.postimg.cc/Qx9W7kLX/Screenshot-5.png" width="375" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bt_gatt_read only reads 22 bytes from BLE characteristic, while it should return 240 bytes</title><link>https://devzone.nordicsemi.com/thread/421065?ContentTypeID=1</link><pubDate>Tue, 18 Apr 2023 13:46:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e40a551-6d8e-43e0-9865-131f855f3108</guid><dc:creator>pirun lee</dc:creator><description>&lt;p&gt;You need Increase MTU or GATT long read procedure.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint16_t offset = 0;
static uint8_t read_cb(struct bt_conn *conn, uint8_t err,
				    struct bt_gatt_read_params *params,
				    const void *data, uint16_t length)
{
    printk(&amp;quot;Read data of length %d\n&amp;quot;, length);

	if (err)
	{
		printk(&amp;quot;Read Err %d\n&amp;quot;, err);
	}


    if (data != NULL) {
        offset += length;
	    // &amp;lt;&amp;lt; process data here &amp;gt;&amp;gt;
   		return BT_GATT_ITER_CONTINUE;
    } else {
        // The end of long read procedure
    		return BT_GATT_ITER_STOP;
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>