<?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>I have a question about pairing control.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64915/i-have-a-question-about-pairing-control</link><description>Hi, I have a question about Bluetooth pairing control. 
 I use nrf52dk board and sdk v17. I am working on many things using the example of sdk. 
 Now I&amp;#39;m trying to control pairing using the button. I found two ways to stop pairing. 
 
 But I don&amp;#39;t know</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 20 Aug 2020 08:27:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64915/i-have-a-question-about-pairing-control" /><item><title>RE: I have a question about pairing control.</title><link>https://devzone.nordicsemi.com/thread/265483?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2020 08:27:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a8c0676-480a-4375-ad0d-60b4c8c26a4e</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;What are you doing in peer_manager_init()? Most examples in the SDK that use the peer manager already have a pm_sec_param_set() call in peer_manager_init() Which would make line 10 redundant. I would try calling the peer_manager_init() in start of main and remove both the pm_sec_params_set(NULL) call and the call in the init function if you have one. You could then only call pm_sec_params_set(&amp;amp;sec_param) in the BSP_EVENT_KEY_2. Notice that it&amp;#39;s not recommended to do too much in the interrupt handlers as it can interfere with other priority tasks.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user="schosdas"]I tried this, but I think I did something wrong.[/quote]
&lt;p&gt;&amp;nbsp;Elaborate more on this. Does the function call return any errors?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I have a question about pairing control.</title><link>https://devzone.nordicsemi.com/thread/265433?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2020 01:41:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:852d88f4-c56e-476c-bf6b-f5686d019b1c</guid><dc:creator>schosdas</dc:creator><description>&lt;div class="edit_box___1KtZ3 active___3VPGL" id="txtTarget"&gt;&lt;span&gt;Thank you for your answer.&amp;nbsp;&amp;nbsp;I&amp;#39;m sorry, but I&amp;#39;m not sure yet.&lt;/span&gt;&lt;/div&gt;
&lt;div class="edit_box___1KtZ3 active___3VPGL"&gt;&lt;span&gt;I think it&amp;#39;s a simple problem, but I&amp;#39;m sorry to keep asking you.&lt;/span&gt;&lt;/div&gt;
&lt;div class="edit_box___1KtZ3 active___3VPGL"&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="edit_box___1KtZ3 active___3VPGL"&gt;&lt;span&gt;I wrote it like this so I wouldn&amp;#39;t pair up at the beginning.&lt;/span&gt;&lt;/div&gt;
&lt;div class="edit_box___1KtZ3 active___3VPGL"&gt;&lt;span&gt;(For your information, I combined &amp;#39;ble_app_uart&amp;#39; and &amp;#39;peer_manager&amp;#39;.)&lt;/span&gt;&lt;/div&gt;
&lt;div class="edit_box___1KtZ3 active___3VPGL"&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="edit_box___1KtZ3 active___3VPGL"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;int main(void)
{
    uint32_t err_code;
    err_code = pm_sec_params_set(NULL);
    APP_ERROR_CHECK(err_code);
.
.
}
&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="edit_box___1KtZ3 active___3VPGL"&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="edit_box___1KtZ3 active___3VPGL"&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="edit_box___1KtZ3 active___3VPGL"&gt;&lt;span&gt;So it doesn&amp;#39;t pairing at first.&lt;/span&gt;&lt;/div&gt;
&lt;div class="edit_box___1KtZ3 active___3VPGL"&gt;&lt;span&gt;And this code enables pairing with button input.&lt;/span&gt;&lt;/div&gt;
&lt;div class="edit_box___1KtZ3 active___3VPGL"&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="edit_box___1KtZ3 active___3VPGL"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;void bsp_event_handler(bsp_event_t event)
{
    uint32_t err_code;
    switch (event)
    {
.
.
         case BSP_EVENT_KEY_2: //button3
            //peer_manager_init(); //Not doing nothing
            //err_code = pm_sec_params_set(&amp;amp;sec_param); //error
            //APP_ERROR_CHECK(err_code);
            break;
    }
}&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="edit_box___1KtZ3 active___3VPGL"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class="edit_box___1KtZ3 active___3VPGL"&gt;&lt;span&gt;I tried this, but I think I did something wrong.&lt;/span&gt;&lt;/div&gt;
&lt;div class="edit_box___1KtZ3 active___3VPGL"&gt;&lt;span&gt;What do I need to enter in the parameters for pm_sec_params_set()?&lt;/span&gt;&lt;/div&gt;
&lt;div class="edit_box___1KtZ3 active___3VPGL"&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I have a question about pairing control.</title><link>https://devzone.nordicsemi.com/thread/265339?ContentTypeID=1</link><pubDate>Wed, 19 Aug 2020 13:19:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14954a5a-a44f-477a-b375-75cdc362b08f</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can try calling&amp;nbsp;pm_sec_params_set() and passing the initial parameter that is used when first initializing the module.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote user=""][/quote]&lt;/p&gt;
&lt;div&gt;&lt;span&gt;And to start pairing with buttons, should I modify it at the button input of the function &amp;#39;bsp_evt_handler&amp;#39;?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Yes, I think this should work.&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>