<?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>Why is BLE_ADDR_OFFSET 3?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9962/why-is-ble_addr_offset-3</link><description>I&amp;#39;m trying to do background transmission of an advertising packet using the timeslot API. I&amp;#39;m basing my code on the multi-role-conn-observer-advertiser example. My question is, why do they have the BLE_ADDR_OFFSET set to 3, when according to the BLE specification</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 29 Oct 2015 12:35:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9962/why-is-ble_addr_offset-3" /><item><title>RE: Why is BLE_ADDR_OFFSET 3?</title><link>https://devzone.nordicsemi.com/thread/36963?ContentTypeID=1</link><pubDate>Thu, 29 Oct 2015 12:35:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:752aec48-d2eb-415b-a7ac-345eb77d8e18</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Ah very clear, thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why is BLE_ADDR_OFFSET 3?</title><link>https://devzone.nordicsemi.com/thread/36962?ContentTypeID=1</link><pubDate>Thu, 29 Oct 2015 10:42:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9757e3c4-70a4-41ce-a61f-fe75a59e012a</guid><dc:creator>Trond Einar Snekvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You are correct about the BLE-specification, and the nRF51 radio has some additional conditions on the S1:&lt;/p&gt;
&lt;p&gt;According to the nRF51 reference manual v3.0 ch. 17.1.2 (last paragraph), the header fields S0, Length and S1 will be represented as a whole byte in memory if they have more than 0 bit lengths.&lt;/p&gt;
&lt;p&gt;In the BLE 4.0 spec, the length-field of a packet is only 6bits, leaving 2 bits as RFU. RFU bits should be set to zero by the transmitting radio and ignored by the receiving. On the nRF51, these two bits are represented by S1, but because of the byte-rule mentioned above, S1 must be represented as a whole byte in memory. So yes, &lt;strong&gt;there is a whole padding byte after the length&lt;/strong&gt;, even though that field is only two bits in the BLE spec. If the packet for some reason breaks the BLE specification by having the two padding bits set to 1, it will get pushed into the two least significant bits of S1.&lt;/p&gt;
&lt;p&gt;If we were to leave the Length field as 8bit (and S1 as 0bits), we could avoid this padding in memory, but the radio would not ignore these bits when calculating the length of an incoming packet. If another radio sets any of those bits, the nRF51 would then take them into account when calculating packet length and the position of the CRC field at the end, and attempt to receive a packet that is way too long, and has a seemingly invalid CRC.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>