<?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>long write: receiving partial data only</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29231/long-write-receiving-partial-data-only</link><description>hello, 
 I&amp;#39;m trying to send long (73B) data on a given characteristic using Android client as the central. 
 I well received: 
 
 USER_MEM_REQUEST OK 
 
 
 &amp;gt; #define BLE_TDS_MAX_LONG_WRITE 256
 
 
 
 &amp;gt; case BLE_EVT_USER_MEM_REQUEST:
 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 12 Jan 2018 14:14:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29231/long-write-receiving-partial-data-only" /><item><title>RE: long write: receiving partial data only</title><link>https://devzone.nordicsemi.com/thread/116284?ContentTypeID=1</link><pubDate>Fri, 12 Jan 2018 14:14:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:714ef013-649f-419e-b23b-d8e76cdcecb9</guid><dc:creator>yacine</dc:creator><description>&lt;p&gt;if confirmed, this should be known.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: long write: receiving partial data only</title><link>https://devzone.nordicsemi.com/thread/116283?ContentTypeID=1</link><pubDate>Fri, 12 Jan 2018 13:01:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d8ee8cb-b7e9-4944-a9a0-ceb2c776d6d0</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;If Android can&amp;#39;t do a proper long write, I would recommend to handle it at the application level.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: long write: receiving partial data only</title><link>https://devzone.nordicsemi.com/thread/116279?ContentTypeID=1</link><pubDate>Fri, 12 Jan 2018 12:56:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d59d497-146b-4ed4-99b3-c48c71057d6f</guid><dc:creator>yacine</dc:creator><description>&lt;ol start="2"&gt;
&lt;li&gt;I also tested to directly write 85B using classic android write and it works a bit better. doing this, on the peripheral I receive a MEM_USER_REQ and WRITE_EXEC, which looks good. but after parsing the user memory, I figured out that only the first batch has been sent bu the client. this is why I suppose the problem is on android side.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I asked on &lt;a href="https://stackoverflow.com/questions/48216517/rxandroidble-write-only-sends-the-first-20b"&gt;stackoverflow&lt;/a&gt; about this.&lt;/p&gt;
&lt;p&gt;any advice would help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: long write: receiving partial data only</title><link>https://devzone.nordicsemi.com/thread/116278?ContentTypeID=1</link><pubDate>Fri, 12 Jan 2018 12:56:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2502c7cb-8058-4c71-a45e-36f68c7e5e68</guid><dc:creator>yacine</dc:creator><description>&lt;p&gt;Thank you Peter for support.&lt;/p&gt;
&lt;p&gt;So far I think the problem is on android side: see details &lt;a href="https://stackoverflow.com/questions/48216517/rxandroidble-write-only-sends-the-first-20b"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I tried 2 things at the client:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;what they call long write in the rxandroidble library is in fact a sequence of classic writes + the data is automatically &amp;quot;sliced&amp;quot;. this result on the nordic peripoheral side into a sequence of independant WRITE_REQ or  WRITE_CMD, depending if I activated or not the parameter write_wo_response in the firmware. I suppose I could reassemble the data at the app level, but it would be a workaround. &lt;strong&gt;similar&lt;/strong&gt; to the app-handled case nordic MSCs describe. this was the subject of &lt;a href="https://devzone.nordicsemi.com/question/184321/longwrite-no-ble_evt_user_mem_request-and-no-ble_gatts_op_exec_write_req_now/"&gt;this post&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: long write: receiving partial data only</title><link>https://devzone.nordicsemi.com/thread/116281?ContentTypeID=1</link><pubDate>Fri, 12 Jan 2018 08:49:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb7b3aff-2c0e-4c04-b195-4c11141c644e</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Could you please explain to me exactly what the problem is? What are you seeing and what are you expecting?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: long write: receiving partial data only</title><link>https://devzone.nordicsemi.com/thread/116275?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2018 18:32:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c03000f-b70a-4729-acfe-afd6828f4da2</guid><dc:creator>yacine</dc:creator><description>&lt;p&gt;peter,&lt;/p&gt;
&lt;p&gt;still stucked with my problem: is there something to do in the characteritic description in order to exoplicitly saying the given char will receive long writes ? ... e.g. like extended char. I did not find any but who knows  ?&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: long write: receiving partial data only</title><link>https://devzone.nordicsemi.com/thread/116277?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2018 10:17:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9dfdef2-562b-404a-8e47-f3927a43d9e0</guid><dc:creator>yacine</dc:creator><description>&lt;p&gt;yes this is what I (try to) do. ok thanks, then it is normal I dont receive the ATT Prepare Write requests at the app level. I will investigate the central side. thx&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: long write: receiving partial data only</title><link>https://devzone.nordicsemi.com/thread/116276?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2018 09:49:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0a1776b-3fa6-447d-ad0b-5d3095e355e8</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;It seems to me you are doing &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v5.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_1_1_0_2_4_3_11"&gt;this&lt;/a&gt;, then you will only receive BLE_EVT_USER_MEM_REQUEST and BLE_GATTS_EVT_WRITE with BLE_GATTS_OP_EXEC_WRITE_REQ_NOW.&lt;/p&gt;
&lt;p&gt;The stack will receive ATT Prepare Write requests, but these will not be notified to the application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: long write: receiving partial data only</title><link>https://devzone.nordicsemi.com/thread/116274?ContentTypeID=1</link><pubDate>Tue, 09 Jan 2018 16:04:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eba99c50-a6e3-41c1-914f-077842b887e4</guid><dc:creator>yacine</dc:creator><description>&lt;p&gt;hello peter,&lt;/p&gt;
&lt;p&gt;I have the intuition that the problem is on the central side again.&lt;/p&gt;
&lt;p&gt;I think I manage correctly the user memory:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;handle = *(uint16_t*) mem_buffer.p_mem;
//        offset = *(uint16_t*) (mem_buffer.p_mem+2);
      len = *(uint16_t*) (mem_buffer.p_mem+4);
      buffer = (uint8_t *) (mem_buffer.p_mem+6);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;AFAIK I should receive first the successive BLE_GATTS_OP_WRITE_REQ and then, when the transfer is finalized, the BLE_GATTS_OP_EXEC_WRITE_REQ_NOW. isn&amp;#39;t it ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: long write: receiving partial data only</title><link>https://devzone.nordicsemi.com/thread/116273?ContentTypeID=1</link><pubDate>Mon, 08 Jan 2018 13:40:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7211d8a-7fb9-4df0-97f2-eae6a6b2f3ed</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;What do you expect the length to be? 73? This is just the first write, if you have done several writes you should find the next write after the first.&lt;/p&gt;
&lt;p&gt;See &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v5.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_1_1_0_2_4_5"&gt;this&lt;/a&gt; for user memory layout for Queued Writes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: long write: receiving partial data only</title><link>https://devzone.nordicsemi.com/thread/116280?ContentTypeID=1</link><pubDate>Fri, 05 Jan 2018 13:19:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7dab050-4e3c-4370-9b58-49cd0ccff941</guid><dc:creator>yacine</dc:creator><description>&lt;p&gt;the char description:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static uint32_t schedule_cal_char_add(ble_tds_t * p_tds, const ble_tds_init_t * p_tds_init){    
            	ble_gatts_char_md_t char_md;
            	ble_gatts_attr_t    attr_char_value;
            	ble_uuid_t          ble_uuid;
            	ble_gatts_attr_md_t attr_md;
            
            	memset(&amp;amp;char_md, 0, sizeof(char_md));
            	char_md.char_props.write         	= 1; 
                    char_md.char_props.notify         	= 1;
            	char_md.p_char_user_desc         	= NULL;
            	char_md.p_char_pf                	= NULL;
            	char_md.p_user_desc_md           	= NULL;
            	char_md.p_cccd_md         			= NULL;
            	char_md.p_sccd_md                	= NULL;
            
            	memset(&amp;amp;ble_uuid, 0, sizeof(ble_uuid));
            	ble_uuid.type = p_tds-&amp;gt;uuid_type;
            	ble_uuid.uuid = BLE_UUID_TDS_SCHEDULE_CAL_CHAR;
            
            	memset(&amp;amp;attr_md, 0, sizeof(attr_md));
            	BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;attr_md.read_perm);
            	BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;attr_md.write_perm);
            	attr_md.vloc    					= BLE_GATTS_VLOC_STACK;
            	attr_md.rd_auth 					= 0;
            	attr_md.wr_auth    					= 0;
                attr_md.vlen       					= 1;
            
            	memset(&amp;amp;attr_char_value, 0, sizeof(attr_char_value));
            	attr_char_value.p_uuid    = &amp;amp;ble_uuid;
            	attr_char_value.p_attr_md = &amp;amp;attr_md;
            	attr_char_value.init_len  = 0;
            	attr_char_value.init_offs = 0;
            	attr_char_value.max_len   = BLE_TDS_MAX_LONG_WRITE;
            
            	return sd_ble_gatts_characteristic_add(p_tds-&amp;gt;service_handle,
            			&amp;amp;char_md,
            			&amp;amp;attr_char_value,
            			&amp;amp;p_tds-&amp;gt;schedule_cal_handles);
            }
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>