<?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 do I add authorization on read/write on a service&amp;#39;s characteristics?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9505/how-do-i-add-authorization-on-read-write-on-a-service-s-characteristics</link><description>I have done this: 
 ble_gatts_attr_md_t ble_attr_md;
memset(&amp;amp;ble_attr_md, 0, sizeof(ble_attr_md));
.
.
.
ble_attr_md.rd_auth = 1;
ble_attr_md.wr_auth = 1;
.
.
.
ble_gatts_attr_t ble_attr;
.
memset(&amp;amp;ble_attr, 0, sizeof(ble_attr));
.
.
ble_attr</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 01 Oct 2015 11:13:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9505/how-do-i-add-authorization-on-read-write-on-a-service-s-characteristics" /><item><title>RE: How do I add authorization on read/write on a service's characteristics?</title><link>https://devzone.nordicsemi.com/thread/35090?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2015 11:13:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f73d175-39d1-4e47-a93a-e35449cca786</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;That is not possible with authorization. It is possible to authenticate using a passkey, but not authorize. Maybe you could build this into the application? You could use one characteristic for the passkey, then the peripheral can check it, and only send notifications to the central when it is correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add authorization on read/write on a service's characteristics?</title><link>https://devzone.nordicsemi.com/thread/35089?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2015 04:09:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60e135aa-0398-4c13-8807-aba70f5f9b68</guid><dc:creator>Rifat Mahmud</dc:creator><description>&lt;p&gt;Thanks. But is there a way to set a password there, which will be coming from the GATT client that want to read from/write to the specific characteristics?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add authorization on read/write on a service's characteristics?</title><link>https://devzone.nordicsemi.com/thread/35088?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 12:36:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca1f1cfa-424c-4e41-bb23-c39c432ac658</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Please examine this &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v1.0.0/group___b_l_e___g_a_t_t_s___w_r_i_t_e___r_e_q___a_u_t_h___m_s_c.html?cp=2_7_2_1_0_2_3_0_5"&gt;MSC&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You need to handle the BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event, and respond with sd_ble_gatts_rw_authorize_reply(SUCCESS) or sd_ble_gatts_rw_authorize_reply(WRITE_NOT_PERMITTED)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>