<?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>Passkey security for particular services.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17278/passkey-security-for-particular-services</link><description>Hi, 
 I am Working on a BLE application in which I do not want to expose certain services until I am securely paired/bonded to a valid device. The problem is that during discovery, it seems that all primary services are exposed to the client in order</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Oct 2016 22:26:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17278/passkey-security-for-particular-services" /><item><title>RE: Passkey security for particular services.</title><link>https://devzone.nordicsemi.com/thread/66397?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2016 22:26:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ebbc2db-63e5-4fc1-aa2a-3847de754c32</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;To add to this, the Bluetooth spec mandates that all services, characteristics and descriptors should be discoverable. You are allowed to protect attributes from being read or written to, but not allowed to hide services. The idea is that a device should be able to connect with your device, perform a discovery, then decide if there is something interesting there. If not, it might disconnect before even attempting to pair or bond. To me, it sounds like you want to protect your service, using the macros written in the answer above. Having a &amp;quot;secret&amp;quot; service that pops out after certain criteria is met will lead to much work if you want to stay compliant to the Bluetooth specification. Namely by forcing any device that connects to rediscover your whole database every time, and again after encryption.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Passkey security for particular services.</title><link>https://devzone.nordicsemi.com/thread/66396?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2016 11:50:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3594045f-7b43-4752-b346-c68825f2ed24</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Do you need the services to be completely hidden or is it sufficien that the values are non-readable? If you need the services to not show at all, you can add the services after bonding. Remember to indicate a service change to the connected device by calling &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/group___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html#ga2c8c90d73fa27ba6691ad82b4a960adc"&gt;&lt;code&gt;sd_ble_gatts_service_changed()&lt;/code&gt;&lt;/a&gt;. Notice that you are not allowed to remove services from the GATT table. If the device is disconnected a &lt;a href="https://devzone.nordicsemi.com/question/97828/removing-gatt-services/?answer=97926#post-id-97926"&gt;reinitialization of the softdevice&lt;/a&gt; will be required to remove the services.&lt;/p&gt;
&lt;p&gt;You can set attribute security parameters using &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/group___b_l_e___g_a_p___c_o_n_n___s_e_c___m_o_d_e___s_e_t___m_a_c_r_o_s.html#ga9130b57af7649cba1702b99e1594736c"&gt;&lt;code&gt;BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM()&lt;/code&gt;&lt;/a&gt; to require pairing using passkey for accessing the attributes. Notice that the service and its characteristics will still be visible in the GATT table. They will however not be read or writable until after bonding.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>