<?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 enable gatt indication/notification between Android and nrf51 devices?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18545/how-to-enable-gatt-indication-notification-between-android-and-nrf51-devices</link><description>Hello, I have walked through this tutorial: devzone.nordicsemi.com/.../ 
however things didn&amp;#39;t work as planned. I can now read the default value of a value characteristic, but ble hvx does not work. 
 The part I think maybe problematic, and confusing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Dec 2016 12:00:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18545/how-to-enable-gatt-indication-notification-between-android-and-nrf51-devices" /><item><title>RE: How to enable gatt indication/notification between Android and nrf51 devices?</title><link>https://devzone.nordicsemi.com/thread/71573?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2016 12:00:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbc0f3e9-ed76-497b-bbd9-287cc4f1d3c7</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;You are right, Emil. I didn&amp;#39;t spot that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable gatt indication/notification between Android and nrf51 devices?</title><link>https://devzone.nordicsemi.com/thread/71571?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2016 13:37:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d24895a4-77b5-4c80-b706-3cfae1d0551c</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I don&amp;#39;t think any problem there. Note that you only setCharacteristicNotification() once after you get connected, you don&amp;#39;t have to set it all the time.&lt;/p&gt;
&lt;p&gt;characteristic.setValue(data_to_write); has nothing to do with enabling CCCD, they are 2 separated write command.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable gatt indication/notification between Android and nrf51 devices?</title><link>https://devzone.nordicsemi.com/thread/71570?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2016 09:28:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3d5474d-eed5-45b0-9a5b-5d61193725d4</guid><dc:creator>Mitch996</dc:creator><description>&lt;p&gt;Hello, will it be a problem that I  setCharacteristicNotification() RIGHT BEFORE I send the data? See code below:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if ((charaProp | BluetoothGattCharacteristic.PROPERTY_NOTIFY) &amp;gt; 0) {
                        mNotifyCharacteristic = characteristic;
                        mBluetoothLeService.setCharacteristicNotification(
                                characteristic, true);
characteristic.setValue(data_to_write);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable gatt indication/notification between Android and nrf51 devices?</title><link>https://devzone.nordicsemi.com/thread/71569?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2016 12:23:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca2fea12-fe5f-415f-a240-b77496c4e2c7</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s just how BLE works. If a GATT client (in this case your phone) want to receive notification from the GATT server (your nRF51) it have to enable CCCD (write 0x01 to it) on the server. This is telling the server that &amp;quot;OK, I want to receive notification from you, you can send me whenever you want.&amp;quot;&lt;/p&gt;
&lt;p&gt;On Android, you enable CCCD by using [setCharacteristicNotification()](&lt;a href="https://developer.android.com/reference/android/bluetooth/BluetoothGatt.html#setCharacteristicNotification(android.bluetooth.BluetoothGattCharacteristic"&gt;developer.android.com/.../BluetoothGatt.html&lt;/a&gt;, boolean)) .&lt;/p&gt;
&lt;p&gt;I would suggest you to have a look at our example app, such as the &lt;a href="https://github.com/NordicSemiconductor/Android-nRF-Blinky"&gt;nRF Blinky app&lt;/a&gt; or the &lt;a href="https://github.com/NordicSemiconductor/Android-nRF-UART"&gt;nRF UART app.&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>