<?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 interpret value from custom characteristic</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10960/how-to-interpret-value-from-custom-characteristic</link><description>Hello 
 I made a custom service with characteristic. It send the number 1234 over ble. When i open the Master Control Panel and look at the custom characteristic. I read a value of (0x) 01-D2-04. How can i get a decimal value that&amp;#39;s unstable? 
 
 Hope</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 Dec 2015 08:36:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10960/how-to-interpret-value-from-custom-characteristic" /><item><title>RE: How to interpret value from custom characteristic</title><link>https://devzone.nordicsemi.com/thread/40998?ContentTypeID=1</link><pubDate>Tue, 22 Dec 2015 08:36:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f9ad524-bf53-4240-b812-980cf0fa5065</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;You can accept his answer by clicking the check mark next to it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to interpret value from custom characteristic</title><link>https://devzone.nordicsemi.com/thread/41001?ContentTypeID=1</link><pubDate>Tue, 22 Dec 2015 07:09:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2d9b0c6-dcfd-4c79-b685-0a64fca2b541</guid><dc:creator>nick</dc:creator><description>&lt;p&gt;Thank you RK it all makes sense now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to interpret value from custom characteristic</title><link>https://devzone.nordicsemi.com/thread/41000?ContentTypeID=1</link><pubDate>Mon, 21 Dec 2015 23:37:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f010f7b4-bdba-4348-a668-aed8102f2396</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;You&amp;#39;re just sending data, there is no &amp;#39;sending it in decimal&amp;#39; it&amp;#39;s just 16 bits which represent an integer and hexadecimal and decimal are just two ways of writing down the value of that number, or you can write it in binary. So if you are going to send a number by putting it in a buffer and sending it out as two bytes, then the receiving app needs to put those back into a number by receiving and processing two bytes (two little-endian bytes in this case) and turning them back into the same number represented on the app side, in this case the number is 256 * byte[1] + byte[0].&lt;/p&gt;
&lt;p&gt;If you look at the spec for the HRM service (&lt;a href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml)"&gt;developer.bluetooth.org/.../CharacteristicViewer.aspx&lt;/a&gt; you&amp;#39;ll see the data format is defined, the HRM app interprets it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to interpret value from custom characteristic</title><link>https://devzone.nordicsemi.com/thread/40999?ContentTypeID=1</link><pubDate>Mon, 21 Dec 2015 16:05:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5aa1bf57-b12e-4a02-8b0b-48565d32ab4d</guid><dc:creator>nick</dc:creator><description>&lt;p&gt;Ah.. i never new that the reading is backwards. &lt;strong&gt;Is it also possible to send the reading in decimal to the Nordic app&lt;/strong&gt; or does the app normally convert the integer from hexadecimal to decimal. Because i just copied the HRM service and changed the UUID to a custom one. in the HRM example the app is showing the given value in decimal with behind the number BPM.
Already thanks.&lt;/p&gt;
&lt;p&gt;Nick&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to interpret value from custom characteristic</title><link>https://devzone.nordicsemi.com/thread/40997?ContentTypeID=1</link><pubDate>Sun, 20 Dec 2015 23:46:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:904f4f4b-4b8b-4903-8775-b9b81e95c964</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;1234 = 0x04D2, I&amp;#39;m assuming you sent the leading 0x01 yourself as part of the message data, so you have exactly what you need. It&amp;#39;s just your integer in hexadecimal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>