<?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>Implement access levels in BLE characteristics</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118006/implement-access-levels-in-ble-characteristics</link><description>Hi, 
 I have a BLE interface with services and characteristics and I want to have different level accesses for my characteristics with for example two levels: 
 
 level user: I can only read the characteristics 
 level technician: I can read and write</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 16 Jan 2025 22:55:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118006/implement-access-levels-in-ble-characteristics" /><item><title>RE: Implement access levels in BLE characteristics</title><link>https://devzone.nordicsemi.com/thread/518740?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2025 22:55:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80977c9b-aa18-401f-974c-46986615d152</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;To implement your own characteristic I suggest you go through the &lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/"&gt;Bluetooth Low Energy Fundamentals&lt;/a&gt; course in the Nordic DevAcademy.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have any roadmap details, but I doubt that implementing this service is something that will come from us any time soon. Although I don&amp;#39;t think there is anything magic about this service in particular, other than that it may be used by other devices as well, since it has a dedicated UUID. You would still need to handle it&amp;#39;s behavior in your application.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As I see it, you have two options:&lt;/p&gt;
&lt;p&gt;1: Go through with pairing/bonding only the technician. The rest can have an unencrypted connection, and these limitations will then not allow them to write to the characteristics that you specify.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2: Implement some custom service characteristic with a &amp;quot;password&amp;quot;. Then, only if the user have entered the correct password, the device will stop ignoring what is written to the characteristic.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For 2: Do note that if they are unencrypted, then someone can pick up the password by sniffing the packets over the air.&lt;/p&gt;
&lt;p&gt;What I mean by &amp;quot;ignoring&amp;quot; is something like:&lt;/p&gt;
&lt;p&gt;Everyone can read characteristic Service 1 characteristic A (1A). But only the ones who have written the correct password to Serivce 2 Characteristic A (2A) can successfully write to Service 1 characteristic B (1B). If anyone else tries to write to 1B, it will be ignored. If the technician has done it, your application will copy the content of 1B to 1A, so that everyone can read it.&lt;/p&gt;
&lt;p&gt;Noone can read characteristic 1B. It is a write only characteristic.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implement access levels in BLE characteristics</title><link>https://devzone.nordicsemi.com/thread/518578?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2025 09:28:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa6046a0-b768-4ad6-82eb-4829d87a405a</guid><dc:creator>Beldramma</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/edvin-holmseth"&gt;Edvin&lt;/a&gt; ,&lt;/p&gt;
&lt;p&gt;Is it planned to implement this service ?&lt;/p&gt;
&lt;p&gt;Where can I find the list of all implemented BLE services ?&lt;/p&gt;
&lt;p&gt;Is it possible to implement it on my own ? (Not sure I will do it though)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implement access levels in BLE characteristics</title><link>https://devzone.nordicsemi.com/thread/518404?ContentTypeID=1</link><pubDate>Wed, 15 Jan 2025 09:53:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f86176c8-ddc6-450b-a546-e28c3e2bfad8</guid><dc:creator>Beldramma</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/edvin-holmseth"&gt;Edvin&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;These different access levels are not implemented on our side for the moment, our current product protects all characteristics through LE Secure Connection.&lt;/p&gt;
&lt;p&gt;What we want is that after this step, not all people can for example write the characteristics. The idea can be to enter another password in order to have the possibility to write a characteristic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implement access levels in BLE characteristics</title><link>https://devzone.nordicsemi.com/thread/518373?ContentTypeID=1</link><pubDate>Wed, 15 Jan 2025 07:39:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:785a33f8-d804-4bed-b62d-bcd7feefabfd</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Looks like me and Einar replied at the same time.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think we have an implementation for this particular service.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So what is the flow when a technician connects and pairs/bonds with the device? How do you prevent a normal user from using LESC? Does the technician input some sort of passkey when pairing?&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implement access levels in BLE characteristics</title><link>https://devzone.nordicsemi.com/thread/518285?ContentTypeID=1</link><pubDate>Tue, 14 Jan 2025 15:33:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8dd6420-4879-46df-bdfe-79e323ae1102</guid><dc:creator>Beldramma</dc:creator><description>&lt;p&gt;Hi Einar, Edvin,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;thanks for the quick answers.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;&amp;nbsp;I already know these security levels and I use them (Le secure connections). In my case, I don&amp;#39;t want just anyone to be able to access the charact&amp;eacute;ristics so all characteristics are protected with pairing through a password, it is after this step that I want to have these differrent access levels.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/edvin-holmseth"&gt;Edvin&lt;/a&gt;, in what you talk about, is it possible to have what I was talking to Einar ?&lt;/p&gt;
&lt;p&gt;To implement these access levels, I have began to look at Bluetooth-SIG &lt;a href="https://www.bluetooth.com/specifications/specs/authorization-control-service-1-0/"&gt;Authorization Control Service (ACS)&lt;/a&gt;, which seems to permit that.&lt;/p&gt;
&lt;p&gt;Do you know this service ?DO you have any information on it ? Someone at Nordic told me that this service is not implemented for the moment in NRF Connect SDK, can you confirm that ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implement access levels in BLE characteristics</title><link>https://devzone.nordicsemi.com/thread/518260?ContentTypeID=1</link><pubDate>Tue, 14 Jan 2025 14:19:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2404faae-9bd0-4b13-a8f1-18d4efb0e0ff</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;If you look at the implementation of the Nordic UART Service (NUS), found in ncs\nrf\subsys\bluetooth\services\nus.c, you can look at how the service and characteristics are set up, starting with the line &amp;quot;BT_GATT_SERVICE_DEFINE(...)&amp;quot;&lt;/p&gt;
&lt;p&gt;This sample has a config to set up authentication (which will require encryption), so see how it sets e.g. either BT_GATT_PERM_WRITE or BT_GATT_PERM_WRITE_AUTHEN, depending on whether CONFIG_BT_NUS_AUTHEN is defined or not.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can look up all the different levels of encryption in ncs\zephyr\include\bluetooth\gatt.h, in the bt_gatt_perm enum.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So in your case, you would set&amp;nbsp;BT_GATT_PERM_READ for all characteristics that the user should be able to access, and then you set e.g.&amp;nbsp;BT_GATT_PERM_WRITE_ENCRYPT or&amp;nbsp;BT_GATT_PERM_WRITE_AUTHEN on the characteristics that only the technician should be able to write to. (or any of the other WRITE values, depending on the level of security used in the pairing/bonding process.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BT_GATT_PERM_WRITE: Everyone can write&lt;/p&gt;
&lt;p&gt;BT_GATT_PERM_WRITE_ENCRYPT: You need to be encrypted using just works encryption or better (meaning the keys are just sent over the air)&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;BT_GATT_PERM_WRITE_AUTHEN: You need to be encrypted using a key (e.g. a 6-digit numerical pin).&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;BT_GATT_PERM_WRITE_LESC: You need to use LE SECURE Connection to write to the characteristic.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implement access levels in BLE characteristics</title><link>https://devzone.nordicsemi.com/thread/518256?ContentTypeID=1</link><pubDate>Tue, 14 Jan 2025 14:13:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e7aa7b9-e629-497c-b115-b6967f47a14e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There i no concept of users in Bluetooth LE. However, there is a conecpt of security levels (see &lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-5-bluetooth-le-security-fundamentals/topic/security-models/"&gt;dev academy&lt;/a&gt;), and you can requier a different security level fro reading and writing (for instance allow anyone to read, but only allow paired/bonded devicec above a certain threshold to write to a characteristic. Could that be used in your case?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>