<?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>BLE connection with pin code</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72560/ble-connection-with-pin-code</link><description>Hi, 
 
 I&amp;#39;m using NRF52840 in order to connect to a mobile device, with PIN code. 
 Connection to Android is ok. The issue is with IOS. 
 IOS can&amp;#39;t send the PIN code to my device, I understand that NRF device should transmit it&amp;#39;s services so IOS will</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 Mar 2021 11:12:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72560/ble-connection-with-pin-code" /><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/301395?ContentTypeID=1</link><pubDate>Tue, 23 Mar 2021 11:12:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c123fd77-c787-488a-b9c8-e9a5bf6bca56</guid><dc:creator>Roei</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Issue is resolved. The problem was that physical layer update event handler was under #ifdef, so that code was disabled. After removing #ifdef - everything works.&lt;/p&gt;
&lt;p&gt;Thanks for your support!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/301391?ContentTypeID=1</link><pubDate>Tue, 23 Mar 2021 10:58:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6569dcb-204c-4d7c-90c5-eac1cbebaaac</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Didn&amp;#39;t you already say (in original post) that this works with android? strange thing is I though android also waited for insufficient authentication before pairing. But that could vary from implementation to implementation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/301389?ContentTypeID=1</link><pubDate>Tue, 23 Mar 2021 10:56:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d40ef8d-8aba-423f-8d4e-9f8f632c127a</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;You should check that the phone is not able to update the cccd handle, nor read nor write to the characteristics without pairing. Prior to pairing the gatt server should reply with att error insufficient authentication.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/301388?ContentTypeID=1</link><pubDate>Tue, 23 Mar 2021 10:54:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e7d74d2-1f6a-4958-8c96-0bb0546e6b15</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Nus service is enough as long as you have configured the security settings correctly. Maybe you could add your settings her?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/300597?ContentTypeID=1</link><pubDate>Thu, 18 Mar 2021 08:45:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fec1298-9c01-46a9-8e08-a571cebd11da</guid><dc:creator>Roei</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried to change to SEC_MITM and added pin code to the example by using&amp;nbsp;sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, ...). Still doesn&amp;#39;t initiate secured connection with passkey, only regular connection (via NRF connect).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can you please help me?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/300501?ContentTypeID=1</link><pubDate>Wed, 17 Mar 2021 16:31:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7da7710b-a908-4bcb-b53c-7d05781766f3</guid><dc:creator>Roei</dc:creator><description>&lt;p&gt;In addition - should I add any special service to my application, in order to make it work? I&amp;#39;m using only device information service and NUS service. Is that enough?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/300491?ContentTypeID=1</link><pubDate>Wed, 17 Mar 2021 15:50:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f64d80b-ee50-4f22-a253-d3dc5cb8b1e3</guid><dc:creator>Roei</dc:creator><description>&lt;p&gt;I will try.&lt;/p&gt;
&lt;p&gt;What do I expect to see with the sniffer?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/300441?ContentTypeID=1</link><pubDate>Wed, 17 Mar 2021 13:59:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:387cb503-374d-40c0-89f9-c65885d2afb3</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Can you capture a sniffer trace of the on air traffic, to see if pairing is triggered?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/300426?ContentTypeID=1</link><pubDate>Wed, 17 Mar 2021 13:19:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b17dcd86-70e4-48b1-b9e3-71a8759005e2</guid><dc:creator>Roei</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve already done that with Rx and Tx characteristics - still doesn&amp;#39;t work. I&amp;#39;m using&amp;nbsp;&amp;nbsp;BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM to protect write and read permissions.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Any other ideas?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/300415?ContentTypeID=1</link><pubDate>Wed, 17 Mar 2021 12:59:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bde21d1-18e8-41e4-9ef1-7bb201a1fc39</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The &amp;quot;insufficient authentication&amp;quot; error will be sent automatically by the Softdevice if the peer tries to read/write a characteristic that is configured to require a higher security level. So you need to configure the security level for the characteristic you want to &amp;quot; protect&amp;quot; by requiring pairing and entering a pin.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;From the heart rate example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    // Here the sec level for the Heart Rate Service can be changed/increased.
    hrs_init.hrm_cccd_wr_sec = SEC_JUST_WORKS;
    hrs_init.bsl_rd_sec      = SEC_JUST_WORKS;

    err_code = ble_hrs_init(&amp;amp;m_hrs, &amp;amp;hrs_init);
    APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Notice that the required security level is just works in this case. You should probably require SEC_MITM since you are using a PIN.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/300053?ContentTypeID=1</link><pubDate>Tue, 16 Mar 2021 10:02:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48a0250b-d20b-4c36-8200-381b8954a340</guid><dc:creator>Roei</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Any news? I&amp;#39;m still having&amp;nbsp;those issues.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/299233?ContentTypeID=1</link><pubDate>Thu, 11 Mar 2021 12:16:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:558acc0e-0d95-4d80-8c25-f1e87e12bfa7</guid><dc:creator>Roei</dc:creator><description>&lt;p&gt;In addition - I couldn&amp;#39;t find any&amp;nbsp;&lt;span&gt;insufficient&amp;nbsp;authentication error in heart rate example. Can you please help me?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/299224?ContentTypeID=1</link><pubDate>Thu, 11 Mar 2021 11:43:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37af9fd8-0153-464f-b618-835507fd4575</guid><dc:creator>Roei</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for your help!&lt;/p&gt;
&lt;p&gt;Right now, I&amp;#39;m using&amp;nbsp;sd_ble_gatts_characteristic_add(), in order to add RX,&amp;nbsp;TX and device information service. Read and write permissions are&amp;nbsp;BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM.&lt;/p&gt;
&lt;p&gt;Is that good enough? Do I need to add more characteristics with another security level, in order to make the IOS trying to read and initiate pairing process?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/299204?ContentTypeID=1</link><pubDate>Thu, 11 Mar 2021 10:14:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db052658-829d-445d-bf95-c139d682ed7c</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you look at the heart rate example in the sdk. this will send and incufficient authentication error to the phone once the iPhone tries to write to the cccd of the heart rate characteristic. this causes the iphone to start the pairing process.&lt;/p&gt;
&lt;p&gt;So the phone will need to try to write to a characteristic in one of the peripherals services. So configure security on the peripheral. For details on how to configure the characteristics please take a look at our tutorial section here: &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy"&gt;https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/299069?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 15:07:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d5e0f46-9a84-42b3-88f8-e1e5093b2785</guid><dc:creator>Roei</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for your response!&lt;/p&gt;
&lt;p&gt;Who should try to read/write to a characteristic with higher security level? The mobile?&lt;/p&gt;
&lt;p&gt;Where should I enable notification or increase security level? On NRF device side or mobile side?&lt;/p&gt;
&lt;p&gt;Can you please give me an example?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/299056?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 14:44:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7767458-c5a5-4bb0-9317-b9253a333bbb</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;iOS will wait with pairing until you try to read/write to a characteristic that requires a higher security level. Did you try to enable notification for one of the characteristics? If that does not trigger pairing it means you need to increase the security level for your characteristics.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection with pin code</title><link>https://devzone.nordicsemi.com/thread/298969?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 11:35:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4492e5e7-67d7-4008-9334-06fc7e7177f5</guid><dc:creator>Roei</dc:creator><description>&lt;p&gt;I will give some more details.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When start advertising via nrf device and trying to connect via nrf connect app - I have the pin code window on my android mobile, but not on my IOS mobile. I understand that in IOS it&amp;#39;s different, as I need to transmit my services in order to make it happen in IOS.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Am I right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>