<?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>[S132, S140] char_props.write=0 doesn&amp;#39;t prevent writing</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/26446/s132-s140-char_props-write-0-doesn-t-prevent-writing</link><description>Hello, 
 There is a characteristic with properties: 
 memset(&amp;amp;char_md, 0, sizeof(char_md));
...
attr_md.vloc = BLE_GATTS_VLOC_USER;
...
char_md.char_props.write = 0;
char_md.char_props.read = 1;
attr_char_value.init_len = 16
attr_char_value.max_len</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 01 Nov 2017 08:56:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/26446/s132-s140-char_props-write-0-doesn-t-prevent-writing" /><item><title>RE: [S132, S140] char_props.write=0 doesn't prevent writing</title><link>https://devzone.nordicsemi.com/thread/104056?ContentTypeID=1</link><pubDate>Wed, 01 Nov 2017 08:56:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:758477f4-a38c-469b-84d7-d0a8b49c448b</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Sorry my mistake, yes NO_ACCESS will block :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [S132, S140] char_props.write=0 doesn't prevent writing</title><link>https://devzone.nordicsemi.com/thread/104055?ContentTypeID=1</link><pubDate>Wed, 01 Nov 2017 08:47:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e7bb059-9500-48d7-a6d8-0c8fe64d5d76</guid><dc:creator>hgm-ble</dc:creator><description>&lt;blockquote&gt;
&lt;p&gt;BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;attr_md.write_perm)
will block any write to the characteristic.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Did you mean BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS? If so, it works! Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [S132, S140] char_props.write=0 doesn't prevent writing</title><link>https://devzone.nordicsemi.com/thread/104054?ContentTypeID=1</link><pubDate>Tue, 31 Oct 2017 14:39:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad59188b-9d74-4692-b653-4a79e1e83245</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The char_props only set the properties of the characteristic. It doesn&amp;#39;t prevent the characteristic being written. The properties are for information (to the peer) only.&lt;/p&gt;
&lt;p&gt;If you want to prevent your characteristic being written, you need to use permission, for example attr_md.write_perm. Set BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;attr_md.write_perm) will block any write to the characteristic.&lt;/p&gt;
&lt;p&gt;To fix the length of the characteristic, you set vlen (Variable length attribute) = 0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>