<?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>Modifying NUS - Make it bond with smart phones</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7987/modifying-nus---make-it-bond-with-smart-phones</link><description>Hi, I use the NUS most of the time. 
 (SDK 7.2 &amp;amp; S110 7.1 with IAR 7.1) 
 As you know, HID keyboard or mouse bond with centrals (smart phones). 
 After bonding, when using iOS devices for example, the bonded devices&amp;#39; information are left. 
 Just like</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Feb 2016 14:55:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7987/modifying-nus---make-it-bond-with-smart-phones" /><item><title>RE: Modifying NUS - Make it bond with smart phones</title><link>https://devzone.nordicsemi.com/thread/28613?ContentTypeID=1</link><pubDate>Fri, 26 Feb 2016 14:55:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84118222-3e7d-4f69-a02b-625a23096d26</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;About BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(&amp;amp;cccd_md.read_perm);&lt;br /&gt;
If I remember correctly CCCD read permission has to be open.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifying NUS - Make it bond with smart phones</title><link>https://devzone.nordicsemi.com/thread/28612?ContentTypeID=1</link><pubDate>Wed, 24 Feb 2016 08:11:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7a41f97-639f-462e-a77e-c3720543aa2b</guid><dc:creator>MANGO</dc:creator><description>&lt;p&gt;@Hung Bui, about changing the &lt;code&gt;BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM&lt;/code&gt; option,&lt;/p&gt;
&lt;p&gt;should I apply&lt;code&gt;BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM&lt;/code&gt; to other services?&lt;/p&gt;
&lt;p&gt;For instance, I&amp;#39;m planning to use BAS or DIS with NUS.&lt;/p&gt;
&lt;p&gt;Applying&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(&amp;amp;bas_init_obj.battery_level_char_attr_md.cccd_write_perm);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(&amp;amp;dis_init_obj.dis_attr_md.read_perm);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;will do the work?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;// Edited (Feb, 25, 2016)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I took a &lt;a href="https://devzone.nordicsemi.com/question/57764/add-nus-service-with-bond/"&gt;reference&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;At &lt;code&gt;ble_nus.h&lt;/code&gt;. I made some changes (check my question script.)&lt;/p&gt;
&lt;p&gt;However, &lt;code&gt;rx_char_add&lt;/code&gt; returns &lt;code&gt;NRF_ERROR_INVALID_PARAM&lt;/code&gt; (number 7).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifying NUS - Make it bond with smart phones</title><link>https://devzone.nordicsemi.com/thread/28611?ContentTypeID=1</link><pubDate>Wed, 24 Feb 2016 08:02:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3da8afb4-1df2-4bde-82d6-b54a27dcf15c</guid><dc:creator>MANGO</dc:creator><description>&lt;p&gt;Hi Hung Bui, I asked this question quite a long time ago. I&amp;#39;m trying this now.&lt;/p&gt;
&lt;p&gt;About &lt;code&gt;iOS/Android system won&amp;#39;t show your device and bond to your device if they are not HID device. You would need to have an app for that&lt;/code&gt;,&lt;/p&gt;
&lt;p&gt;you mean that, even though I change the code, NUS cannot be bonded without using a custom app for the NUS?&lt;/p&gt;
&lt;p&gt;For instance, suppose I changed the code to make the NUS bond.&lt;/p&gt;
&lt;p&gt;Since the nRF UART 2.0 App is available, the app will discover and connect (bond) with this peripheral.&lt;/p&gt;
&lt;p&gt;However, after disconnecting it, do you mean that this peripheral cannot be connected automatically without the app?&lt;/p&gt;
&lt;p&gt;As you know, HID device bonds to the central (phones) directly without choosing them from the settings tab, if they had exchanged their IRK.&lt;/p&gt;
&lt;p&gt;Even though I change the code from the NUS example, this &amp;quot;auto connection&amp;quot; won&amp;#39;t work?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifying NUS - Make it bond with smart phones</title><link>https://devzone.nordicsemi.com/thread/28609?ContentTypeID=1</link><pubDate>Tue, 07 Jul 2015 09:48:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a572f13-3177-4bf0-9ae4-e607e017ed0b</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Yes, I meant &amp;quot;not HID&amp;quot;.  On Android, they changed that from time to time, and also depends on the manufacturing vendors. As far as I remember Samsung device won&amp;#39;t show it if it&amp;#39;s not HID or bonded. But maybe in the newer version 5.1.1 they may have it.&lt;/p&gt;
&lt;p&gt;So it&amp;#39;s not guaranted that your device will always show up in the Bluetooth setting if it&amp;#39;s not bonded.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifying NUS - Make it bond with smart phones</title><link>https://devzone.nordicsemi.com/thread/28610?ContentTypeID=1</link><pubDate>Mon, 06 Jul 2015 10:02:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6814cf25-5def-432d-aa18-cf491f0f0735</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Mango:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Pair means encrypt the link, and bond is storing the key so next time the link can be re-encrypted.
If the device is not bonded, you won&amp;#39;t see it in the Bluetooth setting.
NUS by default doesn&amp;#39;t require bonding so there will be no bond by default. On the other hand, HID keyboard requires bonding, so that explains what you observed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Yes you can modify NUS to require bonding. To do that in the service declaration in the nRF51 firmware, instead of using BLE_GAP_CONN_SEC_MODE_SET_OPEN you should use BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM or other option depend on which type of bonding you want (Just work, Passkey, etc)&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Note that the iOS/Android system won&amp;#39;t show your device and bond to your device if they are not HID device. You would need to have an app for that. For the NUS we have the nRF UART app.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>