<?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>Write Characteristic only when Paired</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93109/write-characteristic-only-when-paired</link><description>NCS 2.1.0 / nRF52840-DK 
 Hello, 
 I have a single write characteristic on my service: 
 
 BT_GATT_SERVICE_DEFINE ( custom_srv, 
 BT_GATT_PRIMARY_SERVICE (BT_UUID_CUSTOM_SERVICE), 
 BT_GATT_CHARACTERISTIC ( BT_UUID_ADV_PERIOD_CHRC, 
 BT_GATT_CHRC_WRITE_WITHOUT_RESP</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Oct 2022 09:17:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93109/write-characteristic-only-when-paired" /><item><title>RE: Write Characteristic only when Paired</title><link>https://devzone.nordicsemi.com/thread/391865?ContentTypeID=1</link><pubDate>Fri, 21 Oct 2022 09:17:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d0ad81b-254d-423e-9f10-1e1cb9905eb0</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Joao,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s not possible to&amp;nbsp;do the exact feature as you mentioned that the service/characteristic only visible to paired device.&amp;nbsp;&lt;br /&gt;But you can either do what you did to require permission or you can add the service/characteristic after you know that the link has been encrypted.&amp;nbsp;&lt;br /&gt;You can have a look at my example here on how to add a service/characteristic after connected:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/support-private/support/290356#permalink=769225"&gt;https://devzone.nordicsemi.com/support-private/support/290356#permalink=769225&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Write Characteristic only when Paired</title><link>https://devzone.nordicsemi.com/thread/391864?ContentTypeID=1</link><pubDate>Thu, 20 Oct 2022 14:58:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af214e24-ce93-402b-8a19-9a3a62bf0ca3</guid><dc:creator>Joao Dullius</dc:creator><description>&lt;p&gt;Got it. I was able to achieve the required behavior by changing from&amp;nbsp;&lt;span&gt;&lt;span&gt;BT_GATT_PERM_WRITE to&amp;nbsp;&lt;/span&gt;&lt;/span&gt;BT_GATT_PERM_WRITE_AUTHEN.&lt;/p&gt;
&lt;p&gt;Follow-up question:&lt;/p&gt;
&lt;p&gt;- Can I make a characteristic only visible to paired devices?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>