<?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>[S132] CCCD value not being initialized</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9049/s132-cccd-value-not-being-initialized</link><description>Hi, I wrote a custom service with a characteristics with notifications support. After a client connects I start the sensors and I start updating the values. On the service I&amp;#39;m using the sd_ble_gatts_hvx function to update the value and send a notification</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Sep 2015 08:28:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9049/s132-cccd-value-not-being-initialized" /><item><title>RE: [S132] CCCD value not being initialized</title><link>https://devzone.nordicsemi.com/thread/33335?ContentTypeID=1</link><pubDate>Fri, 11 Sep 2015 08:28:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f149047-09b8-4bf5-9da3-73ad3327ce71</guid><dc:creator>planas</dc:creator><description>&lt;p&gt;I see, thanks for the clarification @Aryan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [S132] CCCD value not being initialized</title><link>https://devzone.nordicsemi.com/thread/33334?ContentTypeID=1</link><pubDate>Fri, 11 Sep 2015 07:19:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6ab2d39-77f8-4e37-a124-f2a5fc88c317</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You were right about not initializing CCCD, but it is not a bug.
CCCDs are not initialized in memory because their values are persistent. The application can tell the softdevice what values it should store in CCCD using sd_ble_gatts_sys_attr_set. If the app doesn&amp;#39;t have stored values for CCCDs (system attributes) for a particular peer, then it can send sd_ble_gatts_sys_attr_set(conn_handle, NULL, 0) and softdevice should reset the CCCD values to 0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [S132] CCCD value not being initialized</title><link>https://devzone.nordicsemi.com/thread/33333?ContentTypeID=1</link><pubDate>Thu, 10 Sep 2015 16:19:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8f1da47-c38d-49a7-9990-5f4296a38a69</guid><dc:creator>planas</dc:creator><description>&lt;p&gt;AFAIK there&amp;#39;s not a function to write directly to the CCCD on the SDK, so I&amp;#39;m writing to it through the device acting as central, eg. the MCP.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [S132] CCCD value not being initialized</title><link>https://devzone.nordicsemi.com/thread/33332?ContentTypeID=1</link><pubDate>Thu, 10 Sep 2015 12:42:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d66a80f6-3885-4d82-bf32-f2844b86d17c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;That is interesting, can you please post the code snippet of how you write to CCCD?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [S132] CCCD value not being initialized</title><link>https://devzone.nordicsemi.com/thread/33331?ContentTypeID=1</link><pubDate>Mon, 07 Sep 2015 14:39:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83ebc16b-9cad-4215-ae13-6ad7577847bf</guid><dc:creator>planas</dc:creator><description>&lt;p&gt;Hi Aryan, I&amp;#39;m initializing all the structs to zero, but which struct contains the initial CCCD value? I thought this was managed by the SD. I mean, you can initialize the char value through ble_gatts_attr_t, and you can set the permissions, mem location, etc. of the CCCD through the ble_gatts_attr_md_t metadata struct, but I don&amp;#39;t see how I should initialize the CCCD value which theoretically should be 0. Just in case, this is my implementation &lt;a href="http://pastebin.com/g1G3bCK6"&gt;http://pastebin.com/g1G3bCK6&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [S132] CCCD value not being initialized</title><link>https://devzone.nordicsemi.com/thread/33330?ContentTypeID=1</link><pubDate>Mon, 07 Sep 2015 12:21:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d2e3468-e20f-468e-af46-21d62bcf7e4c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Your assumption is correct, but this is not a bug. Atleast not a implementation bug.
nothing is initialized to 0 inside sd_ble_gatts_characteristic_add.
It is upto application to do this. This probably could have been documented.
If you see any example (like ble_app_uart) you will see that all metadata and attribute descriptors are memset to 0 by the app.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>