<?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>GATTS Characteristic without &amp;quot;read&amp;quot; properties can be read</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72302/gatts-characteristic-without-read-properties-can-be-read</link><description>Hi 
 I did some experiments with the GATT capabilities of the S140 7.2.0 softdevice. An experiment that I did showed a behavior that is not as I would expect it. 
 Steps to reproduce: 
 1) Create a peripheral project based on the S140 7.2.0 2) Setup the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Mar 2021 14:43:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72302/gatts-characteristic-without-read-properties-can-be-read" /><item><title>RE: GATTS Characteristic without "read" properties can be read</title><link>https://devzone.nordicsemi.com/thread/298142?ContentTypeID=1</link><pubDate>Fri, 05 Mar 2021 14:43:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22a21779-66fd-44a8-ab03-c33af055ab52</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I see I didn&amp;#39;t refresh my window for a while here. But basically, what  is saying is correct.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GATTS Characteristic without "read" properties can be read</title><link>https://devzone.nordicsemi.com/thread/298130?ContentTypeID=1</link><pubDate>Fri, 05 Mar 2021 14:31:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e97c9258-7274-4f20-8588-d52b58139344</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Oh. I see.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So the add_char_params.char_props.write only indicates during service discovery what characteristics that can be read or written to (or enable notifications or indications). As you can see if you try to connect using nRF Connect for Desktop, the write button disappears when setting this to 0:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1614954557779v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;But as you say, you will still be able to physically write to it using e.g. the ble_app_blinky_c example (so by forcing it).&lt;/p&gt;
&lt;p&gt;If you want to physically disallow writes (or reads), you need to change the parameter a few lines down:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    add_char_params.write_access = SEC_OPEN;
    
to:
    add_char_params.write_access = SEC_NO_ACCESS;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Or any other value defined in the enum security_req_t in ble_srv_common.h if you want to require encryption before reading.&lt;/p&gt;
&lt;p&gt;I can agree that this is a bit unintuitive, but hopefully, it solves your requirement.&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: GATTS Characteristic without "read" properties can be read</title><link>https://devzone.nordicsemi.com/thread/298091?ContentTypeID=1</link><pubDate>Fri, 05 Mar 2021 13:12:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44547e07-0573-4392-ab9f-3780331d49b6</guid><dc:creator>Adrian Eggenberger</dc:creator><description>&lt;p&gt;Hi Edwin&lt;/p&gt;
&lt;p&gt;I did a short test based on the examples ble_app_blinky and ble_app_blinky_c running on two nRF52 DK boards. The only change I did to the SDK 17.0.2 is changing a single line in the ble_lbs.c.&lt;/p&gt;
&lt;p&gt;I changed the properties for the led characteristic of the BLE_LBS service to not support write (the changed file is attached).&lt;/p&gt;
&lt;p&gt;Original:&amp;nbsp;add_char_params.char_props.write = 1;&lt;br /&gt;New: add_char_params.char_props.write = 0;&lt;/p&gt;
&lt;p&gt;After this change it is expected that the write of the led characteristic failed with a not permitted error. But when I press the button on the device running ble_app_blinky_c I can still see that the write normally is done.&lt;/p&gt;
&lt;p&gt;Log of the central:&lt;br /&gt;&amp;lt;info&amp;gt; app_timer: RTC: initialized.&amp;lt;CR&amp;gt;&lt;br /&gt;&amp;lt;info&amp;gt; app: Blinky CENTRAL example started.&amp;lt;CR&amp;gt;&lt;br /&gt;&amp;lt;info&amp;gt; app: Connected.&amp;lt;CR&amp;gt;&lt;br /&gt;&amp;lt;info&amp;gt; app: LED Button service discovered on conn_handle 0x0.&amp;lt;CR&amp;gt;&lt;br /&gt;&amp;lt;info&amp;gt; app: LBS write LED state 1&amp;lt;CR&amp;gt;&lt;br /&gt;&amp;lt;info&amp;gt; app: LBS write LED state 0&amp;lt;CR&amp;gt;&lt;/p&gt;
&lt;p&gt;Log of the peripheral:&lt;br /&gt;&amp;lt;info&amp;gt; app_timer: RTC: initialized.&amp;lt;CR&amp;gt;&lt;br /&gt;&amp;lt;info&amp;gt; app: Blinky example started.&amp;lt;CR&amp;gt;&lt;br /&gt;&amp;lt;info&amp;gt; app: Connected&amp;lt;CR&amp;gt;&lt;br /&gt;&amp;lt;info&amp;gt; app: Received LED ON!&amp;lt;CR&amp;gt;&lt;br /&gt;&amp;lt;info&amp;gt; app: Received LED OFF!&amp;lt;CR&amp;gt;&lt;/p&gt;
&lt;p&gt;By this the not working write permission can be shown. I didn&amp;#39;t make an example for the read permission as I think it&amp;#39;s the same problem there.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope that helps to analyze the behavior.&lt;/p&gt;
&lt;p&gt;Adrian&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8228.ble_5F00_lbs.c"&gt;devzone.nordicsemi.com/.../8228.ble_5F00_lbs.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GATTS Characteristic without "read" properties can be read</title><link>https://devzone.nordicsemi.com/thread/297856?ContentTypeID=1</link><pubDate>Thu, 04 Mar 2021 14:30:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67d738b7-ab27-4416-8942-a5e8f196dfb5</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Can you please share a project that can replicate this issue? If you use one of our examples, e.g. the ble_app_hrs example, zip the folder SDK\examples\ble_peripheral\ble_app_hrs, so that when I unzip it into the SDK\examples\ble_peripheral in an unmodified SDK, the issue replicates.&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: GATTS Characteristic without "read" properties can be read</title><link>https://devzone.nordicsemi.com/thread/297536?ContentTypeID=1</link><pubDate>Wed, 03 Mar 2021 13:44:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ef7aa78-a035-48cc-8251-991d00858938</guid><dc:creator>Adrian Eggenberger</dc:creator><description>&lt;p&gt;Let me add the observation that this is not exclusive for the S140 7.x. I&amp;#39;ve seen the same behavior on S132 5.x an S132 7.x.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>