<?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>Add scan response data to DFU bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71423/add-scan-response-data-to-dfu-bootloader</link><description>Hello together, 
 
 I try to add some bytes for scan response data in DFU bootloader. So I changed the file components/libraries/bootloader/ble_dfu/nrf_dfu_ble.c to add 6 bytes: 
 
 
 But then, the bootloader does not advertize. If I remove the 6 lines</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 08 Feb 2021 19:37:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71423/add-scan-response-data-to-dfu-bootloader" /><item><title>RE: Add scan response data to DFU bootloader</title><link>https://devzone.nordicsemi.com/thread/293431?ContentTypeID=1</link><pubDate>Mon, 08 Feb 2021 19:37:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:570cebf3-f5f5-496f-8c18-9901bd7fbe7b</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can&amp;#39;t just add&amp;nbsp;&lt;span&gt;arbitrary bytes to a advertising/scan-response packet like this. It follows a certain format. See &lt;a href="https://www.novelbits.io/bluetooth-low-energy-advertisements-part-2/"&gt;this post&lt;/a&gt;. Based on the flags and data you provide, the device that scans these packets decodes and displays the data in different ways. In the nRF5 SDK, we have the function&amp;nbsp;ble_advdata_encode() that helps you encode the data in the correct format.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You have&amp;nbsp;m_enc_resp_data[0]=0x0A , so you are indicating that you have 0x0A length of data, but at the same time&amp;nbsp;you are setting&amp;nbsp;scan_rsp_data.len to 6. Try setting&amp;nbsp;m_enc_resp_data[0] to 0x05 instead.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>