<?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>Problem with writing value to gatt attribute in connection.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1026/problem-with-writing-value-to-gatt-attribute-in-connection</link><description>Hi.
I have a problem with writing value to gatts attribute when device is in connection mode. In my application I want to check if the parameter writing by the client to server&amp;#39;s attribute has a proper value and if not, I want to set there my own value</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 28 Nov 2013 16:36:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1026/problem-with-writing-value-to-gatt-attribute-in-connection" /><item><title>RE: Problem with writing value to gatt attribute in connection.</title><link>https://devzone.nordicsemi.com/thread/4854?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2013 16:36:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11ec34b5-202c-488d-89aa-8902051484f3</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;In this case, I&amp;#39;d suggest that you instead use the Write Command property, and authorization. In that way, you can simply deny the write in the first place. Take a look at &lt;a href="https://devzone.nordicsemi.com/documentation/nrf51/4.4.2/html/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;this MSC&lt;/a&gt; to show the sequence of events this would cause. You get this behavior by enabling the wr_auth field when adding the characteristic.&lt;/p&gt;
&lt;p&gt;If you absolutely don&amp;#39;t want to do this, could you please include what error code you get back from sd_ble_gatts_value_set()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>