<?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>Two centrals both scanning</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67580/two-centrals-both-scanning</link><description>I have two nRF52832 side by side scanning for advertisement with filter by name. Because I will have a number of peripherals advertising, so I want to have multiple centrals to serve them. I notice both centrals will connect to the same device, and one</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 26 Oct 2020 22:46:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67580/two-centrals-both-scanning" /><item><title>RE: Two centrals both scanning</title><link>https://devzone.nordicsemi.com/thread/276985?ContentTypeID=1</link><pubDate>Mon, 26 Oct 2020 22:46:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:101ff152-4a4d-4f72-bc0c-da3251ceaccb</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;You don&amp;#39;t need it - you can do it in your firmware.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two centrals both scanning</title><link>https://devzone.nordicsemi.com/thread/276984?ContentTypeID=1</link><pubDate>Mon, 26 Oct 2020 22:41:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a8ae928-7003-4c77-a68f-52cbdc92a400</guid><dc:creator>Joe</dc:creator><description>&lt;p&gt;Awneil, my difficulty is I don&amp;#39;t have access to the firmware outside the Nordic chip.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two centrals both scanning</title><link>https://devzone.nordicsemi.com/thread/276982?ContentTypeID=1</link><pubDate>Mon, 26 Oct 2020 22:36:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ca4781f-02d0-4eaa-8a29-58c7fbe04224</guid><dc:creator>awneil</dc:creator><description>[quote userid="18670" url="~/f/nordic-q-a/67580/two-centrals-both-scanning/276980#276980"]My issue is the stack reports it is connected, but it may not really be[/quote]
&lt;p&gt;My suggestion would avoid you getting into that situation at all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two centrals both scanning</title><link>https://devzone.nordicsemi.com/thread/276980?ContentTypeID=1</link><pubDate>Mon, 26 Oct 2020 22:25:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3b96b0e-c93f-496d-8fc4-064e6cf7f5c6</guid><dc:creator>Joe</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;It looks like the sd_ble_gap_connect() takes the parameters from sdk_config.h.&lt;br /&gt;#define NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL 7.5&lt;br /&gt;#define NRF_BLE_SCAN_MAX_CONNECTION_INTERVAL 30&lt;br /&gt;#define NRF_BLE_SCAN_SLAVE_LATENCY 0&lt;br /&gt;#define NRF_BLE_SCAN_SUPERVISION_TIMEOUT 2000&lt;br /&gt;They are already very small values, if I reduce them to smaller value, the firmware will halt.&lt;/p&gt;
&lt;p&gt;You mentioned the 6 connection intervals, is it a parameter I can change?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My issue is the stack reports it is connected, but it may not really be. Is there a reliable way to detect the connection is really made after the SCAN REQUEST?&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two centrals both scanning</title><link>https://devzone.nordicsemi.com/thread/276928?ContentTypeID=1</link><pubDate>Mon, 26 Oct 2020 14:50:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7c1a347-02a1-472a-bbd7-4ccf059dc82f</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;If a connection request is sent from the central, then the central will try 6 connection intervals before giving up (;connection&amp;nbsp;failed to establish), so you can for instance set the initial (minimum) connection interval to something shorter than 80-100ms? When trying to connect to a peripheral, it may also be good to set a reasonable timeout value (e.g. 1-2seconds), in case the peripheral is no longer in range or turned OFF. Both these parameters are set when calling&amp;nbsp;sd_ble_gap_connect().&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two centrals both scanning</title><link>https://devzone.nordicsemi.com/thread/276726?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2020 22:58:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7328a568-ebff-4a74-b9a2-044a0a14d098</guid><dc:creator>awneil</dc:creator><description>[quote userid="18670" url="~/f/nordic-q-a/67580/two-centrals-both-scanning/276725#276725"]Both centrals says they are connected[/quote]
&lt;p&gt;I think that&amp;#39;s the point from the linked thread: they say &amp;#39;connected&amp;#39; as soon as they have &lt;em&gt;&lt;strong&gt;requested&lt;/strong&gt; &lt;/em&gt;the connection - but that&amp;#39;s before the connection has been completely established.&lt;/p&gt;
&lt;p&gt;Again, I think the safest approach would be to have something at your Central end decide on which one - and &lt;em&gt;only&lt;/em&gt; one - of your nRF52832s is going to make the connection.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two centrals both scanning</title><link>https://devzone.nordicsemi.com/thread/276725?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2020 22:52:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b2f2fba-ac3f-4b50-94b2-7921892dc898</guid><dc:creator>Joe</dc:creator><description>&lt;p&gt;Thank you for the link. I don&amp;#39;t get a BLE_HCL_CONN_FAILED_TO_BE_ESTABLISHED, it would be good if I do. I poll for events for more than a second after they are connected, and don&amp;#39;t see&amp;nbsp;any event that indicates problem. Both centrals says they are connected, but one take a lot longer than the other one to connect.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two centrals both scanning</title><link>https://devzone.nordicsemi.com/thread/276722?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2020 22:21:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df6ad2fb-33f9-49bc-a26a-0500a1513da6</guid><dc:creator>awneil</dc:creator><description>[quote userid="18670" url="~/f/nordic-q-a/67580/two-centrals-both-scanning/276721#276721"] I am surprise the second central can connect to it after the first one since the peripheral should stop the advertisement after the connection.[/quote]
&lt;p&gt;Of course, they will both see the advertising.&lt;/p&gt;
&lt;p&gt;Then they might both try to &lt;em&gt;initiate&lt;/em&gt; connecting at the &amp;quot;same&amp;quot; time - but only one will actually succeed to fully establish the connection. The other one will just time out, because the peripheral will not accept the connection.&lt;/p&gt;
&lt;p&gt;I would guess that you are getting a&amp;nbsp;BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED - as described here:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/40808/connect-procedure-and-the-disconnect-reason-0x3e-ble_hci_conn_failed_to_be_established"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/40808/connect-procedure-and-the-disconnect-reason-0x3e-ble_hci_conn_failed_to_be_established&lt;/a&gt;&amp;nbsp;?&lt;/p&gt;
[quote userid="18670" url="~/f/nordic-q-a/67580/two-centrals-both-scanning/276721#276721"] I hope to find something in the Central side which is my Nordic code to tell if it is the second connection or invalid connection,[/quote]
&lt;p&gt;Again, I think you need one of your Centrals to make the decision on which of the two is to initiate the connection.&lt;/p&gt;
&lt;p&gt;Or, maybe, a 3rd processor to make the decision?&lt;/p&gt;
&lt;p&gt;Or perhaps you could have only one of them scanning - and it will tell the other the necessary details of the peripheral(s) for it to connect to ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two centrals both scanning</title><link>https://devzone.nordicsemi.com/thread/276721?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2020 22:10:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf6b212a-9e17-438a-b7ae-e9a37832ff04</guid><dc:creator>Joe</dc:creator><description>&lt;p&gt;The two centrals are in the same enclosure. Actually, I am surprise the second central can connect to it after the first one since the peripheral should stop the advertisement after the connection. I saw from the MultiPeripheral example, that when NRF_SDH_BLE_PERIPHERAL_LINK_COUNT is set to more than 1, a peripheral can connect to multiple centrals at the same time? Not sure how the advertisement work in that case.&lt;/p&gt;
&lt;p&gt;The peripheral is a third party device so I have little control over the parameters. I hope to find something in the Central side which is my Nordic code to tell if it is the second connection or invalid connection, and abort from it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two centrals both scanning</title><link>https://devzone.nordicsemi.com/thread/276720?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2020 21:58:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c9e6109-0ec8-4c17-b8f5-53f3007b2388</guid><dc:creator>awneil</dc:creator><description>[quote userid="18670" url="~/f/nordic-q-a/67580/two-centrals-both-scanning"]two nRF52832 side by side scanning for advertisement[/quote]
&lt;p&gt;You mean they are physically located together - on the same board, or in the same enclosure?&lt;/p&gt;
&lt;p&gt;Perhaps you could make one of them the &amp;quot;master&amp;quot; and have it decide which of the two&amp;nbsp;&lt;span&gt;nRF52832s is to attempt to make the connection to each peripheral ?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>