<?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 return invalid value size</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13854/how-to-return-invalid-value-size</link><description>Hi,
I want to write a characteristic, the value size is fixed, for example the size is 4 bytes. When I try to wirte 6 bytes from the client, the first 4 bytes is writed succesfully and the last 2 bytes is droped.I want users know the value size is invalid</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 May 2016 14:21:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13854/how-to-return-invalid-value-size" /><item><title>RE: How to return invalid value size</title><link>https://devzone.nordicsemi.com/thread/52935?ContentTypeID=1</link><pubDate>Wed, 18 May 2016 14:21:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cbfdb57-effc-4223-87b4-a11a338960ff</guid><dc:creator>zhwzh308</dc:creator><description>&lt;p&gt;Are you interested in sending status code in bluetooth? You may need to write this up and define the error codes. I was looking at &lt;code&gt;ble_dfu.h&lt;/code&gt; and there are some hints in implementing this kind of tricks. If you look at this enum &lt;code&gt;ble_dfu_resp_val_t&lt;/code&gt;, it is sent using &lt;code&gt;ble_dfu_response_send&lt;/code&gt; function when a status needs to be reported to user.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to return invalid value size</title><link>https://devzone.nordicsemi.com/thread/52937?ContentTypeID=1</link><pubDate>Wed, 18 May 2016 01:23:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f91798c-4097-4f88-a1d4-d940c23bc56c</guid><dc:creator>nrfmote</dc:creator><description>&lt;p&gt;Thanks.
If the user write the charactreistic with right size value, nothing need to report.But if the user write more than the max size of the characteristic, I want send a massage to let the user know the error. Which function I can use to send the message or response to inform the user app that the error data size has inputted?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to return invalid value size</title><link>https://devzone.nordicsemi.com/thread/52936?ContentTypeID=1</link><pubDate>Wed, 18 May 2016 00:03:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94fb8288-a47f-4bb5-8669-89f2abc92f70</guid><dc:creator>zhwzh308</dc:creator><description>&lt;p&gt;You can do that, but why bother reporting error if you are proceeding with 4 bytes anyway?&lt;/p&gt;
&lt;p&gt;You can return error &lt;code&gt;NRF_ERROR_DATA_SIZE&lt;/code&gt;, that is, error number 12.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>