<?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>Invalid attribute value length (recvd error response)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57173/invalid-attribute-value-length-recvd-error-response</link><description>Target : NRF52832 as Server 
 Description of the problem (seen in wireshark) 
 Client : write request (0x12) 
 
 Server: Rcvd Error Response - Invalide Attribute value length , 
 
 
 I don&amp;#39;t understand the problem because i think the answer is provided</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 31 Jan 2020 15:38:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57173/invalid-attribute-value-length-recvd-error-response" /><item><title>RE: Invalid attribute value length (recvd error response)</title><link>https://devzone.nordicsemi.com/thread/232130?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2020 15:38:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6f95dcd-d7ae-4345-a45a-fdda181b9aff</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Can you show me how you answer to it with the indication? And where you call sd_ble_gatts_rw_authorize_reply? You can show me some snippets or something.&lt;/p&gt;
&lt;p&gt;The indication will appear as a separate line, and not just part of a packet. To be honest, I don&amp;#39;t know what you are trying to show me with the screenshots. Perhaps you can send the sniffer trace as a pcapng file? (default file type that it is saved as).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Just to say something sensible about the latest screenshot, this is the packet from the central to the peripheral, containing the write request. The reply to that will not be in the same packet. This is only communication from central to peripheral.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invalid attribute value length (recvd error response)</title><link>https://devzone.nordicsemi.com/thread/232120?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2020 14:50:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7fab4bf7-7fe9-4ffc-8bd6-b69c098158c3</guid><dc:creator>Vincent25</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Yes i catch a write request event.&lt;/p&gt;
&lt;p&gt;And i answer to it with an indication.&lt;/p&gt;
&lt;p&gt;But i don&amp;#39;t see the indication on wireshark!&lt;/p&gt;
&lt;p&gt;so is it normal?&lt;/p&gt;
&lt;p&gt;Or should i see a line in wireshark with &amp;quot;indication&amp;quot; written ?&lt;/p&gt;
&lt;p&gt;added to that, i have an other question:&lt;/p&gt;
&lt;p&gt;how do you explain that with nRFconnect i see a correct sequence with wireshark but when it is zwift, in wireshark it seem to have some errors.&lt;/p&gt;
&lt;p&gt;but i think it cannot be a problem of radio because Zwift send only exactly the same write request and it is only shown in wireshark with an error:&lt;/p&gt;
&lt;p&gt;Here is the write request sent by zwift:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1580482042255v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;and here is the write request sent by nRFConnect (me)&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1580482140356v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;And how do you explain that with nRFConnect there is a good UUID detection with wireshark but not when the write is sent by Zwift?&lt;/p&gt;
&lt;p&gt;I &amp;#39;ll see the sample you sent to me&lt;/p&gt;
&lt;p&gt;thank you&lt;/p&gt;
&lt;p&gt;Vincent&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and here is the write request sent by me with nRFConnect:&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invalid attribute value length (recvd error response)</title><link>https://devzone.nordicsemi.com/thread/232054?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2020 10:37:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:207914ee-ac03-45dd-a0bb-a518e3ad68f1</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;You are developing the peripheral. Ok.&lt;/p&gt;
&lt;p&gt;So since the peripheral owns the characteristic with the indication, you don&amp;#39;t need to reply to it. That is correct. The Zwift should reply to it, but let us assume it does.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What you are asking is how to reply to the write request? Do you get the event in your application?&lt;/p&gt;
&lt;p&gt;Please take a look at this sequence chart:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group___b_l_e___g_a_t_t_s___w_r_i_t_e___r_e_q___a_u_t_h___m_s_c.html"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group___b_l_e___g_a_t_t_s___w_r_i_t_e___r_e_q___a_u_t_h___m_s_c.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So you need to call&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html?cp=4_5_2_1_2_4_2_7#ga6de7aea3a870669e1d869b047de95545" rel="noopener noreferrer" target="_blank"&gt;sd_ble_gatts_rw_authorize_reply()&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;after you receive the write request event. Do you get this event?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invalid attribute value length (recvd error response)</title><link>https://devzone.nordicsemi.com/thread/232012?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2020 08:18:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41302fe3-24bc-49f7-84e3-577bd7c8ac4a</guid><dc:creator>Vincent25</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; I tried to write into the control point with nRFConnect&lt;/p&gt;
&lt;p&gt;And i think it works fine&lt;/p&gt;
&lt;p&gt;Here is the write request from nRFConnect:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1580458365579v2.png" alt=" " /&gt;.&lt;/p&gt;
&lt;p&gt;And here is the answer from the server (my software)&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1580458420696v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;we can see that the UUID is well decoded and the response provided by the framework (0x13) is sent by the server. I think it&amp;#39;s OK.&lt;/p&gt;
&lt;p&gt;But when I catch the write request sent by Zwift , i have this.&lt;/p&gt;
&lt;p&gt;How can I have a problem in my software if the sniffer cannot decode the request?&lt;/p&gt;
&lt;p&gt;and i see that exactly the same frame is sent every 2 or 3 seconds. so it&amp;#39;s not a problem of radio because the sniffer see exactly the same bits sent by zwift.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1580458286410v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Do you have any idea to proceed?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;
&lt;p&gt;Vincent&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invalid attribute value length (recvd error response)</title><link>https://devzone.nordicsemi.com/thread/231957?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 15:56:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bef89e8c-29bb-4a17-a029-3db50bb87a9f</guid><dc:creator>Vincent25</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Thank you for your answer.&lt;/p&gt;
&lt;p&gt;I&amp;nbsp; think Idon&amp;#39;t have to replyto an indication .&lt;/p&gt;
&lt;p&gt;I developp the server.&lt;/p&gt;
&lt;p&gt;So I must reply to the client which write a request into a control point characteristic.&lt;/p&gt;
&lt;p&gt;And first of all I must write a response&lt;/p&gt;
&lt;p&gt;and after i must indicate the datas of the control point&lt;/p&gt;
&lt;p&gt;for the write response actuallly in my software i don&amp;#39;t do anythink and for the indication, i indicate the values as described in the following specification&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1580399718139v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;added to that i think i make a mistake because the client (zwift ) repeat always the same write request and the error from the server (me) i always the same.&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Thank you for your help.&lt;/p&gt;
&lt;p&gt;Vincent&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invalid attribute value length (recvd error response)</title><link>https://devzone.nordicsemi.com/thread/231950?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 15:22:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b67c3c6-17b2-4e7c-ad9c-25479cc6eb73</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;So the nRF is the Bluetooth Low Energy central/client, and not the peripheral/server?&lt;/p&gt;
&lt;p&gt;You don&amp;#39;t have to read the BLE specification that carefully. Our SoftDevice (Bluetooth stack) handles most of the low layer stuff, but if you as a central have enabled indications and you have received an indication, you need to reply/acknowledge to it from your application. Please take a look at this message sequence chart:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group___b_l_e___g_a_t_t_c___h_v_i___m_s_c.html"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group___b_l_e___g_a_t_t_c___h_v_i___m_s_c.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So you need to call sd_ble_gattc_hv_confirm(handle); some time after you have received the indication.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invalid attribute value length (recvd error response)</title><link>https://devzone.nordicsemi.com/thread/231890?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 13:00:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:187c19d5-f04e-41ff-9ff1-ab1df611282c</guid><dc:creator>Vincent25</dc:creator><description>&lt;p&gt;Hi Edwin,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Thank you for your reply!!!!!&lt;/p&gt;
&lt;p&gt;My aim is to connect an home trainer to Zwift.&lt;/p&gt;
&lt;p&gt;I follow the specification of FTMS (buetooth org)&lt;/p&gt;
&lt;p&gt;In this specification there is a control point and the client (Zwift) write into it.&lt;/p&gt;
&lt;p&gt;The client writes with a write request. it&amp;#39;s in the FTMS specification.&lt;/p&gt;
&lt;p&gt;And the server sens a &amp;quot;write response&amp;quot;. I think it is a 0x13 according to the generic specification I gave you.&lt;/p&gt;
&lt;p&gt;Added to that, I answer an indication . I put the code of the indication in my programm.&lt;/p&gt;
&lt;p&gt;But i think the problem seen in wireshark is not caused by the indication but by the write response.&lt;/p&gt;
&lt;p&gt;Is the write response done by the framework?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Why do i use a the nrfSniffer?&lt;/p&gt;
&lt;p&gt;because i don&amp;#39;t have any support of any sample code of ftms client.&lt;/p&gt;
&lt;p&gt;And there is no support provided by zwift.&lt;/p&gt;
&lt;p&gt;you are the only one support for me (thank you for that!!!)&lt;/p&gt;
&lt;p&gt;I use nrf connect to communicate with my server and it works.&lt;/p&gt;
&lt;p&gt;i don&amp;#39;t try to sniff the communication beetween nrfconnect an my server . I &amp;#39;ll do it soon.&lt;/p&gt;
&lt;p&gt;for the moment the communication between&amp;nbsp; my server and zwift work fine except this write into the control point&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thank you&lt;/p&gt;
&lt;p&gt;Vincent&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invalid attribute value length (recvd error response)</title><link>https://devzone.nordicsemi.com/thread/231833?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 10:19:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:578c3574-83f0-452e-8714-75465e8e7492</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think you are looking in the right place.&lt;/p&gt;
&lt;p&gt;From your second screenshot, the Sequence number is wrong. This means that the device that sent this message is using the wrong sequence number because the other device (or the sniffer, actually) didn&amp;#39;t pick up the last packet. This requires a retransmit, but that is not something that you have to worry about, because the SoftDevice (the Bluetooth Stack) will handle that for you.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Are you using indications?&lt;/p&gt;
&lt;p&gt;If this is something that you need to and want to use, either because the specification requires it for this particular BLE service, or if you intend to use indications in your application, that is ok. If not, I recommend that you look into using notifications instead.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The difference between indications and notifications is what layer the message is ACKed in. (Not related to the Sequence Number from your sniffer trace, because that is the acknowledge in another layer).&lt;/p&gt;
&lt;p&gt;So when you use notifications, the packet with the data is Aknowledged in the Link Layer. This means that when the receiver has received the message with the correct CRC, it is ACKed immediately, and then the message is forwarded to your application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now, indications are not acked in the link layer, but in the application layer. This means that when you receive the packet/message, it is forwarded to the application, and you want to either check the content, or perform some action (i.e. lock a doorlock and check that this is a valid state, or that the doorlock isn&amp;#39;t jammed) before you acknowledge the indication.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It is not possible for a client to write to a characteristic/service using indications. Indications and notifications is sort of a subscription for a service that the server (peripheral) will send to the client (central).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What is the reason you started sniffing this connection? What is the issue that occured in your application? Did you try to write something to a service from a central, and the characeristic didn&amp;#39;t update? Did you receive any events on the peripheral side? If so, what event?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>