<?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>zephyr/ncs: how to tell which attribute has CCCD changed</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79951/zephyr-ncs-how-to-tell-which-attribute-has-cccd-changed</link><description>Hi, 
 I understand the on_cccd_changed() will be called when CCCD changed. But I can&amp;#39;t figure out which attribute it&amp;#39;s associated with. I try to print out the UUID which is always 2902. 
 The code below is from the NCS BLE tutorial. 
 I have 4 characteristics</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 Sep 2021 17:22:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79951/zephyr-ncs-how-to-tell-which-attribute-has-cccd-changed" /><item><title>RE: zephyr/ncs: how to tell which attribute has CCCD changed</title><link>https://devzone.nordicsemi.com/thread/331152?ContentTypeID=1</link><pubDate>Fri, 24 Sep 2021 17:22:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20d09fb9-96da-4cdc-a106-a3775c9f4583</guid><dc:creator>bluebeam</dc:creator><description>&lt;p&gt;Right... what as I thinking. I must be too quick copying and pasting same code block four times and start to wonder how I can tell them apart if they&amp;#39;re calling the same function...&amp;nbsp; :-(&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: zephyr/ncs: how to tell which attribute has CCCD changed</title><link>https://devzone.nordicsemi.com/thread/331112?ContentTypeID=1</link><pubDate>Fri, 24 Sep 2021 13:29:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81acbc3c-23a9-472c-81f3-37c7619d11bb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When you use&amp;nbsp;BT_GATT_CCC that is the CCCD for the characteristic you&amp;nbsp;declared immediately before. To separate between them, use separate callback functions (see for instance&amp;nbsp;zephyr\subsys\bluetooth\audio\vocs.c for an example).&lt;/p&gt;
&lt;p&gt;When the event handler is called (&lt;code&gt;on_cccd_changed()&lt;/code&gt; in your case), you get a pointer to the attribute and the value (first and second parameter to the callback function respectively).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>