<?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>Access without giving a passkey</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91953/access-without-giving-a-passkey</link><description>Hello, 
 This is a followup of an answered question: &amp;quot; How to get pairing/bonding to work in e.g. ble_app_uart&amp;quot;. 
 The project, ble_app_uart_pair is the ble_app_uart example with added the pairing/bonding stuff from the ble_app_gls example. It basically</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Sep 2022 14:01:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91953/access-without-giving-a-passkey" /><item><title>RE: Access without giving a passkey</title><link>https://devzone.nordicsemi.com/thread/386423?ContentTypeID=1</link><pubDate>Thu, 15 Sep 2022 14:01:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ac8d913-dd7a-4ce9-acba-ec2608a1698c</guid><dc:creator>Sietse</dc:creator><description>&lt;p&gt;Hello, it is working now!&lt;/p&gt;
&lt;p&gt;I, ad hoc, patched ble_nus_init() to use SEC_JUST_WORKS, with is enough for me.&lt;/p&gt;
&lt;p&gt;In the BLE_GAP_EVT_AUTH_STATUS case I did&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;             if (p_ble_evt-&amp;gt;evt.gap_evt.params.auth_status.auth_status == 0x89) {
               err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gattc_evt.conn_handle,
                                                BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
               APP_ERROR_CHECK(err_code);
             }
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the help, Sietse&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Access without giving a passkey</title><link>https://devzone.nordicsemi.com/thread/386368?ContentTypeID=1</link><pubDate>Thu, 15 Sep 2022 11:29:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3d5c1e1-02a6-4eb2-957b-c00d9e291b13</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sietse,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We would need to look at how you configure your characteristic and service read/write access.&lt;/p&gt;
&lt;p&gt;Note that by default BLE doesn&amp;#39;t have any mechanism to terminate a connection if the link is not bonded/encrypted. It&amp;#39;s up to the application to decide if it needs to terminate the connection due to lack of encryption/security level.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;However, in your service/characteristic you can configure the level of encryption needed to access the characteristic/service. You can find that in the configuration of&amp;nbsp;read_access and&amp;nbsp;write_access in&amp;nbsp;ble_nus_init() function.&amp;nbsp;&lt;br /&gt;By default they are&amp;nbsp;SEC_OPEN, but you can change to&amp;nbsp;SEC_JUST_WORKS or&amp;nbsp;SEC_MITM etc to limit the access if the link is not bonded. Please refer to the gls example.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In addition to that, if you want to terminate the connection if the link is not encrypted you can implement in your application code to check if the&amp;nbsp;BLE_GAP_EVT_AUTH_STATUS doesn&amp;#39;t return&amp;nbsp;BLE_GAP_SEC_STATUS_SUCCESS and you can terminate the connection using&amp;nbsp;sd_ble_gap_disconnect().&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Access without giving a passkey</title><link>https://devzone.nordicsemi.com/thread/386157?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 12:02:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fd41e45-1810-401c-8472-3ded069ef42e</guid><dc:creator>Sietse</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/807051.main.c"&gt;devzone.nordicsemi.com/.../807051.main.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>