<?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>Scanner and advertising options questions</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86649/scanner-and-advertising-options-questions</link><description>Hi, 
 I&amp;#39;m wrapping up a project which uses an nRF5340 as both a Bluetooth peripheral to advertise etc and also as a Bluetooth central to scan for devices (not both at the same time, though). This project currently uses NCS v1.7.1. 
 My customer requested</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Apr 2022 14:09:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86649/scanner-and-advertising-options-questions" /><item><title>RE: Scanner and advertising options questions</title><link>https://devzone.nordicsemi.com/thread/362126?ContentTypeID=1</link><pubDate>Wed, 06 Apr 2022 14:09:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a88a3ed-3848-4c62-97a9-6c6aedb2b0c5</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Glen,&lt;/p&gt;
[quote user=""]1) Bluetooth peripheral - when advertising: They wanted a mode where the device will advertise using the 1MBPS phy and then change to whatever PHY a connecting device uses when a connection is established (I&amp;#39;m using NUS once connected). I don&amp;#39;t see an option to do this automatically - is this possible?[/quote]
&lt;p&gt;There should be nothing preventing the change of the phy after the connection has been established. &lt;a href="https://docs.zephyrproject.org/latest/reference/bluetooth/connection_mgmt.html?highlight=bt_conn_get_info#c.bt_conn_get_info"&gt;bt_conn_get_info&lt;/a&gt; gives information from where it is possible to check (info-&amp;gt;le-&amp;gt;phy) which physical in ON on tx and rx. Additionally, it is possible to update to a different physical after the connection is established using &lt;a href="https://docs.zephyrproject.org/latest/reference/bluetooth/connection_mgmt.html?highlight=bt_conn_le_phy_update#c.bt_conn_le_phy_update"&gt;bt_conn_le_phy_update&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user=""]&lt;p&gt;2) Bluetooth central - when scanning, they want to be able to choose some phy specifics as follows:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;a) Scan using the 1 MBPS&amp;nbsp;phy.&amp;nbsp; --&amp;nbsp;&lt;em&gt;I don&amp;#39;t see an option to specify this.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;b) Scan using the 2MBPS phy for the &amp;quot;secondary extended advertising portion&amp;quot;. &lt;span&gt;&amp;nbsp; --&amp;nbsp;&lt;/span&gt;&lt;em&gt;I&amp;#39;m not sure what that means - does this apply to scanning at all? Maybe they mean the scan response?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;c) Scan using the Coded phy &lt;span&gt;&amp;nbsp; --&amp;nbsp;&lt;/span&gt;&lt;em&gt;no problem here - I found the option bit for this, BT_LE_SCAN_OPT_CODED&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;d) Automatically scan through the various PHY modes. &lt;span&gt;--&amp;nbsp;&lt;/span&gt;&lt;em&gt;I don&amp;#39;t think the auto scanning thing is provided by the library - is there any way to do this?&lt;/em&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&lt;br /&gt;These are available enumerators&lt;/p&gt;
&lt;div style="font-family:&amp;#39;Segoe UI&amp;#39;, system-ui, &amp;#39;Apple Color Emoji&amp;#39;, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0;text-transform:none;white-space:normal;"&gt;
&lt;div&gt;&lt;span&gt;enum&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; /** Convenience value when no options are specified. */&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;BT_LE_SCAN_OPT_NONE&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; /** Filter duplicates. */&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;BT_LE_SCAN_OPT_FILTER_DUPLICATE&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;BIT&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;),&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; /** Filter using filter accept list. */&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;BT_LE_SCAN_OPT_FILTER_ACCEPT_LIST&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;BIT&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;),&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; /** Enable scan on coded PHY (Long Range).*/&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;BT_LE_SCAN_OPT_CODED&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;BIT&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;),&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; /**&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; * &lt;/span&gt;&lt;span&gt;@brief&lt;/span&gt;&lt;span&gt; Disable scan on 1M phy.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; *&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; * &lt;/span&gt;&lt;span&gt;@note&lt;/span&gt;&lt;span&gt; Requires &lt;/span&gt;&lt;span&gt;@ref&lt;/span&gt;&lt;span&gt; BT_LE_SCAN_OPT_CODED.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; */&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;BT_LE_SCAN_OPT_NO_1M&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;BIT&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;&lt;span&gt;),&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="font-family:&amp;#39;Segoe UI&amp;#39;, system-ui, &amp;#39;Apple Color Emoji&amp;#39;, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0;text-transform:none;white-space:normal;"&gt;
&lt;div&gt;&lt;span&gt; * &lt;/span&gt;&lt;span&gt;@brief&lt;/span&gt;&lt;span&gt; Helper macro to enable active scanning to discover new devices.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; * Include scanning on Coded PHY in addition to 1M PHY.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; */&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;BT_LE_SCAN_CODED_ACTIVE&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;BT_LE_SCAN_PARAM&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;BT_LE_SCAN_TYPE_ACTIVE&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;BT_LE_SCAN_OPT_CODED&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;BT_LE_SCAN_OPT_FILTER_DUPLICATE&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;BT_GAP_SCAN_FAST_INTERVAL&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;BT_GAP_SCAN_FAST_WINDOW&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;There are following Kconfig options&lt;br /&gt;CONFIG_BT_CTLR_PHY_2M=y&amp;nbsp;&amp;nbsp;&amp;nbsp; (2Mbps PHY support in the controller)&lt;br /&gt;CONFIG_BT_CTLR_PHY_CODED=y&amp;nbsp;&amp;nbsp; (coded phy support in the controller)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]3)&amp;nbsp; They want to be able to set which advertising channel the scanner is scanning, 37, 38, or 39. There are options for picking your channel when advertising (BT_LE_ADV_OPT_DISABLE_CHAN_38), but I don&amp;#39;t see these options for scanning. Is this possible?[/quote]
&lt;p&gt;It is not possible to set advertising channel which scanner should scan.&lt;/p&gt;
&lt;p&gt;Best regards;&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>