<?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>sd_ble_gatts_rw_authorize_reply() returns NRF_ERROR_INVALID_PARAM when communicating error</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25009/sd_ble_gatts_rw_authorize_reply-returns-nrf_error_invalid_param-when-communicating-error</link><description>Hi, 
 after porting an existing application from version 3.0 of the s132 SD to version 5.0, I experience, that sd_ble_gatts_rw_authorize_reply() returns NRF_ERROR_INVALID_PARAM , when I try to reply with an ATT Error Response to an ATT Write Request</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Sep 2017 12:33:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25009/sd_ble_gatts_rw_authorize_reply-returns-nrf_error_invalid_param-when-communicating-error" /><item><title>RE: sd_ble_gatts_rw_authorize_reply() returns NRF_ERROR_INVALID_PARAM when communicating error</title><link>https://devzone.nordicsemi.com/thread/98497?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 12:33:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f08a5692-5b51-4bab-8de4-7ef453632f4e</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;I have ATT value write handlers that get called when a client writes to an attribute&amp;#39;s value. There are error situations caused by a malicious client that is pretty well described by &amp;quot;Offset is invalid&amp;quot;. So in version 3.0 of the s132 Softdevice, I was able to reply to such a malicious write with a BLE_GATT_STATUS_ATTERR_INVALID_OFFSET.&lt;/p&gt;
&lt;p&gt;But I have to admit, that you are right when you say that what I&amp;#39;ve tried here, it simply not covered by the core spec! Period! :-)&lt;/p&gt;
&lt;p&gt;BTW: Yes, I&amp;#39;ve tried an other error code now. &amp;quot;Insufficient Resources&amp;quot; for example is passed transparently.&lt;/p&gt;
&lt;p&gt;Thanks for taking your time and for looking into this!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_rw_authorize_reply() returns NRF_ERROR_INVALID_PARAM when communicating error</title><link>https://devzone.nordicsemi.com/thread/98495?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 10:34:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8e50e03-30c1-4b53-a827-403ec08e70d9</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure what you mean by reuse on the application layer. And what do you mean the PDU contains some kind of offset? Which PDU? The check cannot be turned off, this is by spec, see Vol. 3, Part F, Section 3.4.9 in the Bluetooth Core v5.0 for allowed error responses for the different methods. As you can see, there is no Invalid Offset for Write Request.&lt;/p&gt;
&lt;p&gt;It should be possible to send application errors in the range of BLE_GATT_STATUS_ATTERR_APP_BEGIN to BLE_GATT_STATUS_ATTERR_APP_END, but I have never tested it myself. Have you tried?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_rw_authorize_reply() returns NRF_ERROR_INVALID_PARAM when communicating error</title><link>https://devzone.nordicsemi.com/thread/98496?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 09:26:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:040b5df2-536f-4709-8a9a-ba972df68751</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Well, I reuse the error code on the application layer. The PDU contains some kind of offset and when that is out of range, I would like to respond with ATT Invalid Offset. I would like to not add additional error codes, in cases where a good one exists already that is supported already by tools like sniffers. Is there a way to disable the test for &amp;quot;reasonable&amp;quot; error codes? Does this mean, if I would use, either a user defined error code, of for example the more generic ATT error code &amp;quot;Invalid PDU&amp;quot;, that &lt;code&gt;sd_ble_gatts_rw_authorize_reply()&lt;/code&gt; would then not return an error?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_rw_authorize_reply() returns NRF_ERROR_INVALID_PARAM when communicating error</title><link>https://devzone.nordicsemi.com/thread/98498?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 09:04:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d92c6332-97ab-4958-94d3-ac32d75163bf</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Yes, but if you are trying to use BLE_GATT_STATUS_ATTERR_INVALID_OFFSET with a write request (op = 0x01 = BLE_GATTS_OP_WRITE_REQ), that doesn&amp;#39;t really make sense, because the write request doesn&amp;#39;t include an offset parameter.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_rw_authorize_reply() returns NRF_ERROR_INVALID_PARAM when communicating error</title><link>https://devzone.nordicsemi.com/thread/98494?ContentTypeID=1</link><pubDate>Fri, 08 Sep 2017 14:14:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00d2dc85-e886-48d8-beb4-3b19ca6770e3</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Well, the documentation of &lt;code&gt;ble_gatts_authorize_params_t::gatt_status&lt;/code&gt; referes to &lt;code&gt;GATT Status Codes&lt;/code&gt;, which contains all ATT error codes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_rw_authorize_reply() returns NRF_ERROR_INVALID_PARAM when communicating error</title><link>https://devzone.nordicsemi.com/thread/98493?ContentTypeID=1</link><pubDate>Fri, 08 Sep 2017 14:07:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e651a9e8-cb69-44a3-ab8f-94699c8aab01</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;You are trying to use BLE_GATT_STATUS_ATTERR_INVALID_OFFSET? I&amp;#39;m not sure that is supported. I&amp;#39;ll have to check with the developers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>