<?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>Please tell me how to set permissions.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82108/please-tell-me-how-to-set-permissions</link><description>Hello. I&amp;#39;m thinking about what I can do with peripheral rolls. 
 I have a question about GATT communication data. The following content was described in the Core Specification of the Bluetooth SIG. 
 
 I think that the structure used when setting the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 Jan 2022 00:11:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82108/please-tell-me-how-to-set-permissions" /><item><title>RE: Please tell me how to set permissions.</title><link>https://devzone.nordicsemi.com/thread/349652?ContentTypeID=1</link><pubDate>Wed, 26 Jan 2022 00:11:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e601cd2-8700-4ef1-b80c-2c452f691897</guid><dc:creator>sdi_kei</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry to hurry.&lt;br /&gt;How are you feeling. I am glad that you can return safely.&lt;/p&gt;
&lt;p&gt;Your answer was very helpful. Thank you very much.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Please tell me how to set permissions.</title><link>https://devzone.nordicsemi.com/thread/349463?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 09:25:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41dec92d-c383-42d6-abcf-312994089c41</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;sorry for the delay, i had a covid case in my home and hence had to be away from work&lt;/p&gt;
&lt;p&gt;Yes, your reference settings and its understanding seems ok to me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Please tell me how to set permissions.</title><link>https://devzone.nordicsemi.com/thread/348835?ContentTypeID=1</link><pubDate>Fri, 21 Jan 2022 06:37:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d8f333b-94a3-4c54-a7bf-285deaca3d7a</guid><dc:creator>sdi_kei</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;I need your information to create a feature.&lt;br /&gt;If possible, please reply as soon as possible.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Please tell me how to set permissions.</title><link>https://devzone.nordicsemi.com/thread/347744?ContentTypeID=1</link><pubDate>Fri, 14 Jan 2022 11:41:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33d4e013-286f-42f4-a127-d8d33e807065</guid><dc:creator>sdi_kei</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;I tried to summarize it with reference to what you taught me.&lt;br /&gt;Please tell me if this is the case.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;The following content showed the same thing.

BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS         ⇔   SEC_NO_ACCESS
BLE_GAP_CONN_SEC_MODE_SET_OPEN              ⇔   SEC_OPEN
BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM       ⇔   SEC_JUST_WORKS
BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM     ⇔   SEC_MITM
BLE_GAP_CONN_SEC_MODE_SET_SIGNED_NO_MITM    ⇔   SEC_SIGNED
BLE_GAP_CONN_SEC_MODE_SET_SIGNED_WITH_MITM  ⇔   SEC_SIGNED_MITM


The following access permissions are possible:
• Readable  → ble_gatt_char_props_t read = 1
• Writeable → ble_gatt_char_props_t write = 1
• Readable and writable → ble_gatt_char_props_t read = 1, write = 1

The following encryption permissions are possible:
• Encryption required → security_req_t SEC_JUST_WORKS &amp;amp; SEC_MITM &amp;amp; SEC_SIGNED &amp;amp; SEC_SIGNED_MITM
• No encryption required → security_req_t SEC_OPEN

The following authentication permissions are possible:
• Authentication Required → security_req_t SEC_MITM &amp;amp; SEC_SIGNED &amp;amp; SEC_SIGNED_MITM
• No Authentication Required → security_req_t SEC_OPEN &amp;amp; SEC_JUST_WORKS

The following authorization permissions are possible:
• Authorization Required → security_req_t SEC_MITM &amp;amp; SEC_SIGNED &amp;amp; SEC_SIGNED_MITM
• No Authorization Required → security_req_t SEC_OPEN &amp;amp; SEC_JUST_WORKS
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Please tell me how to set permissions.</title><link>https://devzone.nordicsemi.com/thread/345017?ContentTypeID=1</link><pubDate>Fri, 24 Dec 2021 09:00:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13d3dce6-f179-4e83-bea3-fa73af3b055e</guid><dc:creator>sdi_kei</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;What I want to do is create a characteristic that can only be read and written by central devices that meet certain criteria.&lt;/p&gt;
&lt;p&gt;At that time, you have to set each characteristic, but I don&amp;#39;t know what kind of setting should be done, so please let me know.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Please tell me how to set permissions.</title><link>https://devzone.nordicsemi.com/thread/345016?ContentTypeID=1</link><pubDate>Fri, 24 Dec 2021 08:26:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77ab79e0-20b9-4202-8f6e-029dde81635c</guid><dc:creator>fhfs</dc:creator><description>&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;bull; No encryption required&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="background-color:#ff0000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Correction: BLE_GAP_CONN_SEC_MODE_SET_OPEN&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;The following authentication permissions are possible:&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;bull; Authentication Required&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;BLE_GAP_CONN_SEC_MODE_SET_SIGNED_NO_MITM and BLE_GAP_CONN_SEC_MODE_SET_SIGNED_WITH_MITM&lt;/p&gt;
&lt;p&gt;Authenticate by signature&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;bull; No Authentication Required&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This will block access to the attribute. What is it you want here?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve only used the Open and LESC with MITM in my projects. What is it you want to achieve specifically?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Please tell me how to set permissions.</title><link>https://devzone.nordicsemi.com/thread/345013?ContentTypeID=1</link><pubDate>Fri, 24 Dec 2021 05:20:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:958c2ee5-de9f-4e58-b0cb-55625770ea7d</guid><dc:creator>sdi_kei</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;Thank you for telling me about the settings.&lt;br /&gt;However, I checked the example, but I didn&amp;#39;t understand some points, so please let me know.&lt;br /&gt;This is what we currently know.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;The following access permissions are possible:
• Readable
    add_char_params.read_access = SEC_OPEN;
• Writeable
    add_char_params.write_access = SEC_OPEN;
• Readable and writable
    Allow read and write
    
The following encryption permissions are possible:
• Encryption required
    BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM and BLE_GAP_CONN_SEC_MODE_SET_OPEN
• No encryption required
    BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM
    
The following authentication permissions are possible:
• Authentication Required
    not sure
• No Authentication Required
    BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS
    
The following authorization permissions are possible:
• Authorization Required
    not sure
• No Authorization Required
    not sure&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Please tell me how to set permissions.</title><link>https://devzone.nordicsemi.com/thread/342339?ContentTypeID=1</link><pubDate>Tue, 07 Dec 2021 13:19:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:998c6b7a-8399-4a1c-a508-8a6b590a19ec</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="sdi_kei"]I think Encryption required is set to BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM and No encryption required is BLE_GAP_CONN_SEC_MODE_SET_OPEN.[/quote]
&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Encryption have different levels so it could be&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM or&amp;nbsp;&lt;/span&gt;&lt;/span&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;and yes no encryption means you need to set the permissions to open&amp;nbsp;&lt;/span&gt;&lt;/span&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;BLE_GAP_CONN_SEC_MODE_SET_OPEN.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;read and write access can be defined to the char properties like below&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt; add_char_params.read_access  = SEC_OPEN;
add_char_params.write_access = SEC_OPEN;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;The following authentication permissions are possible:&lt;br /&gt;• Authentication Required&lt;br /&gt;• No Authentication Required&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;for the above you have&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;ble_add_char_params_t in&amp;nbsp;components\softdevice\s112\headers\ble_gatt.h that you can set.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I suggest you to see one of the ble service implementation like&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;components\ble\ble_services\ble_nus\ble_nus.c:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;ble_nus_init to get a closer look a the example to use these settings.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Please tell me how to set permissions.</title><link>https://devzone.nordicsemi.com/thread/342188?ContentTypeID=1</link><pubDate>Tue, 07 Dec 2021 00:08:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a064c40c-d008-4e1c-aace-74cdfb1f5666</guid><dc:creator>sdi_kei</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;Do you see the question?&lt;br /&gt;I would be grateful if the support engineer could answer if you like.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Please tell me how to set permissions.</title><link>https://devzone.nordicsemi.com/thread/340976?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 02:53:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:756dd84d-3432-435a-872d-b3b9d2bcfaf2</guid><dc:creator>sdi_kei</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;I think Encryption required is set to BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM and No encryption required is BLE_GAP_CONN_SEC_MODE_SET_OPEN.&lt;/p&gt;
&lt;p&gt;Can you tell me what else applies?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Please tell me how to set permissions.</title><link>https://devzone.nordicsemi.com/thread/340946?ContentTypeID=1</link><pubDate>Fri, 26 Nov 2021 16:01:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d718d0ad-445c-48e5-a1f2-a34e7127f9e6</guid><dc:creator>fhfs</dc:creator><description>&lt;p&gt;Have a look at ble_gap.h from the nrf5 SDK.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@defgroup BLE_GAP_CONN_SEC_MODE_SET_MACROS GAP attribute security requirement setters
 *
 * See @ref ble_gap_conn_sec_mode_t.
 * @{ */
/**@brief Set sec_mode pointed to by ptr to have no access rights.*/
#define BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(ptr)          do {(ptr)-&amp;gt;sm = 0; (ptr)-&amp;gt;lv = 0;} while(0)
/**@brief Set sec_mode pointed to by ptr to require no protection, open link.*/
#define BLE_GAP_CONN_SEC_MODE_SET_OPEN(ptr)               do {(ptr)-&amp;gt;sm = 1; (ptr)-&amp;gt;lv = 1;} while(0)
/**@brief Set sec_mode pointed to by ptr to require encryption, but no MITM protection.*/
#define BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(ptr)        do {(ptr)-&amp;gt;sm = 1; (ptr)-&amp;gt;lv = 2;} while(0)
/**@brief Set sec_mode pointed to by ptr to require encryption and MITM protection.*/
#define BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(ptr)      do {(ptr)-&amp;gt;sm = 1; (ptr)-&amp;gt;lv = 3;} while(0)
/**@brief Set sec_mode pointed to by ptr to require LESC encryption and MITM protection.*/
#define BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM(ptr) do {(ptr)-&amp;gt;sm = 1; (ptr)-&amp;gt;lv = 4;} while(0)
/**@brief Set sec_mode pointed to by ptr to require signing or encryption, no MITM protection needed.*/
#define BLE_GAP_CONN_SEC_MODE_SET_SIGNED_NO_MITM(ptr)     do {(ptr)-&amp;gt;sm = 2; (ptr)-&amp;gt;lv = 1;} while(0)
/**@brief Set sec_mode pointed to by ptr to require signing or encryption with MITM protection.*/
#define BLE_GAP_CONN_SEC_MODE_SET_SIGNED_WITH_MITM(ptr)   do {(ptr)-&amp;gt;sm = 2; (ptr)-&amp;gt;lv = 2;} while(0)
/**@} */&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;For example you can set the write permissions to LESC with MITM when initializing your characteristic:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    ble_gatts_attr_md_t cccd_md;
    BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM(&amp;amp;cccd_md.write_perm);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>