<?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>Bonding Troubles</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/116580/bonding-troubles</link><description>I&amp;#39;ve been working for months to try and figure out exactly how to get my application to bond the way I want it to. 
 I&amp;#39;m using nrf connect sdk 2.4.2 on an nrf52832. I used the nordic uart service peripheral project as a base. The uart service works great</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Nov 2024 14:44:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/116580/bonding-troubles" /><item><title>RE: Bonding Troubles</title><link>https://devzone.nordicsemi.com/thread/511696?ContentTypeID=1</link><pubDate>Fri, 22 Nov 2024 14:44:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fea1d82f-d9f1-4c50-b99e-d2eb30f228bc</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi jnenick,&lt;/p&gt;
&lt;p&gt;Firstly, let me address each of your requirement.&lt;/p&gt;
[quote user=""]Only permit usage of application characteristics (TX and RX) when bonded with the connected phone[/quote]
&lt;p&gt;You need to add security requirement to the characteristic.&amp;nbsp;The NUS supports Authentication requirement by&amp;nbsp;enabling&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.8.0/page/kconfig/index.html#CONFIG_BT_NUS_AUTHEN"&gt;CONFIG_BT_NUS_AUTHEN&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you need other level of security&amp;nbsp;requirement, you will need to run your own custom BLE service. We&amp;nbsp;have instructions to do that in our &lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/"&gt;BLE Fundamentals online course&lt;/a&gt;.&lt;/p&gt;
[quote user=""]Only permit bonding when a user presses a button on the device[/quote]
&lt;p&gt;Does the device also support a display that can display a 6-digit number?&lt;/p&gt;
&lt;p&gt;If yes, and the bonding peer is a mobile device, then you can support pairing with keys.&lt;/p&gt;
&lt;p&gt;If not, I am afraid&amp;nbsp;the only solution is to use Just Works pairing. The device only allows pairing/bonding&amp;nbsp;in a specific state that is entered via the button. This state could be entered after a button pressed, or only when the button is held; and it could be exited by timeout, or via another button press.&lt;/p&gt;
&lt;p&gt;For more information, please refer to Bluetooth specification, Vol 3, Part H, section 2.3. You can also refer to the online lesson I linked above for an overview.&lt;/p&gt;
[quote user=""]When bonding is started do not present a passcode dialog to the user on the phone[/quote]
&lt;p&gt;After a bond is formed, future pairing will not require passkey entry.&lt;/p&gt;
[quote user=""]The uart service works great but I&amp;#39;m having a great amount of difficulty adding any measure of security to the project.[/quote]
&lt;p&gt;The Peripheral UART sample supports adding security via the sample specific Kconfig &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.8.0/samples/bluetooth/peripheral_uart/Kconfig#L23"&gt;CONFIG_BT_NUS_SECURITY_ENABLED&lt;/a&gt;. You can try this first.&lt;/p&gt;
&lt;p&gt;Otherwise, the online course I linked have an extensive step by step guide to implement security into an application.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>