<?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>Clearing characteristic value</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38901/clearing-characteristic-value</link><description>Hi, 
 I tried looking for an answer for this, however unsuccessfully. I have a custom characteristic and I set it with a string of values when it is added to the custom service. 
 I need to remove those values or if cannot remove, to replace the string</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 04 Oct 2018 09:43:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38901/clearing-characteristic-value" /><item><title>RE: Clearing characteristic value</title><link>https://devzone.nordicsemi.com/thread/151620?ContentTypeID=1</link><pubDate>Thu, 04 Oct 2018 09:43:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d3249e6-56c7-4718-a81d-94efdb4b982d</guid><dc:creator>iQd</dc:creator><description>&lt;p&gt;Thank you, it seems I was missing the VLEN, it fixed the issue when I added it and set it to 1.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clearing characteristic value</title><link>https://devzone.nordicsemi.com/thread/151617?ContentTypeID=1</link><pubDate>Thu, 04 Oct 2018 09:35:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e62815bb-516e-4c84-bb28-2abc9dfeddac</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Let me try to give you an intuition of how it works.&lt;/p&gt;
&lt;p&gt;When&amp;nbsp;running the SVCall&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v6.1.0%2Fgroup___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga9ee07ea4b96dcca1537b01ff9a7692ba"&gt;sd_ble_gatts_characteristic_add(..)&lt;/a&gt;&amp;nbsp;one of the arguments is the GATT attribute structure&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v6.1.0%2Fstructble__gatts__attr__t.html"&gt;p_attr_char_value&lt;/a&gt;.&amp;nbsp;That structure contains respectively the length and the value of the characteristics:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;init_len&lt;/em&gt; and &lt;em&gt;max_len&lt;/em&gt; gives the length in bytes&lt;/li&gt;
&lt;li&gt;&lt;em&gt;*p_value&amp;nbsp;&lt;/em&gt;points to the attribute data&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What happens if &lt;em&gt;init_len&lt;/em&gt; and &lt;em&gt;max_len&lt;/em&gt; is set to 4? Then the length is 4*(8 bits) = 32 bits, which can store numbers from 0 up to (2³²-1), or (0x)0 up to (0x)FFFF FFFF.&lt;/p&gt;
&lt;p&gt;If you set the value equal to (&lt;span style="font-weight:400;"&gt;0x)0201 0022 and the length equal to 4 then the following value will show up in nRF Connect: (0x) 22-00-01-02. Notice&amp;nbsp;how the order is switched, the last byte is written first and so on.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;Best regards, Simon.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clearing characteristic value</title><link>https://devzone.nordicsemi.com/thread/150550?ContentTypeID=1</link><pubDate>Wed, 26 Sep 2018 19:07:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1939a2c1-bfb6-472b-97cb-b65d37f1abf0</guid><dc:creator>Richard D.</dc:creator><description>&lt;p&gt;To change the characteristic value length to a single byte, you need to declare the characteristic as a variable-length.&lt;/p&gt;
&lt;p&gt;Assuming you&amp;#39;re using&amp;nbsp;sd_ble_gatts_characteristic_add(), use characteristic metadata vlen = 1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>