<?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>Peripheral notify enabled state</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111460/peripheral-notify-enabled-state</link><description>For me it is confusing how the Nordic&amp;#39;s exercise and sample apps handle the state of CCC descriptor value. 
 Adding notification and indication support 
 Why do we need to manage a user app level notify_enabled variable at all? 
 
 This is probably a</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 May 2024 13:33:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111460/peripheral-notify-enabled-state" /><item><title>RE: Peripheral notify enabled state</title><link>https://devzone.nordicsemi.com/thread/485841?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 13:33:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff135a97-0b28-4a4e-a3a4-d87b0f899bf0</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can handle this in multiple ways.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/connectivity/bluetooth/api/gatt.html#c.bt_gatt_notify"&gt;bt_gatt_notify&lt;/a&gt;() will return an error if you are not notified, but there is nothing stopping you from trying to call it even so, and just use that as a &amp;quot;if not notified&amp;quot; .&lt;/p&gt;
&lt;p&gt;You can also use &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/connectivity/bluetooth/api/gatt.html#c.bt_gatt_is_subscribed"&gt;bt_gatt_is_subscribed&lt;/a&gt;() to check.&lt;/p&gt;
&lt;p&gt;Or you can set a local variable in your app.&lt;/p&gt;
&lt;p&gt;In the end, it is up to you as a user.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>