<?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 to register/add notify callbacks dynamically on the Peripheral?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80676/how-to-register-add-notify-callbacks-dynamically-on-the-peripheral</link><description>I would like to add dynamically notify callbacks on a given characteristic. 
 Currently I can only register one callback on the creation of the characteristic: 
 
 How can I add a callback for ccc changes during runtime for a given characteristic?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 15 Oct 2021 15:20:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80676/how-to-register-add-notify-callbacks-dynamically-on-the-peripheral" /><item><title>RE: How to register/add notify callbacks dynamically on the Peripheral?</title><link>https://devzone.nordicsemi.com/thread/334404?ContentTypeID=1</link><pubDate>Fri, 15 Oct 2021 15:20:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae540086-dc39-45b0-8270-d2af2dcb1bfe</guid><dc:creator>Felix41382</dc:creator><description>&lt;p&gt;Such a shame. Anyway, thanks for you help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to register/add notify callbacks dynamically on the Peripheral?</title><link>https://devzone.nordicsemi.com/thread/334211?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 14:49:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:769bb69b-d1f1-440b-855b-4d84fb4f99d3</guid><dc:creator>Einar Thorsrud</dc:creator><description>[quote user="Felix41382"]Thanks for your quick response. If the central changes data of of the peripheral characteristics, I would like to e.g. turn on a LED on the peripheral device.[/quote]
&lt;p&gt;I see.&lt;/p&gt;
[quote user="Felix41382"]&lt;p&gt;Can you give an example, how you would add this callback in a later moment?&lt;/p&gt;
&lt;p&gt;It would be nice, if I could set this callback during runtime, independent of the service implementation.&lt;/p&gt;[/quote]
&lt;p&gt;I am not able to see how that would be possible. I suggest you do as I proposed in my previous post: Have the callback there from the start, but do nothing in it when not relevant.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to register/add notify callbacks dynamically on the Peripheral?</title><link>https://devzone.nordicsemi.com/thread/334203?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 14:24:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e54e3b0a-afdb-438c-a5ab-d2d72bb889e8</guid><dc:creator>Felix41382</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Thanks for your quick response. If the central changes data of of the peripheral characteristics, I would like to e.g. turn on a LED on the peripheral device.&lt;/p&gt;
&lt;p&gt;Can you give an example, how you would add this callback in a later moment?&lt;/p&gt;
&lt;p&gt;It would be nice, if I could set this callback during runtime, independent of the service implementation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to register/add notify callbacks dynamically on the Peripheral?</title><link>https://devzone.nordicsemi.com/thread/334181?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 13:16:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35ab6588-bf23-482c-97a1-053327f4be14</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I do not see how it would be possible to add a callback at a later point. May I ask why you want to do that? In what use case is that useful? Could you not add a callback in the first place, but make it return without doing anything except when you need it to do something?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>