<?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>Center can&amp;#39; not read advertising response data?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98702/center-can-not-read-advertising-response-data</link><description>Hi, 
 I am using ble_nus_c_example to scan the ble_nus_peripheral. The uuid data is fiiled into srdata, why I can not read it in scan_evt_handler but only read the advdata? 
 Here is my scan_evt_handler and advertising_init.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Apr 2023 06:39:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98702/center-can-not-read-advertising-response-data" /><item><title>RE: Center can' not read advertising response data?</title><link>https://devzone.nordicsemi.com/thread/420653?ContentTypeID=1</link><pubDate>Mon, 17 Apr 2023 06:39:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6314df2f-c0fe-414d-9403-20ea46475e36</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Taylor,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The ble_app_uart and ble_app_uart_c use the UUID in the scan response data to filter and connect to each other. So if you use the example and if they can connect to each other (filter matched) then it must be able to capture the scan response data. You just need to change&amp;nbsp;connect_if_match=false.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The reason why you have an error when you try to put the manufacturer data to sddata could be because that it&amp;#39;s not enough space in the srdata for both the UUID and the manufacturer data. Note that you need to count the flags and the headers of each field. In total they should not exceed 31 bytes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Center can' not read advertising response data?</title><link>https://devzone.nordicsemi.com/thread/420623?ContentTypeID=1</link><pubDate>Sun, 16 Apr 2023 07:34:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2796a0b7-2321-4faa-be66-5f6863e23b01</guid><dc:creator>Taylor</dc:creator><description>&lt;p&gt;Thanks for your reply.&lt;/p&gt;
&lt;p&gt;I have set&amp;nbsp;&lt;span&gt;&amp;nbsp;set&amp;nbsp;connect_if_match=false and the init_scan.p_scan_param-&amp;gt;active =1 is default.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/98702/center-can-not-read-advertising-response-data/420518"] assume you set&amp;nbsp;connect_if_match=false and want to process the adv/scan response data before connecting ?&amp;nbsp;[/quote]
&lt;p&gt;When I add&amp;nbsp;manuf_specific_data with init.srdata.p_manuf_specific_data = &amp;amp;manuf_specific_data, it will cause an error, but using&amp;nbsp;&lt;span&gt;init.advdata.p_manuf_specific_data = &amp;amp;manuf_specific_data will work normally.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;scan_init and&amp;nbsp;advertising_init&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void advertising_init(void)
{
		uint32_t               adv_slow_interval = FAC_ADV_INTERVAL;
    ret_code_t             err_code;
    ble_advertising_init_t init;

    memset(&amp;amp;init, 0, sizeof(init));
	
		//
		uint8_t my_adv_manuf_data[10] = {0};
		ble_advdata_manuf_data_t manuf_specific_data;
		ble_gap_addr_t bleAddr;
		
		sd_ble_gap_addr_get(&amp;amp;bleAddr);
		for(int i=0;i&amp;lt;6;i++)
		{
				my_adv_manuf_data[i] = bleAddr.addr[5-i];
		}
		my_adv_manuf_data[6] = &amp;#39;Z&amp;#39;;
		my_adv_manuf_data[7] = &amp;#39;E&amp;#39;;
		my_adv_manuf_data[8] = &amp;#39;N&amp;#39;;
		my_adv_manuf_data[9] = &amp;#39;G&amp;#39;;
		
		manuf_specific_data.company_identifier = 0xFFEE;
		manuf_specific_data.data.p_data = my_adv_manuf_data;
		manuf_specific_data.data.size   = sizeof(my_adv_manuf_data);
		init.srdata.p_manuf_specific_data = &amp;amp;manuf_specific_data;
		//

		if(m_usr_system.work_mode == AFD_WORK_MODE)adv_slow_interval = WORK_ADV_INTERVAL;
		else adv_slow_interval = FAC_ADV_INTERVAL;
	
    init.advdata.name_type               = BLE_ADVDATA_FULL_NAME;
    init.advdata.include_appearance      = false;
    init.advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
	
    init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.srdata.uuids_complete.p_uuids  = m_adv_uuids;

    init.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
    init.config.ble_adv_fast_timeout  = APP_ADV_DURATION;

		init.config.ble_adv_slow_enabled  = true;
		
    init.config.ble_adv_slow_interval = adv_slow_interval;
		init.config.ble_adv_slow_timeout  = 0;
	
    init.evt_handler = on_adv_evt;

    err_code = ble_advertising_init(&amp;amp;m_advertising, &amp;amp;init);
    APP_ERROR_CHECK(err_code);

    ble_advertising_conn_cfg_tag_set(&amp;amp;m_advertising, APP_BLE_CONN_CFG_TAG);
}

void scan_init(uint8_t *filt_adv_name)
{
    ret_code_t          err_code;
    nrf_ble_scan_init_t init_scan;
//	f8:8a:5e:b2:3e:85  BEELINKER
//	ac:23:3f:af:08:7d  MINEW S4 TAG
		uint8_t m_periph_name[] = &amp;quot;VS_NULL&amp;quot;;
//		uint8_t addr_bt[6]={0x7D,0x08,0xAF,0x3F,0x23,0xAC};
	
    memset(&amp;amp;init_scan, 0, sizeof(init_scan));

    init_scan.connect_if_match = false;
    init_scan.conn_cfg_tag     = APP_BLE_CONN_CFG_TAG;

    err_code = nrf_ble_scan_init(&amp;amp;m_scan, &amp;amp;init_scan, scan_evt_handler);
    APP_ERROR_CHECK(err_code);
	
		err_code = nrf_ble_scan_filter_set(&amp;amp;m_scan, SCAN_NAME_FILTER, &amp;amp;m_periph_name);
		APP_ERROR_CHECK(err_code);

//		err_code = nrf_ble_scan_filter_set(&amp;amp;m_scan, SCAN_ADDR_FILTER, &amp;amp;addr_bt);
//		APP_ERROR_CHECK(err_code);

//    err_code = nrf_ble_scan_filter_set(&amp;amp;m_scan, SCAN_UUID_FILTER, &amp;amp;m_nus_uuid);
//    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_scan_filters_enable(&amp;amp;m_scan, NRF_BLE_SCAN_NAME_FILTER, false);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Center can' not read advertising response data?</title><link>https://devzone.nordicsemi.com/thread/420518?ContentTypeID=1</link><pubDate>Fri, 14 Apr 2023 13:20:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cdf7ace-7d4b-4815-bc2a-17b703515dd7</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Taylor,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I assume you set&amp;nbsp;connect_if_match=false and want to process the adv/scan response data before connecting ?&amp;nbsp;&lt;br /&gt;Have you made sure you do active scanning (configure init_scan.p_scan_param-&amp;gt;active =1 in&amp;nbsp;scan_init())&amp;nbsp; ? (when doing passive scanning the scanner will not send scan request).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you do active scanning, the scan response packet will be reported to the application the same way as it&amp;#39;s an advertising packet.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>