<?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>Error Writing Large Characteristics</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17301/error-writing-large-characteristics</link><description>I am working on a BLE peripheral. I have a large, variable length characteristic I need to set from the central. 
 When the central is the BTool, I can write up to the maximum size of my characteristic, which is 512 bytes. It carves it into 90 byte blocks</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Oct 2016 14:51:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17301/error-writing-large-characteristics" /><item><title>RE: Error Writing Large Characteristics</title><link>https://devzone.nordicsemi.com/thread/66486?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2016 14:51:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f2ed74d-e8d9-47f6-ab8e-d71b178a4987</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Great that you got it working.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Thank you for the feedback, I&amp;#39;ll relay that to the developers, but which example are you referring to?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You should be able to calculate the size by using &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/group___b_l_e___g_a_t_t_s___q_u_e_u_e_d___w_r_i_t_e_s___u_s_e_r___m_e_m.html?cp=2_3_0_1_0_2_4_5"&gt;this&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/group___b_l_e___g_a_t_t_s___q_u_e_u_e_d___w_r_i_t_e___n_o_b_u_f___n_o_a_u_t_h___m_s_c.html?cp=2_3_0_1_0_2_4_3_6"&gt;This&lt;/a&gt; is an alternative. With this approach I guess you can copy the data in as it comes, but then if you get link loss only a part of the data may be valid.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error Writing Large Characteristics</title><link>https://devzone.nordicsemi.com/thread/66485?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2016 12:32:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:baa0efb5-aac6-42d0-b43a-6f0de448b9ff</guid><dc:creator>Bill Finger</dc:creator><description>&lt;p&gt;Peter,&lt;/p&gt;
&lt;p&gt;Thanks, your reply led me to the answer.  In response to BLE_EVT_USER_MEM_REQUEST I was calling sd_ble_user_mem_reply() with a NULL mem_block, just like in the template example.  If I instead provide a large memory block, the long write works.&lt;/p&gt;
&lt;p&gt;If I may, a few comments.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It would be nice if the template example illustrated this technique, even if it isn&amp;#39;t technically necessary.&lt;/li&gt;
&lt;li&gt;It would be nice if the documentation for either BLE_EVT_USER_MEM_REQUEST or sd_ble_user_mem_reply() indicated what size the memory block should be, and under what conditions it was needed.  Right now the documentation for sd_ble_user_mem_reply() is &amp;quot;Provide a user memory block.&amp;quot;&lt;/li&gt;
&lt;li&gt;Why is this even necessary?  I am using a user-buffer for the characteristic.  Why can&amp;#39;t I just copy the data into it as it comes?  RAM is very tight in my application.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Regards,
Bill&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error Writing Large Characteristics</title><link>https://devzone.nordicsemi.com/thread/66484?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2016 11:24:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ba2c4d7-a34e-4170-b30b-ab277bb45678</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I&amp;#39;m not an Android expert, but Aleksander Nowakowski is, and &lt;a href="https://devzone.nordicsemi.com/question/34572/ble-long-write/"&gt;according to him&lt;/a&gt; it should work. How are you handling &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/group___b_l_e___g_a_t_t_s___q_u_e_u_e_d___w_r_i_t_e___b_u_f___n_o_a_u_t_h___m_s_c.html?cp=2_3_0_1_0_2_4_3_11"&gt;this&lt;/a&gt; in the peripheral application? If you have Sniffer traces, could you edit your question and upload them?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>