<?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 does `sd_ble_gap_connect()` require the scan params?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18598/why-does-sd_ble_gap_connect-require-the-scan-params</link><description>The footprint of sd_ble_gap_connect() is: 
 uint32_t, sd_ble_gap_connect(ble_gap_addr_t const *p_peer_addr, ble_gap_scan_params_t const *p_scan_params, ble_gap_conn_params_t const *p_conn_params) 
 
 why does the connect function also requires the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 27 Dec 2016 09:06:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18598/why-does-sd_ble_gap_connect-require-the-scan-params" /><item><title>RE: Why does `sd_ble_gap_connect()` require the scan params?</title><link>https://devzone.nordicsemi.com/thread/71769?ContentTypeID=1</link><pubDate>Tue, 27 Dec 2016 09:06:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9efeb60b-4b17-43ec-93ed-373b55f99bf8</guid><dc:creator>adriand</dc:creator><description>&lt;p&gt;If you have already known peripheral (you know its MAC address) you should then use only sd_ble_gap_connect() where you can use new scan parameters. Scanning by sd_ble_gap_scan_start() is to be used only for finding peripherals / listening advertising packets, etc. Please be aware that connecting and scanning operations are very power consupmtive depending on scan / conn parameters in both cases.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does `sd_ble_gap_connect()` require the scan params?</title><link>https://devzone.nordicsemi.com/thread/71768?ContentTypeID=1</link><pubDate>Tue, 27 Dec 2016 08:16:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9237bdb9-bb12-4b1f-a9d5-cb7434eeebef</guid><dc:creator>Boaz</dc:creator><description>&lt;p&gt;Thanks Adriand. Does this mean that if I want to scan and connect to a know peripheral, I don&amp;#39;t have to first call &lt;code&gt;sd_ble_gap_scan_start()&lt;/code&gt;? Namely, can I scan-and-connect, even with new scan parameters, with &lt;code&gt;sd_ble_gap_connect()&lt;/code&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does `sd_ble_gap_connect()` require the scan params?</title><link>https://devzone.nordicsemi.com/thread/71767?ContentTypeID=1</link><pubDate>Mon, 26 Dec 2016 20:47:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cead90a7-44b7-4fa5-9ea6-0034e38e9ba2</guid><dc:creator>adriand</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;why does the connect function also requires the scan parameters?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I believe this is because central device before sending connection request needs to receive advertising packets from the peripheral device that should advertise in connectable mode. In order to receive anything it has to scan.
What is more also advertiser (in connectable mode) is managing short scans (probably about 150us) after every ADV packet broadcasted. This is because the advertiser also has to be &amp;quot;informed&amp;quot; that there is some central device trying to connect in order to start connection procedure.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;must the scan parameters be exactly the same as the ones used for actual scanning&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;No, you can use completely different parameters. I belive that those parameters have an impact on how fast connection will be established. Of course it&amp;#39;s also depends on advertising parameters.&lt;/p&gt;
&lt;p&gt;Cheers,
ad&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>