<?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>How to get passkey on  bluetooth terminal.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98970/how-to-get-passkey-on-bluetooth-terminal</link><description>Hello, 
 I have a question regarding BLE connection with passkey. 
 In my sample, I have implemented passkey and it is working fine 
 When starting connection and pairing process, a passkey can display on my bluetooth settings .So ,My question is how</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 Apr 2023 12:18:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98970/how-to-get-passkey-on-bluetooth-terminal" /><item><title>RE: How to get passkey on  bluetooth terminal.</title><link>https://devzone.nordicsemi.com/thread/422509?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2023 12:18:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56bcd93d-c0f8-4d23-9c93-a412eaa8e0cf</guid><dc:creator>Sachin Rawat</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/hungbui"&gt;Hung Bui&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your help in this, that course help us in adding the passkey feature.&lt;/p&gt;
&lt;p&gt;I appreciate your effort and time.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sachin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get passkey on  bluetooth terminal.</title><link>https://devzone.nordicsemi.com/thread/422266?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2023 11:28:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3299c263-be9b-4d5d-b9fc-9241aaca81f9</guid><dc:creator>Sachin Rawat</dc:creator><description>[quote userid="2121" url="~/f/nordic-q-a/98970/how-to-get-passkey-on-bluetooth-terminal/422179"]So your questions is how to pair when you are in the &amp;quot;&lt;span&gt;Serial bluetooth Terminal&amp;quot; and it doesn&amp;#39;t matter if it the OS (operating system - Android) displays it or your app displays it ?&amp;nbsp;&lt;/span&gt;[/quote]
&lt;p&gt;Correct, now you are going as what I am trying make you understand&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/98970/how-to-get-passkey-on-bluetooth-terminal/422179"]Please correct me if I&amp;#39;m wrong, the situation here is that in&amp;nbsp;your app you can&amp;#39;t pair and you don&amp;#39;t see the pairing pop up appear ?&amp;nbsp;[/quote]
&lt;p&gt;Yup, I don&amp;#39;t see the pairing request in the app (But I can see it in the Android_setting-&amp;gt;Bluetooth_setting)&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/98970/how-to-get-passkey-on-bluetooth-terminal/422179"]My suggestion is to go through our Bluetooth Academy course.[/quote]
&lt;p&gt;Thanks, I am working accordingly, I will bother you again when stuck somewhere.&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get passkey on  bluetooth terminal.</title><link>https://devzone.nordicsemi.com/thread/422179?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2023 06:54:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cacde6ba-b159-4ef4-a926-fc6fc3c1c0ee</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sachin,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So your questions is how to pair when you are in the &amp;quot;&lt;span&gt;Serial bluetooth Terminal&amp;quot; and it doesn&amp;#39;t matter if it the OS (operating system - Android) displays it or your app displays it ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please correct me if I&amp;#39;m wrong, the situation here is that in&amp;nbsp;your app you can&amp;#39;t pair and you don&amp;#39;t see the pairing pop up appear ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;To be able to trigger the phone to pair with your device you would need to read/write a characteristic that requires encryption/pairing.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My suggestion is to go through our Bluetooth Academy course. By going through the course you would be able to know how to set up a characteristic that requires encryption/pairing. And how in your app you can trigger the pairing.&amp;nbsp;&lt;br /&gt;Please take a look at the course &lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/"&gt;here&lt;/a&gt;. The security part is at chapter 5.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get passkey on  bluetooth terminal.</title><link>https://devzone.nordicsemi.com/thread/422158?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2023 04:04:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0e310f1-24fa-4e69-a173-8b006471d9ca</guid><dc:creator>Sachin Rawat</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/hungbui"&gt;Hung Bui&lt;/a&gt;&amp;nbsp;&lt;br /&gt;I am abhay&amp;#39;s co-member and ansering in behalf of him.&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/98970/how-to-get-passkey-on-bluetooth-terminal/422051"]No, the popup has to be shown by OS. But I don&amp;#39;t see a problem with that, most of the BLE application has that behavior.[/quote]
&lt;p&gt;OS = Android?&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/98970/how-to-get-passkey-on-bluetooth-terminal/422051"]You click pair from the app and then a popup by OS appears and you type the code in. [/quote]
&lt;p&gt;Yes, basically I want this, that a popup will appear from the android side to fill the passkey. &amp;lt;-- How to do this?&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/98970/how-to-get-passkey-on-bluetooth-terminal/422051"]&lt;p&gt;My suggestion is to study the blog I pointed to. The code implemented in the blog was for nRF5 SDK. But you can refer to it and use in nRF Connect.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;I did it, but I don&amp;#39;t think so this gigantic knowledge is helpful for us in displaying popup thing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get passkey on  bluetooth terminal.</title><link>https://devzone.nordicsemi.com/thread/422051?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2023 12:52:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b3b1529-a605-4e69-91bb-262e7b334ccf</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Abhay,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="abhay_keyss"]Can&amp;#39;t I get the popup for pairing request in the app? even if it supports pairing?[/quote]
&lt;p&gt;No, the popup has to be shown by OS. But I don&amp;#39;t see a problem with that, most of the BLE application has that behavior. You click pair from the app and then a popup by OS appears and you type the code in. I think it will bring you a lot of work if you want to do encryption in the application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user="abhay_keyss"]&lt;p&gt;how&amp;nbsp; to implement&amp;nbsp; it.&amp;nbsp; I didn&amp;#39;t know.&lt;/p&gt;
&lt;p&gt;Please suggest any code or sample regarding this problem&lt;/p&gt;[/quote]
&lt;p&gt;We don&amp;#39;t have an example that does exactly what you need.&amp;nbsp;&lt;br /&gt;My suggestion is to study the blog I pointed to. The code implemented in the blog was for nRF5 SDK. But you can refer to it and use in nRF Connect.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regarding encryption, you would need to choose a way to encrypt the communication. We have some examples &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/crypto.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/crypto.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get passkey on  bluetooth terminal.</title><link>https://devzone.nordicsemi.com/thread/422044?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2023 12:33:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ce29556-5fd9-44ac-82e3-b5ef92a19507</guid><dc:creator>abhay_kr</dc:creator><description>[quote userid="2121" url="~/f/nordic-q-a/98970/how-to-get-passkey-on-bluetooth-terminal/422037"]My suggestion is to do your own encryption and authentication. So basically you will do open connection (or if you want you can do Just work) and then do encryption on the application. You can have a look at this blog:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/simple-application-level-authentication" data-contentid="bcaab976e47a4337b6ea7247653d9240" data-contenttypeid="f7d226abd59f475c9d224a79e3f0ec07" class="ui-contentpeek internal-link"&gt;Simple Application-level Authentication&lt;/a&gt;&amp;nbsp;[/quote]
&lt;p&gt;how&amp;nbsp; to implement&amp;nbsp; it.&amp;nbsp; I didn&amp;#39;t know.&lt;/p&gt;
&lt;p&gt;Please suggest any code or sample regarding this problem&lt;/p&gt;
&lt;p&gt;Can&amp;#39;t I get the popup for pairing request in the app? even if it supports pairing?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note: I am a beginner in zypher os&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get passkey on  bluetooth terminal.</title><link>https://devzone.nordicsemi.com/thread/422037?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2023 12:15:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8207dcb5-410e-4d94-884a-bb0f9f0c8ee6</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Abhay,&lt;/p&gt;
&lt;p&gt;If you do passkey pairing, the popup window from Bluetooth Setting in Android/iOS is unavoidable. It&amp;#39;s not allowed for the app to handle it. It&amp;#39;s how it works with Android and iOS. So all the pairing is going through the OS not the app.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My suggestion is to do your own encryption and authentication. So basically you will do open connection (or if you want you can do Just work) and then do encryption on the application. You can have a look at this blog:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/simple-application-level-authentication"&gt;Simple Application-level Authentication&lt;/a&gt;&amp;nbsp;&lt;br /&gt;It cover the authentication part, you can implement encryption on top of that.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;By the way, please note that doing static passkey is strongly not recommended, especially with LESC. It just need a few retrys (only maximum&amp;nbsp;20 times) to crack that.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get passkey on  bluetooth terminal.</title><link>https://devzone.nordicsemi.com/thread/422022?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2023 11:38:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c6a2923-75d8-4952-afb6-b67b4c6e0479</guid><dc:creator>abhay_kr</dc:creator><description>[quote userid="2121" url="~/f/nordic-q-a/98970/how-to-get-passkey-on-bluetooth-terminal/422012"]When you do passkey pairing, which device is the device that display the passkey, was it on the nRF53 or it&amp;#39;s on the phone ?[/quote]
&lt;p&gt;I have 2 devices, one is the thingy53 and other is the mobile(having an app names as &amp;quot;Bluetooth serial terminal&amp;quot;)..The passkey will be pre-known and already statically set in the thingy53.&amp;nbsp;&lt;br /&gt;I want that whenever a user uses the &amp;quot;serial terminal&amp;quot; app to connect to the thingy53, a popup should be shown, which says to enter the passkey in the app itself. As soon as the user enter that static passkey, board will connect to the app else will disconnect automatically.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Paskey request will be shown on the &amp;quot;Bluetooth serial terminal&amp;quot; app or if any app will try to connect to board, it will be prompted for providing passkey.&lt;/strong&gt;&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/98970/how-to-get-passkey-on-bluetooth-terminal/422012"]You mentioned that &amp;quot;&lt;span&gt;I have implemented&amp;nbsp; passkey and it is working fine&amp;quot;, so what is the change you want to implement here ?&amp;nbsp;&lt;/span&gt;[/quote]
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;I have added a passkey callback with this function&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;bt_conn_auth_cb_register(&amp;amp;auth_cb_display);&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; unsigned int passkey=123456;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; err = bt_passkey_set(passkey);&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; if (err) { &lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printk(&amp;quot;set passkey (err %d)\n&amp;quot;, err);&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="text"&gt;static struct bt_conn_auth_cb auth_cb_display = {
	 .passkey_display = auth_passkey_display,
	 .passkey_entry = NULL,
	  .cancel = auth_cancel,
	.pairing_confirm = pairing_confirm,
	.pairing_complete = pairing_complete,
    .pairing_failed = pairing_failed,
	.pairing_accept= pairing_accept,
	
};&lt;/pre&gt;&lt;br /&gt;&lt;/strong&gt;and provided a fixed passskey. Now when I tried to connect to the board from the android bluetooth setting, it asks for passkey, but I not in the case with the app, it simply connect to it.&lt;/div&gt;
&lt;div&gt;[quote userid="2121" url="~/f/nordic-q-a/98970/how-to-get-passkey-on-bluetooth-terminal/422012"]Do you want to display the passkey in your app and then the end user can look at your app to get the key and then enter it into the Bluetooth pairing pop up on the phone?[/quote]No, I already explained this, the passkey is pre-set in the board, the end user will have to enter it, only and only then he will be allowed to connect to board.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;NOTE:- Please answer max. question in every reply, so that the issue will be resolved in minimum days.&lt;/strong&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get passkey on  bluetooth terminal.</title><link>https://devzone.nordicsemi.com/thread/422012?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2023 11:18:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e25d62f-6f98-4237-bac1-3893e76ec7c1</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Abhay,&amp;nbsp;&lt;br /&gt;I&amp;#39;m sorry that I don&amp;#39;t fully understand what you want to achieve here.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When you do passkey pairing, which device is the device that display the passkey, was it on the nRF53 or it&amp;#39;s on the phone ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;You mentioned that &amp;quot;&lt;span&gt;I have implemented&amp;nbsp; passkey and it is working fine&amp;quot;, so what is the change you want to implement here ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Do you want to display the passkey in your app and then the end user can look at your app to get the key and then enter it into the Bluetooth pairing pop up on the phone?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s possible to do that by modifying your app to send the passkey via BLE to the phone and display that on the phone. However, this remove the advantage of the passkey pairing that the passkey is display in another mean than using BLE. If you do this, an attacker with a sniffer can catch the passkey and can decrypt your encryption. And also it won&amp;#39;t be able to give you Man in the middle (MITM) protection as you can&amp;#39;t be sure the device you talk to is the device you are looking at.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get passkey on  bluetooth terminal.</title><link>https://devzone.nordicsemi.com/thread/421929?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2023 06:45:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df0fd418-db0b-49b2-8eeb-5aeb54074fa7</guid><dc:creator>abhay_kr</dc:creator><description>&lt;p&gt;&lt;span&gt;Could anybody give a response ! Thankyou&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>