<?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>Characteristic Attribute Read Callback does not return complete data buffer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95139/characteristic-attribute-read-callback-does-not-return-complete-data-buffer</link><description>I have the following characteristic defined: 
 
 BT_GATT_CHARACTERISTIC ( BT_UUID_WT_SERIVCE_TX , 
 BT_GATT_CHRC_NOTIFY | BT_GATT_CHRC_READ , 
 BT_GATT_PERM_READ , 
 wt_read_tx_str , NULL , dataPacket ), 
 BT_GATT_CCC ( on_cccd_changed , 
 BT_GATT_PERM_READ</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 Feb 2023 09:22:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95139/characteristic-attribute-read-callback-does-not-return-complete-data-buffer" /><item><title>RE: Characteristic Attribute Read Callback does not return complete data buffer</title><link>https://devzone.nordicsemi.com/thread/407931?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2023 09:22:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:507bb7de-e242-4c58-bdf3-38811cbc7994</guid><dc:creator>keegretupmoc</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;You can close this ticket. &amp;nbsp;The data example I was given to transmit was a lot larger than was actually needed and ended up being less than 1/2 of the apparent 594 limitation. &amp;nbsp;And it doesn&amp;#39;t look like we will have anything else needing sizes that big. &amp;nbsp;So we are up and running!&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;h.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Characteristic Attribute Read Callback does not return complete data buffer</title><link>https://devzone.nordicsemi.com/thread/402514?ContentTypeID=1</link><pubDate>Thu, 29 Dec 2022 10:38:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0124a052-de0a-438e-96b4-71782f855103</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Harold,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know what could be wrong here but could you send us your sample code so we can test here&amp;nbsp; ?&amp;nbsp;&lt;br /&gt;If you are sending large amount of data I would suggest to increase the ATT_MTU and data length. I don&amp;#39;t think using &lt;span&gt;CONFIG_BT_BUF_ACL_TX_SIZE&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;= 27 would be the best,&amp;nbsp;it would take much longer to send 755 bytes.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Have you looked at the configuration in the throughput example ?&amp;nbsp;&lt;br /&gt;I also made a throughput example to be tested with a phone &lt;a href="https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/building-a-bluetooth-application-on-nrf-connect-sdk-part-3-optimizing-the-connection"&gt;here&lt;/a&gt;. It uses notification to send data, not read, but you can refer to the configuration.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I would also suggest to use our nRF Connect app on the phone to test.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regarding your heap/stack size alignment, I don&amp;#39;t think there is any issue with size of 2048. As far as I know the size just need to be divisible by 4.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Characteristic Attribute Read Callback does not return complete data buffer</title><link>https://devzone.nordicsemi.com/thread/402478?ContentTypeID=1</link><pubDate>Thu, 29 Dec 2022 01:12:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb9dd8c0-0ca7-48b6-9b48-177d65389637</guid><dc:creator>keegretupmoc</dc:creator><description>&lt;p&gt;Btw,&lt;/p&gt;
&lt;p&gt;Here are the heap/stack parameters I was talking about:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_HEAP_MEM_POOL_SIZE=2048&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_RX_STACK_SIZE&lt;/span&gt;&lt;span&gt;=1024&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;CONFIG_BT_HCI_TX_STACK_SIZE&lt;/span&gt;&lt;span&gt;=640&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE&lt;/span&gt;&lt;span&gt;=256&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MAIN_STACK_SIZE&lt;/span&gt;&lt;span&gt;=640&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_IDLE_STACK_SIZE&lt;/span&gt;&lt;span&gt;=128&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_ISR_STACK_SIZE&lt;/span&gt;&lt;span&gt;=1024&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#CONFIG_BT_NUS_THREAD_STACK_SIZE=512&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;They are all from prj.conf. &amp;nbsp;Let me know if they look ok. &amp;nbsp;Also, I have reduced the CONFIG_HEAP_MEM_POOL_SIZE to 1024 because I am running out of memory. &amp;nbsp;We probably need a bigger boat...&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;h.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Characteristic Attribute Read Callback does not return complete data buffer</title><link>https://devzone.nordicsemi.com/thread/402477?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2022 23:26:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1beed22a-9005-4f0d-9ae9-0cf68808025a</guid><dc:creator>keegretupmoc</dc:creator><description>&lt;p&gt;Hung,&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the parameter info, et al:&lt;/p&gt;
&lt;p&gt;CONFIG_BT_ATT_PREPARE_COUNT&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &lt;/span&gt;0&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;CONFIG_BT_BUF_ACL_TX_SIZE&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &lt;/span&gt;27&lt;/p&gt;
&lt;p&gt;CONFIG_BT_BUF_ACL_RX_SIZE&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &lt;/span&gt;69&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;CONFIG_BT_CTRL_DATA_LENGTH_MAX&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &lt;/span&gt;(not defined)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;CONFIG_BT_L2CAP_TX_MTU&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &lt;/span&gt;65&lt;/p&gt;
&lt;p&gt;CONFIG_BT_L2CAP_TX_BUF_COUNT&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &lt;/span&gt;2&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The &amp;ldquo;client&amp;rdquo; I am using is a freeware test BLE scanner on an android phone.&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &lt;/span&gt;It&amp;rsquo;s called BLE Scanner by blue pixel technologies, version 3.21.&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &lt;/span&gt;We are working on an iOS app that will be talking to it, but it&amp;rsquo;s not quite ready yet.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I will work on a sniffer trace soon as well.&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &lt;/span&gt;I assume the transfer just stops at 594 due to some limitation, not really an error, so it is probably parameter settings as you probably already suspect.&lt;/p&gt;
&lt;p&gt;I will try setting the&amp;nbsp;&lt;span&gt;CONFIG_BT_CTRL_DATA_LENGTH_MAX to something greater than 594 to see if that&amp;nbsp;magically fixes it, since it isn&amp;#39;t defined and may be defaulting to something around 600. &amp;nbsp;Or&amp;nbsp;&lt;/span&gt;some calculation based on other parameters.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;h.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Characteristic Attribute Read Callback does not return complete data buffer</title><link>https://devzone.nordicsemi.com/thread/402469?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2022 20:12:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23cd264d-73e3-4682-a299-103ffce94c08</guid><dc:creator>keegretupmoc</dc:creator><description>&lt;p&gt;Hung,&lt;/p&gt;
&lt;p&gt;Thanks for your response. &amp;nbsp;I will work on getting you the additional information. &amp;nbsp;I took over an existing app so I will need to do some research. &amp;nbsp;I am more familiar with the TI BLE processors, but coming up to speed on Nordic.&lt;/p&gt;
&lt;p&gt;I did have a question having to do with buffers, etc. &amp;nbsp;I thought I had read somewhere that the heap/stack needed to be aligned on 4 bytes (32 bit) and as such could only be 256, 1024, 4096, 16384 bytes. &amp;nbsp;Is that correct? &amp;nbsp;Because some of the parameters in prj.conf, I think one in particular, had &amp;quot;stack&amp;quot; in its name and was 2048, which if the alignment was true is incorrectly set. &amp;nbsp;I will find that one in particular, and maybe list them out with their values to see what you think.&lt;/p&gt;
&lt;p&gt;Thanks again,&lt;/p&gt;
&lt;p&gt;h.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Characteristic Attribute Read Callback does not return complete data buffer</title><link>https://devzone.nordicsemi.com/thread/402415?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2022 10:40:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4defc4f3-033e-40ef-b67a-f30e90efdad4</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Harold,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You may want to capture &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le"&gt;a sniffer trace &lt;/a&gt;of the communication so that we can inspect the connection parameters.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you give us more information about the settings you have ? For example:&amp;nbsp;&lt;br /&gt;&lt;span&gt;CONFIG_BT_ATT_PREPARE_COUNT&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;CONFIG_BT_BUF_ACL_TX_SIZE&lt;br /&gt;CONFIG_BT_BUF_ACL_RX_SIZE&lt;/p&gt;
&lt;p&gt;CONFIG_BT_CTLR_DATA_LENGTH_MAX&lt;/p&gt;
&lt;p&gt;CONFIG_BT_L2CAP_TX_MTU&lt;/p&gt;
&lt;p&gt;CONFIG_BT_L2CAP_TX_BUF_COUNT&lt;/p&gt;
&lt;p&gt;Which device did you use as the client ? You may want to increase the Data length max and ATT MTU (&lt;span&gt;CONFIG_BT_L2CAP_TX_MTU)&amp;nbsp;&lt;/span&gt;&amp;nbsp;to have higher over the air packet size.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Characteristic Attribute Read Callback does not return complete data buffer</title><link>https://devzone.nordicsemi.com/thread/402095?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2022 14:03:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20c496dc-c5e3-40d0-b7c3-0b36c62e3977</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;We&amp;#39;re currently low in staff due to the Holiday season.&lt;/p&gt;
&lt;p&gt;Please expect some delay in the handling of this case.&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>