<?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>Prepare Write Request</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/6763/prepare-write-request</link><description>Hi Team, 
 Is there any example to understand Prepare Write Request/Prepare Write Response? 
 In ble_uart_app example, I am getting p_ble_evt-&amp;gt;header.evt_id = 2 if I put printf in default case
in on_ble_evt function. 
 Regards, 
 Milan Joshi</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Apr 2015 12:58:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/6763/prepare-write-request" /><item><title>RE: Prepare Write Request</title><link>https://devzone.nordicsemi.com/thread/23750?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2015 12:58:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f62b044a-be80-4048-94fb-d1192f6cba87</guid><dc:creator>Milan</dc:creator><description>&lt;p&gt;done!! thanks
got the data !!
tried &lt;strong&gt;SEGGER_RTT_printf&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Prepare Write Request</title><link>https://devzone.nordicsemi.com/thread/23749?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2015 09:42:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:943a0912-4bcf-498d-b1b0-ff985d08b4d1</guid><dc:creator>Milan</dc:creator><description>&lt;p&gt;I am getting BLE_EVT_USER_MEM_RELEASE event and trying to print data on this event!
Am I still missing something!?
How to get data from all different offsets? In capture I am able to see that values are written on offsets 0,18,36,54,72 and 90.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Prepare Write Request</title><link>https://devzone.nordicsemi.com/thread/23748?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2015 09:39:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9f1da76-823e-4f88-8c91-04e458fd7ac4</guid><dc:creator>shibshab</dc:creator><description>&lt;p&gt;If you debug your application, and inspect the content of your buffer when receiving the EXEC_WRITE_OP event, you should see this.
If no error is reported, the entire value should be there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Prepare Write Request</title><link>https://devzone.nordicsemi.com/thread/23747?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2015 09:36:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f326249-31a2-451a-8a99-9ab5a7cf26f1</guid><dc:creator>Milan</dc:creator><description>&lt;p&gt;Hi, shibshab,&lt;/p&gt;
&lt;p&gt;Last query!! all the data received during this queued approach will be there in the provided data[1024]?&lt;/p&gt;
&lt;p&gt;When I print 512 bytes of data buffer I get only few!!&lt;/p&gt;
&lt;p&gt;Is this the problem like printf debug is not getting printed fully?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Prepare Write Request</title><link>https://devzone.nordicsemi.com/thread/23746?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2015 06:45:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6a0e4a4-7092-4e9f-9418-ca99bc217d21</guid><dc:creator>Milan</dc:creator><description>&lt;p&gt;Hi Shibshab,&lt;/p&gt;
&lt;p&gt;ble_gatts_attr_t.max_len was 20 and I increased it to 512 and error of att length is resolved now!!
Thank you very much!!&lt;/p&gt;
&lt;p&gt;Regards,
Milan Joshi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Prepare Write Request</title><link>https://devzone.nordicsemi.com/thread/23745?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2015 06:16:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25bf4375-a968-4a7d-a91d-608e294a8355</guid><dc:creator>shibshab</dc:creator><description>&lt;p&gt;First of all you should use the nRF-Sniffer. Its easier to get an overview with, and it uses Wireshark, so you can just send the log files instead of having to do screenshots.&lt;/p&gt;
&lt;p&gt;Anyway, what value have you set for the length of the characteristic? The &lt;code&gt;ble_gatts_attr_t.max_len&lt;/code&gt; can not be bigger than 512.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Prepare Write Request</title><link>https://devzone.nordicsemi.com/thread/23744?ContentTypeID=1</link><pubDate>Tue, 28 Apr 2015 13:22:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee3d0521-117a-4e9d-82aa-bd5a3c1958cd</guid><dc:creator>Milan</dc:creator><description>&lt;p&gt;Hi shibshab,&lt;/p&gt;
&lt;p&gt;Tried what you suggested and it worked but in the end it give error shown in
snap below.  any idea?&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/5141.123.png" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;following is the part of the code that I have tried for this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint8_t data[1024];
ble_user_mem_block_t *mydata;
mydata-&amp;gt;p_mem = data;
mydata-&amp;gt;len = 1024;
err_code = sd_ble_user_mem_reply(m_conn_handle, mydata);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Prepare Write Request</title><link>https://devzone.nordicsemi.com/thread/23743?ContentTypeID=1</link><pubDate>Tue, 28 Apr 2015 12:07:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7adc647e-a719-4283-acf2-fa4f73f90982</guid><dc:creator>shibshab</dc:creator><description>&lt;p&gt;Is it S110 or S120 you are working with?&lt;/p&gt;
&lt;p&gt;My recommendation would be to look at the SDK documentations &lt;a href="https://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/doc/8.0.0/s110/html/a00911.html"&gt;Message Sequence Charts&lt;/a&gt; first. If you want automated control (the simplest appproach) you let the softdevice take care of the data copying. &lt;strong&gt;NOTE: In this case you need a buffer bigger than the data you are going to hold!&lt;/strong&gt; &lt;code&gt;ceil(BUF_SIZE/18)*24 + 2&lt;/code&gt; would be a sufficient size for the buffer in this case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>