<?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>Send Delayed Response to Bluetooth Read / Write Request</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30531/send-delayed-response-to-bluetooth-read-write-request</link><description>Hello Community, 
 this is my first question, since I could not find any clue on the internet and here on the devzone. 
 Problem: 
 I need to read/write a value to a GATT characteristics server which is then forwarded to a I2C. The I2C device is responding</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Feb 2018 13:11:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30531/send-delayed-response-to-bluetooth-read-write-request" /><item><title>RE: Send Delayed Response to Bluetooth Read / Write Request</title><link>https://devzone.nordicsemi.com/thread/120984?ContentTypeID=1</link><pubDate>Thu, 15 Feb 2018 13:11:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab5c4df5-a56a-4db9-b9a5-7c90640b28cc</guid><dc:creator>Andreas Poppe</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;thanks for the repley.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I found the problem, it was within my software.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST is called on each read / write and then my code accidently answered via the&amp;nbsp;&lt;span&gt;sd_ble_gatts_rw_authorize_reply&amp;nbsp; call immediatly. It was not supposed to.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I fixed it by not calling&amp;nbsp;&lt;span&gt;sd_ble_gatts_rw_authorize_reply&amp;nbsp; immediatly, but from another function later after reading/writeing the data to the I2C device.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send Delayed Response to Bluetooth Read / Write Request</title><link>https://devzone.nordicsemi.com/thread/120982?ContentTypeID=1</link><pubDate>Thu, 15 Feb 2018 13:03:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac629023-e608-4ea9-bde5-a4130e55b69e</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Andreas,&lt;/p&gt;
&lt;p&gt;You do not have to answer this at once. You can wait for the response from your I2C device before sending the confirmation.&lt;/p&gt;
&lt;p&gt;You can see in&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v5.0.0%2Fgroup___b_l_e___g_a_t_t_c___h_v_i___m_s_c.html" rel="noopener noreferrer" target="_blank"&gt;this message sequence chart&lt;/a&gt;&amp;nbsp;how to treat the BLE_GATTC_EVT_HVX. It does not say, but you can wait (for a reasonable amount of time). You just have to make sure that you use the correct conn_handle and handle when you use the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v5.0.0%2Fgroup___b_l_e___g_a_t_t_c___h_v_i___m_s_c.html" rel="noopener noreferrer" target="_blank"&gt;sd_ble_gattc_hv_confirm()&lt;/a&gt; function, once you have received your response from the I2C device.&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>