<?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>Peer manager - pm_conn_secure returning invalid state</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43957/peer-manager---pm_conn_secure-returning-invalid-state</link><description>In the case where connecting to a phone that is paired with my device after my device has cleared pairing information and doesn&amp;#39;t remember the pair, I&amp;#39;m observing the following behavior: 
 When pm_conn_secure is called the first time it returns NRF_SUCCESS</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Feb 2019 08:37:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43957/peer-manager---pm_conn_secure-returning-invalid-state" /><item><title>RE: Peer manager - pm_conn_secure returning invalid state</title><link>https://devzone.nordicsemi.com/thread/172691?ContentTypeID=1</link><pubDate>Mon, 25 Feb 2019 08:37:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4c01e12-2d5b-4d5f-9d85-f44350857d44</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;To make a secure connection via bonding, I suggest you take a look at one of our examples doing just that, for example ble_app_proximity. (You can also test with an unmodified build of this example to ensure that you are able to bond properly).&lt;/p&gt;
&lt;p&gt;You can check out &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/35433/configuring-peer-manager-for-bonding"&gt;this case&lt;/a&gt; which describes how to check if there is existing bond info on the device you are pairing with already, which might cause errors.&amp;nbsp;&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><item><title>RE: Peer manager - pm_conn_secure returning invalid state</title><link>https://devzone.nordicsemi.com/thread/172565?ContentTypeID=1</link><pubDate>Fri, 22 Feb 2019 18:52:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b27be95f-9663-45e7-97ea-444ebc5f82b0</guid><dc:creator>erinh</dc:creator><description>&lt;p&gt;Thanks for your help so far.&amp;nbsp; This is indeed the case (phone has not deleted the stored pair, but nrf device has).&amp;nbsp; I&amp;#39;m wondering how to get peer manager to secure the connection (where the phone user approves pairing request again) in the same connection, because the current flow is to disconnect and let the next connection send pairing request.&amp;nbsp; I&amp;#39;d like to use peer manager properly in the same connection to enhance user experience but the way to use peer manager in this case isn&amp;#39;t clear.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peer manager - pm_conn_secure returning invalid state</title><link>https://devzone.nordicsemi.com/thread/172441?ContentTypeID=1</link><pubDate>Fri, 22 Feb 2019 08:32:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d1a4170-d1d2-4234-95ba-4bf47165a93c</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The error 0x1006 (PM_CONN_SEC_ERROR_PIN_OR_KEY_MISSING) indicates that the phone hasn&amp;#39;t deleted the stored pair, so if you do this before the first connection I think this should work fine.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/38262/ble_app_template-connection-ecryption-error-in-sdk-15-1/148153#148153"&gt;This post&lt;/a&gt; deals with a similar issue, so maybe you can find some hints there if this still doesn&amp;#39;t work.&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><item><title>RE: Peer manager - pm_conn_secure returning invalid state</title><link>https://devzone.nordicsemi.com/thread/172385?ContentTypeID=1</link><pubDate>Thu, 21 Feb 2019 19:56:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dfe5d97b-545f-44c8-812f-d6af91fef5af</guid><dc:creator>erinh</dc:creator><description>&lt;p&gt;procedure 0x0 (PM_LINK_SECURED_PROCEDURE_ENCRYPTION)&lt;/p&gt;
&lt;p&gt;error 0x1006&lt;/p&gt;
&lt;p&gt;error_src 0x0 (BLE_GAP_SEC_STATUS_SOURCE_LOCAL)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The device readily re-pairs with the next connection, but not in the first connection after deleting bond information.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peer manager - pm_conn_secure returning invalid state</title><link>https://devzone.nordicsemi.com/thread/172302?ContentTypeID=1</link><pubDate>Thu, 21 Feb 2019 13:16:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4832d7a0-0935-46e2-abe9-2cb38c056c29</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Are you able to see what&amp;nbsp;error code&amp;nbsp; the PM_EVT_CONN_SEC_FAILED event generates in the first place?&lt;/p&gt;
&lt;p&gt;NRF_ERROR_INVALID STATE&amp;nbsp;&amp;nbsp;returns from pm_conn_secure is explained in peer_manager.h as &amp;quot;If the Peer Manager is not initialized.&amp;quot; So you will have to reinitialize the peer manager if you are getting this return value.&amp;nbsp;&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>