<?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>How to correct a value of characteristic in spec. range</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/6062/how-to-correct-a-value-of-characteristic-in-spec-range</link><description>HI, 
 I add a readable and writeable characteristic with : 
 attr_md.vloc = BLE_GATTS_VLOC_USER;
attr_md.vlen = 1;
attr_md.wr_auth = 1;
 
 and 
 attr_char_value.p_attr_md = &amp;amp;attr_md;
attr_char_value.init_len = sizeof(my_value);
attr_char_value</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Mar 2015 14:14:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/6062/how-to-correct-a-value-of-characteristic-in-spec-range" /><item><title>RE: How to correct a value of characteristic in spec. range</title><link>https://devzone.nordicsemi.com/thread/21214?ContentTypeID=1</link><pubDate>Wed, 18 Mar 2015 14:14:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eadf51d5-3c33-4545-84ad-40f356279874</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Jason: thanks, it&amp;#39;s good to know. I forgot to follow the UriBeacon :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to correct a value of characteristic in spec. range</title><link>https://devzone.nordicsemi.com/thread/21210?ContentTypeID=1</link><pubDate>Wed, 18 Mar 2015 13:37:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46811b06-f71c-4dc0-bef5-067e4c40849e</guid><dc:creator>Jason</dc:creator><description>&lt;p&gt;Hi Hung,
Yes, 1-99 to be 100, &lt;a href="https://github.com/google/uribeacon/blob/master/specification/ConfigService.md#38-beacon-period"&gt;that is Google UriBeacon Specification.&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to correct a value of characteristic in spec. range</title><link>https://devzone.nordicsemi.com/thread/21211?ContentTypeID=1</link><pubDate>Wed, 18 Mar 2015 11:51:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92d12c0d-772c-432a-9411-f12181527965</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Jason, I think your implementation is OK.
I&amp;#39;m not sure about the range of beacon_period in your application, but it seems at line 525, you will correct any beacon_period value between 1-99 to be 100 ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to correct a value of characteristic in spec. range</title><link>https://devzone.nordicsemi.com/thread/21215?ContentTypeID=1</link><pubDate>Wed, 18 Mar 2015 11:18:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a85bf973-0a8d-47fe-aa9f-23451bc6915b</guid><dc:creator>Jason</dc:creator><description>&lt;p&gt;I had tried to return SUCCESS then using sd_ble_gatts_value_set(), and success to correct the value.
Please see the line no. 518-528 of the &lt;a href="https://github.com/ucxpresso/nano51822/blob/master/examples/cookbook/ble_uri_beacon_v2/src/ble_uri_v2.cpp"&gt;source code.&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to correct a value of characteristic in spec. range</title><link>https://devzone.nordicsemi.com/thread/21212?ContentTypeID=1</link><pubDate>Wed, 18 Mar 2015 11:01:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8867049c-d3bb-4809-83eb-52d6d39cba3e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Jason: You can return success, but make sure you correct the value after it is set by the softdevice (when you reply with success). The attribute value will be written twice.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to correct a value of characteristic in spec. range</title><link>https://devzone.nordicsemi.com/thread/21213?ContentTypeID=1</link><pubDate>Tue, 17 Mar 2015 16:45:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba7f6381-a518-4863-b4de-19bd02bd54d7</guid><dc:creator>Jason</dc:creator><description>&lt;p&gt;The spec. need to return the SUCCESS and correct the wrong value automatically.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to correct a value of characteristic in spec. range</title><link>https://devzone.nordicsemi.com/thread/21209?ContentTypeID=1</link><pubDate>Mon, 16 Mar 2015 17:29:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91fa7c5b-5932-422a-ad96-c300d0179aca</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Jason,
Setting my_value = 100 won&amp;#39;t help to change the value will be written to your attribute.
The assignment attr_char_value.p_value = (uint8_t *)&amp;amp;my_value; is only set the initial value of the attribute.&lt;/p&gt;
&lt;p&gt;When you call sd_ble_gatts_rw_authorize_reply with gatt status = NRF_SUCCESS the value that the central set will be written to the atrribute value.&lt;/p&gt;
&lt;p&gt;When the value being written is out of the range, you should better to reject the write command and then either wait for another write request with in-range value or set the value to maximum 100 locally by using sd_ble_gatts_value_set().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>