<?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>Peripheral Connection Issues When Configured as Dual Central and Peripheral</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40858/peripheral-connection-issues-when-configured-as-dual-central-and-peripheral</link><description>I am working on integrated peripheral and central device used for indoor positioning. The device has two modes, at boot it is a peripheral for some duration of time then it stops advertising and becomes a central to perform the positioning activities</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 26 Nov 2018 23:39:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40858/peripheral-connection-issues-when-configured-as-dual-central-and-peripheral" /><item><title>RE: Peripheral Connection Issues When Configured as Dual Central and Peripheral</title><link>https://devzone.nordicsemi.com/thread/159123?ContentTypeID=1</link><pubDate>Mon, 26 Nov 2018 23:39:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b377c9dc-e114-4606-abf0-551d8a06b231</guid><dc:creator>WestCoastDaz</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/kenneth"&gt;Kenneth&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It turns out that I was calling the event handler for the central during a peripheral connection which was messing everything up.&amp;nbsp; Thanks for the help, especially the tip about the disconnection reason.&lt;/p&gt;
&lt;p&gt;Darren&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peripheral Connection Issues When Configured as Dual Central and Peripheral</title><link>https://devzone.nordicsemi.com/thread/159106?ContentTypeID=1</link><pubDate>Mon, 26 Nov 2018 17:38:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5bcfbfb-0b4a-4d2a-928d-f61f84ef66be</guid><dc:creator>WestCoastDaz</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/kenneth"&gt;Kenneth&lt;/a&gt;Thanks for taking the time to reply!&amp;nbsp; I followed your suggestions to change the&amp;nbsp;NRF_SDH_BLE_TOTAL_LINK_COUNT to 2 and to add the disconnect reason but the issues still persists.&amp;nbsp; The disconnect reason is 0x16 which&amp;nbsp;&lt;/p&gt;
&lt;div style="background-color:#1e1e1e;color:#d4d4d4;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#dcdcaa;"&gt;BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I also am getting this nRFConnect&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1543253844084v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Maybe this is a connection handle issue?&lt;/p&gt;
&lt;p&gt;Thoughts?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peripheral Connection Issues When Configured as Dual Central and Peripheral</title><link>https://devzone.nordicsemi.com/thread/159025?ContentTypeID=1</link><pubDate>Mon, 26 Nov 2018 13:15:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38bd2700-03f5-442f-a8b3-cd07c06f05f6</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Just to avoid race conditions I suggest you set&amp;nbsp;NRF_SDH_BLE_TOTAL_LINK_COUNT to 2, this means you can have both a peripheral and central link at the same time.&lt;/p&gt;
&lt;p&gt;Make sure that you have control of the conn_handle&amp;#39;s, since it may for instance be 0 or 1 (or more). This may explain why&amp;nbsp;&lt;span&gt;sd_ble_gap_data_length_update() return&amp;nbsp;NRF_ERROR_INVALID_STATE (No link has been established, see ble_gap.h), if for instance you are trying to initiate the procedure on the wrong conn_handle (link is not established).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I notice it says&amp;nbsp;Disconnected, but what is the disconnect reason? E.g. check&amp;nbsp;p_ble_evt-&amp;gt;evt.gap_evt.params.disconnected.reason on&amp;nbsp;BLE_GAP_EVT_DISCONNECTED event. Various reasons listed in ble_hci.h.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>