<?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>Enabling Notification on a Characteristic</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7211/enabling-notification-on-a-characteristic</link><description>Hi,
I was trying to send notification from nRF51822 to an android central when notification is enabled on the nordic uart rx characteristic and I discovered that if I enable notification on the characteristic once it has been discovered by the android</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 May 2015 07:15:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7211/enabling-notification-on-a-characteristic" /><item><title>RE: Enabling Notification on a Characteristic</title><link>https://devzone.nordicsemi.com/thread/25475?ContentTypeID=1</link><pubDate>Tue, 26 May 2015 07:15:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e27a62c-3bee-447b-988d-9c75b03c25a6</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Augustio: CCCD should be set just once on every connection if it&amp;#39;s not bonded. If the connection is bonded previously, the CCCD value will automatically be restored on both side. No write command needed.&lt;/p&gt;
&lt;p&gt;What you were seeing in the source code came from the way we implemented service discovery and CCCD setting in nRFToolbox. First, we do service discovery, after we done with service discovery, we read the HR sensor location characteristic. When we have the call back &amp;quot;onCharacteristicRead()&amp;quot;, if it&amp;#39;s the HR_SENSOR_LOCATION_CHARACTERISTIC_UUID returned, we read the battery level characteristic. And only after either we receive battery level (or if battery level is not exist) we will enable CCCD on HR value.&lt;/p&gt;
&lt;p&gt;We don&amp;#39;t do further characteristic read in this app. So the CCCD set is only perform once.&lt;/p&gt;
&lt;p&gt;You can also take a look at the nRFUART, where we also only enable CCCD once.&lt;/p&gt;
&lt;p&gt;I would suggest you to capture a sniffer trace, and can find what happened over the air.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enabling Notification on a Characteristic</title><link>https://devzone.nordicsemi.com/thread/25474?ContentTypeID=1</link><pubDate>Fri, 22 May 2015 10:04:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:acf5c13e-97fa-4dee-972d-1e6cf39add40</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;My post seems to be too long for comment so see amended question above;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enabling Notification on a Characteristic</title><link>https://devzone.nordicsemi.com/thread/25473?ContentTypeID=1</link><pubDate>Fri, 22 May 2015 09:34:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0198803-967c-4c1b-9210-a62db3f0be85</guid><dc:creator>augustio</dc:creator><description>&lt;p&gt;Thanks again, but by connection are you referring to the period between the beginning of a connection interval and the end or between the time for eg, in android BluethootGatt.connect() is called and BluetoothGatt.disconnect() is called. I really get confused with these two scenarios.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enabling Notification on a Characteristic</title><link>https://devzone.nordicsemi.com/thread/25472?ContentTypeID=1</link><pubDate>Fri, 22 May 2015 09:21:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba28ec9c-7f41-40bd-9849-222c6de8c59e</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Hi augustio,&lt;/p&gt;
&lt;p&gt;As per BT SIG specification 4.0+: GATT CCCD (Client Characteristic Configuration Descriptor) values should be persistent across connections for bonded devices. If you are not using bonding you need to enable Handle Value Notifications each time you connect (from Central side).&lt;/p&gt;
&lt;p&gt;Cheers Jan&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;Edit #1 (2015/05/22):&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Hi augustio,&lt;/p&gt;
&lt;p&gt;I cannot help you with Android or another API reflection of core BLE events so I&amp;#39;ll stick to what is only real (on RF interface): CCCD state for not bonded nRF51 device with Nordic stacks (at least according to my experience and Nordic documentation) is kept between CONNECT_REQ and termination of BLE connection on LL layer (either by some time out or explicitly by particular TERMINATE command). I&amp;#39;d suggest to go down to the BLE principles and carefully map your solution to it in detailed flow charts. Then you also must include limitations coming from stack implementation on both sides (mainly what connection and advertising intervals are allowed, what is MTU size, how many events per connection interval it can handle, known bugs from release notest etc.) If you are then tight to some 3rd party HW and SW such as particular Android phone you must add significant cost/time into your project planning for debugging and testing (e.g. you might need more expensive BLE sniffer then Nordic&amp;#39;s nRF51 DK/Dongle). Plus overall risk that if you push BLE to its &amp;quot;limits&amp;quot; (in this case it&amp;#39;s anything else than vague bi-directional data transfer in range of several hundreds of bytes within couple of seconds) you might fail completely with your HW+SW set-up...&lt;/p&gt;
&lt;p&gt;Cheers Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>