<?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>Second connection setup to wrong peer by central.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77935/second-connection-setup-to-wrong-peer-by-central</link><description>Hi all, 
 
 We run into a problem where our central product (a remote control) connects to the wrong device. We are using SDK v14.2.0 and softdevice S132 version 5.1.0. At the start of the project we tried using the then most current SDK and softdevice</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 29 Jul 2021 06:10:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77935/second-connection-setup-to-wrong-peer-by-central" /><item><title>RE: Second connection setup to wrong peer by central.</title><link>https://devzone.nordicsemi.com/thread/322345?ContentTypeID=1</link><pubDate>Thu, 29 Jul 2021 06:10:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:960a5e0d-ac2c-4160-ab20-4b21c836dffd</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;span&gt;sd_ble_gatts_exchange_mtu_reply() indicates that the device is in an &amp;quot;invalid state&amp;quot; when trying to send this reply. Is the&amp;nbsp;sd_ble_gatts_exchange_mtu_reply() function being called elsewhere in your project outside of the GATT module? One reason you may get the invalid state error is if the application responds to the same MTU REQUEST event multiple times for instance. You should only define one GATT instance, as this instance will handle both central and peripheral connections.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second connection setup to wrong peer by central.</title><link>https://devzone.nordicsemi.com/thread/322091?ContentTypeID=1</link><pubDate>Tue, 27 Jul 2021 15:09:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:025a2eb8-0fcf-419d-ac4a-900654a96b6a</guid><dc:creator>Bert Thomas</dc:creator><description>&lt;p&gt;One additional piece of information: when the central connects to the wrong device we get the following log output:&lt;/p&gt;
&lt;p&gt;sd_ble_gatts_exchange_mtu_reply() returned unexpected value 0x8.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Our current solution is to detect that we are connected to the wrong peripheral and in that case disconnect and try again. Sometimes it fails many times before succeeding.&lt;br /&gt;&lt;br /&gt;The peripheral is an nrf52 that uses sdk 15.2 and softdevice 6.1. Even though it also a product developed by us we cannot change that firmware as it is already in production and probably sold to end users.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I use our own service id that is advertised in a advertising response packet and based on that we decide to connect.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second connection setup to wrong peer by central.</title><link>https://devzone.nordicsemi.com/thread/322065?ContentTypeID=1</link><pubDate>Tue, 27 Jul 2021 13:23:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e644642-b6bb-4a46-89fc-8b36d50cfea7</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Due to the summer vacation period we are currently understaffed, so delayed replies must be expected. I am sorry about any inconvenience this might cause.&lt;/p&gt;
&lt;p&gt;v5.1.0 of SoftDevice S132 is the only SoftDevice that is &lt;a href="https://infocenter.nordicsemi.com/topic/comp_matrix_nrf52810/COMP/nrf52810/nRF52810_ic_rev_sdk_sd_comp_matrix.html"&gt;production tested (and thus officially supported) with the nRF52810&lt;/a&gt;. It generally isn&amp;#39;t a good fit for a central application exactly because of its restrictions in terms of RAM and Flash memory. If possible, I would suggest moving the project to a device with more memory.&lt;/p&gt;
&lt;p&gt;What is this peripheral that you&amp;#39;re connecting to twice? Is this an nRF52 device as well or some other device? Are these two peripheral devices similar or distinctly different in terms of advertisement packets, device names, what services they provide, and so on? I&amp;#39;ve not heard of something like this before, so I&amp;#39;ll need to do some investigation before getting back to you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>