<?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 notification</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/55028/how-to-enable-notification</link><description>Hello. 
 
 I just found here: https://nordicsemiconductor.github.io/Nordic-Thingy52-FW/documentation/firmware_architecture.html 
 something like this: 
 &amp;quot;To turn on sensor reading, enable notifications from the desired characteristic by writing 0x0001</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Dec 2019 07:32:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/55028/how-to-enable-notification" /><item><title>RE: how to enable notification</title><link>https://devzone.nordicsemi.com/thread/223210?ContentTypeID=1</link><pubDate>Tue, 03 Dec 2019 07:32:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:327cce88-8e61-4284-98e2-773a8960f1b3</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;That&amp;#39;s good to hear &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable notification</title><link>https://devzone.nordicsemi.com/thread/223094?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2019 14:30:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7c3cfb7-a5b5-4424-8066-e93f89be7d1e</guid><dc:creator>matej1410</dc:creator><description>&lt;p&gt;Hi. Yes the last is correct. Checked :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable notification</title><link>https://devzone.nordicsemi.com/thread/223089?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2019 14:18:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7ce5c37-8fef-4d02-a84c-7630e816b653</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Do you mean to say you found the solution?&lt;/p&gt;
&lt;p&gt;The last code you sent appears to be correct.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable notification</title><link>https://devzone.nordicsemi.com/thread/222800?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2019 12:34:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2cd62f64-1f54-4cc6-8ab3-f83c57a457a3</guid><dc:creator>matej1410</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;  @Override
        public void onServicesDiscovered(BluetoothGatt gatt, int status) {
            super.onServicesDiscovered(gatt, status);

            

            UUID SERVICE_UUID=UUID.fromString           (&amp;quot;EF680200-9B35-4933-9B10-52FFA9740042&amp;quot;);
            UUID CHARACTERISTIC_UUID=UUID.fromString    (&amp;quot;EF680201-9B35-4933-9B10-52FFA9740042&amp;quot;);

            BluetoothGattService service = gatt.getService(SERVICE_UUID);
            BluetoothGattCharacteristic characteristic = service.getCharacteristic(CHARACTERISTIC_UUID);

            BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(&amp;quot;00002902-0000-1000-8000-00805f9b34fb&amp;quot;));
            descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
            gatt.writeDescriptor(descriptor);
            bluetoothLeScanner.stopScan(scanCallback);

            gatt.readCharacteristic(characteristic);
            gatt.setCharacteristicNotification(characteristic,true);


        }

        @Override
        public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {
            super.onCharacteristicRead(gatt, characteristic, status);

        }

        @Override
        public void onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {
            super.onCharacteristicWrite(gatt, characteristic, status);
        }

        @Override
        public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {
            super.onCharacteristicChanged(gatt, characteristic);
            
            //here we read changes for example:
                byte[] moja_tablica = new byte[2];
                moja_tablica= characteristic.getValue();
            
        }
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thats all :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to enable notification</title><link>https://devzone.nordicsemi.com/thread/222779?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2019 11:47:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a18d3abb-43f9-4c99-8b77-e3705246678a</guid><dc:creator>matej1410</dc:creator><description>&lt;p&gt;I found this:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;BluetoothGattDescriptor descriptor = characteristic.getDescriptor(
&amp;#160; &amp;#160; &amp;#160; &amp;#160; UUID.fromString(SampleGattAttributes.CLIENT_CHARACTERISTIC_CONFIG));
descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
bluetoothGatt.writeDescriptor(descriptor);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;but I still dont know what is in my case:&lt;/p&gt;
&lt;pre class="lang-java" dir="ltr"&gt;&lt;span class="typ"&gt;SampleGattAttributes&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;CLIENT_CHARACTERISTIC_CONFIG&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span class="pln"&gt;and&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class="lang-java" dir="ltr"&gt;&lt;span class="typ"&gt;BluetoothGattDescriptor&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;ENABLE_NOTIFICATION_VALUE&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span class="pln"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class="lang-java" dir="ltr"&gt;&lt;span class="typ"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>