<?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>128-bit UUID byte swap problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7306/128-bit-uuid-byte-swap-problem</link><description>I&amp;#39;m implementing a custom service with one characteristic and 128-bit UUID. 
 I am able to set the custom base UUID using sd_ble_uuid_vs_add() but the resulting bytes look swapped in nRF MCP Android application. This is on Softdevice 7.0.0 and SDK 6</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 01 Jun 2015 13:33:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7306/128-bit-uuid-byte-swap-problem" /><item><title>RE: 128-bit UUID byte swap problem</title><link>https://devzone.nordicsemi.com/thread/25844?ContentTypeID=1</link><pubDate>Mon, 01 Jun 2015 13:33:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccf4f76f-62e8-47ed-be9d-f60967528ec4</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;It&amp;#39;s just a corollory of the BTLE spec. Each parameter is transferred little-endian and the way it&amp;#39;s specified in the code is in the order the data is going to be transmitted, so least significant byte first. That saves I suppose, the softdevice having to flip it all around before storing it/sending it. The conventional way for humans to look at UUIDs however is big-endian in groups with dashes.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s quite easy to look at UUIDs in the MCP or other place they&amp;#39;re displayed and not even think about the order they were specified in code originally, seems that this particular time you did look closely and saw it, but it will have been that way forever.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 128-bit UUID byte swap problem</title><link>https://devzone.nordicsemi.com/thread/25843?ContentTypeID=1</link><pubDate>Mon, 01 Jun 2015 13:26:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f00c5b4d-e676-4db5-8d6b-7e4384c4975d</guid><dc:creator>kerem</dc:creator><description>&lt;p&gt;I understand the reason is the reverse endianness between nrf51-dk and MCU Android app, fine. What i dont understand is why? I dont remember anything about this even though i used MCP quite a lot so far for displaying various diffrent UUIDs. It feels strange that i never noticed such behavior.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 128-bit UUID byte swap problem</title><link>https://devzone.nordicsemi.com/thread/25839?ContentTypeID=1</link><pubDate>Mon, 01 Jun 2015 08:50:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c10179c8-50f0-4b6b-adf2-7e6bddddcc7d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@kerem: What RK explained was correct. It was the encoding difference. In the code we use little endian but when displaying on MCP it was big endian. Could you try smth else not with 00 in the middle ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 128-bit UUID byte swap problem</title><link>https://devzone.nordicsemi.com/thread/25842?ContentTypeID=1</link><pubDate>Thu, 28 May 2015 23:09:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f82304bd-130a-4fff-b32b-d2ebaaf4bf7f</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I really don&amp;#39;t understand your question. There is no problem. You have entered a series of bytes in an array to use for your UUID. Those bytes represent a 128 bit number. The first byte in the array  is the least significant byte, the 16th is the most significant byte. When you look at the number formatted for humans to look at, which is most-significant byte first, you see the last byte in the array going all the way down to the first byte in the array.&lt;/p&gt;
&lt;p&gt;This is not &amp;#39;the first and last pairs of bytes are swapped and they are also swapped within the pair&amp;#39;. This is &amp;#39;I see the number with the bytes displayed in the exact opposite order to the way they are in the array, with the 16th first, then the 15th, then the 14th all the way down to the first&amp;#39;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 128-bit UUID byte swap problem</title><link>https://devzone.nordicsemi.com/thread/25841?ContentTypeID=1</link><pubDate>Thu, 28 May 2015 16:32:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a072f60-3e52-425b-8cb4-5660c629f81f</guid><dc:creator>kerem</dc:creator><description>&lt;p&gt;I deliberately set them to 0x00 for brevity. At first sight i was able to observe the order problem in the first 2 and last 2 bytes since i manually entered them. So is this ok or should i encode the uuid first to change its endianness?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 128-bit UUID byte swap problem</title><link>https://devzone.nordicsemi.com/thread/25840?ContentTypeID=1</link><pubDate>Thu, 28 May 2015 15:06:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7578402-03c7-4293-b2d8-97b7e1c006be</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;There&amp;#39;s nothing wrong with that, the bytes are little-endian and the number is displayed in the MCP as a big-endian number.&lt;/p&gt;
&lt;p&gt;You say all the octets between those are fine ... well all the octets between those are all 0x00 so you wouldn&amp;#39;t be able to tell which order they were in.&lt;/p&gt;
&lt;p&gt;Why are they all zero by the way, it&amp;#39;s probably a legal UUID but certainly not one you randomly generated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 128-bit UUID byte swap problem</title><link>https://devzone.nordicsemi.com/thread/25838?ContentTypeID=1</link><pubDate>Thu, 28 May 2015 13:49:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e34812e9-a8c4-4a92-9e51-b1505a3660b2</guid><dc:creator>kerem</dc:creator><description>&lt;p&gt;I haven&amp;#39;t tried any other example but I lookup up other questions here and implemented as seen &lt;a href="https://devzone.nordicsemi.com/question/18344/custom-128bits-uuid/"&gt;here&lt;/a&gt; setting up the base first and using returned uuid_type from the function &lt;code&gt;sd_ble_uuid_vs_add&lt;/code&gt;. I attached a screenshot of what I see on MCP application. Edited my post as this is related to softdevice 7.0.0 and SDK 6.1.0 on nrf51-DK, I&amp;#39;m doing this using Keil 5.0 running inside VirtualBox on OS X.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 128-bit UUID byte swap problem</title><link>https://devzone.nordicsemi.com/thread/25837?ContentTypeID=1</link><pubDate>Thu, 28 May 2015 13:32:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61b52829-cd4a-48cb-92a3-8bbda72765c1</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Kerem: What you described is pretty strange. Could you provide a screenshot of what you experienced ?
Where did you read the UUID that have swapped bytes ?&lt;/p&gt;
&lt;p&gt;Have you tried our example ble_app_uart in \Board\pca10001\s110\experimental folder ? I that example we also declare 128bit UUID service.
I don&amp;#39;t see the swapping issue when testing with this example and the Master Control panel.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>