<?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>NCS bt_le_scan_start API is limited to report phy and adv detail</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69099/ncs-bt_le_scan_start-api-is-limited-to-report-phy-and-adv-detail</link><description>Hi Team, 
 
 I&amp;#39;m working on scanner and NCS/Zephyr bt_le_scan_start callback API 
 typedef void bt_le_scan_cb_t(const bt_addr_le_t *addr, int8_t rssi, uint8_t adv_type, struct net_buf_simple *buf); 
 
 The adv_type is too limited to tell 
 PHY (1M or</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Dec 2020 08:04:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69099/ncs-bt_le_scan_start-api-is-limited-to-report-phy-and-adv-detail" /><item><title>RE: NCS bt_le_scan_start API is limited to report phy and adv detail</title><link>https://devzone.nordicsemi.com/thread/283469?ContentTypeID=1</link><pubDate>Mon, 07 Dec 2020 08:04:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc92e127-24da-4216-b070-779d25d4b7f5</guid><dc:creator>Sam Lin</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I works for me. Thanks you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;However I cannot get Scan Response from 1M LE AE and Coded devices.&lt;/p&gt;
&lt;p&gt;Active scan is used. legacy scan response is fine.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I verify Scan Response with our original scanner to make sue the Scan Response is carried with 1M AE and Coded devices.&lt;/p&gt;
&lt;p&gt;Anything missed ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;ps. I can get Scannable ADV with 0 len payload&amp;nbsp; but I cannot get Scan Response.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Sam&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS bt_le_scan_start API is limited to report phy and adv detail</title><link>https://devzone.nordicsemi.com/thread/283428?ContentTypeID=1</link><pubDate>Sun, 06 Dec 2020 17:57:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bd0be84-ddef-4ba6-b4df-4644a2429beb</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can register a callback with&amp;nbsp;bt_le_scan_cb_register(), and get all that information.&lt;/p&gt;
&lt;p&gt;If you are connecting to the devices, I recommend checking out the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.0/nrf/include/bluetooth/scan.html"&gt;NCS Scanning module&lt;/a&gt;. We use it in e.g. the &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v1.4.0/samples/bluetooth/central_bas/src/main.c"&gt;central_bas sample&lt;/a&gt;. Here you can find all that information in the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.4.0-ncs1/include/bluetooth/bluetooth.h#L1219"&gt;bt_le_scan_recv_info&lt;/a&gt;&lt;span&gt;&amp;nbsp;struct, that is included in the&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v1.4.0/include/bluetooth/scan.h#L281"&gt;bt_scan_device_info struct&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/** LE advertisement packet information */
struct bt_le_scan_recv_info {
	/**
	 * @brief Advertiser LE address and type.
	 *
	 * If advertiser is anonymous then this address will be
	 * @ref BT_ADDR_LE_ANY.
	 */
	const bt_addr_le_t *addr;

	/** Advertising Set Identifier. */
	uint8_t sid;

	/** Strength of advertiser signal. */
	int8_t rssi;

	/** Transmit power of the advertiser. */
	int8_t tx_power;

	/** Advertising packet type. */
	uint8_t adv_type;

	/** Advertising packet properties. */
	uint16_t adv_props;

	/**
	 * @brief Periodic advertising interval.
	 *
	 * If 0 there is no periodic advertising.
	 */
	uint16_t interval;

	/** Primary advertising channel PHY. */
	uint8_t primary_phy;

	/** Secondary advertising channel PHY. */
	uint8_t secondary_phy;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you&amp;nbsp;instead want to use the&amp;nbsp;&lt;span&gt;bt_le_scan_cb_register() directly, then you can find an example on how that is used in e.g. the&amp;nbsp;EnOcean subsys(used in the Bluetooth Mesh). See &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v1.4.0/subsys/bluetooth/enocean.c#L542"&gt;this link&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Snippet:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;	static struct bt_le_scan_cb scan_cb = { .recv = adv_recv };

	bt_le_scan_cb_register(&amp;amp;scan_cb);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void adv_recv(const struct bt_le_scan_recv_info *info,
		     struct net_buf_simple *buf)
{
..
..
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In adv_recv() you then have the&amp;nbsp;bt_le_scan_recv_info.&lt;/p&gt;
&lt;p&gt;See the code example&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.4.0-ncs1/tests/bluetooth/bsim_bt/bsim_test_advx/src/main.c#L768"&gt;here &lt;/a&gt;on how to decode the information in&amp;nbsp;&lt;span&gt;bt_le_scan_recv_info.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>