<?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>nrf52 (sdk2.0 v11) alert notification and android gatt server</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13069/nrf52-sdk2-0-v11-alert-notification-and-android-gatt-server</link><description>Hi. 
 I&amp;#39;ve played around with the android application (based around google gatt example, but used in gatt server -mode). 
 How is the example expected to be handled? In proper central mode the nrf would do the scanning and connecting and android would</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 Sep 2016 23:44:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13069/nrf52-sdk2-0-v11-alert-notification-and-android-gatt-server" /><item><title>RE: nrf52 (sdk2.0 v11) alert notification and android gatt server</title><link>https://devzone.nordicsemi.com/thread/49838?ContentTypeID=1</link><pubDate>Fri, 16 Sep 2016 23:44:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a13d8b0-8eb7-48d9-bd6c-0f8c81be29ab</guid><dc:creator>vit bernatik</dc:creator><description>&lt;p&gt;I&amp;#39;m using for 2 descriptors always same uuid and it works. UUID shall be: UUID.fromString(&amp;quot;00002902-0000-1000-8000-00805f9b34fb&amp;quot;);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 (sdk2.0 v11) alert notification and android gatt server</title><link>https://devzone.nordicsemi.com/thread/49835?ContentTypeID=1</link><pubDate>Thu, 14 Apr 2016 07:35:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:516fc4d9-438c-4e06-b568-6f3ff7bd1f66</guid><dc:creator>Matts</dc:creator><description>&lt;p&gt;Actually I think the problem is solved. I had to remove android device battery for a moment. I haven&amp;#39;t worked with BLE stuff for a year, so I had a epiphany of last project with similar issue. The Android side BLE stack was in some weird state. I noticed that the changed characteristics didn&amp;#39;t really change state.&lt;/p&gt;
&lt;p&gt;Thanks for the support and the links!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 (sdk2.0 v11) alert notification and android gatt server</title><link>https://devzone.nordicsemi.com/thread/49836?ContentTypeID=1</link><pubDate>Thu, 14 Apr 2016 06:07:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52593841-2a86-4361-9dec-14c6c1eb2a2c</guid><dc:creator>Matts</dc:creator><description>&lt;p&gt;Yes, the original issue is &amp;quot;hidden&amp;quot; as I really would like to get some sort of indication that the nrf device has received the notification. Is started getting more notifications trough after changed the android side notifyCharacteristicChanged not to ask for confirmation. But as I said, I would like to get some sort of indication that the notification is received.&lt;/p&gt;
&lt;p&gt;The connection drop is another matter that might be related to original issue. I can make another question if that&amp;#39;s preferred for that.&lt;/p&gt;
&lt;p&gt;Thanks for the documentation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 (sdk2.0 v11) alert notification and android gatt server</title><link>https://devzone.nordicsemi.com/thread/49834?ContentTypeID=1</link><pubDate>Wed, 13 Apr 2016 14:25:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27a2113d-9811-4497-8d0b-c7176b1b1a82</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Matts,&lt;/p&gt;
&lt;p&gt;I am kind of lost on what is the issue you have now.
Do you still have the trouble that the notification doesn&amp;#39;t come more than once per connection ? Or it&amp;#39;s the issue that you need to keep sending notification or the connection will break ??&lt;/p&gt;
&lt;p&gt;As you mentioned you can catch the  BLE_GATTC_EVT_HVX  event every time the phone send the notification, I suggest you to check why the application didn&amp;#39;t switch the LEDs state . Could you check, if it&amp;#39;s not a new message&lt;/p&gt;
&lt;p&gt;Regrading the concept, I don&amp;#39;t think we have anything other than the Alert Notification Service spec &lt;a href="https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=242287"&gt;here&lt;/a&gt;. Also you can have a look at the documentation for the ancs example &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/ble_sdk_app_alert_notification.html?cp=4_0_0_4_2_2_0"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 (sdk2.0 v11) alert notification and android gatt server</title><link>https://devzone.nordicsemi.com/thread/49833?ContentTypeID=1</link><pubDate>Wed, 13 Apr 2016 13:21:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1745adca-5e0f-4d63-b116-647bd3d8c87e</guid><dc:creator>Matts</dc:creator><description>&lt;p&gt;Yes, it happens every timein nrf board after I send notifyCharacteristicChanged from android side. I made the breakpoint conditional so that it triggered on second BLE_GATTC_EVT_HVX-event. No timeout of course in nrf side in than case as debugger has stopped the execution.&lt;/p&gt;
&lt;p&gt;But with non-debugger usecase the connection keeps alive as long as I keep giving notifications to nrf board from android side. If they stop, the board timeouts.&lt;/p&gt;
&lt;p&gt;The consept I meant is whole alert notification consept. How fe acknoledging should be done and what sort of communication flow is expected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 (sdk2.0 v11) alert notification and android gatt server</title><link>https://devzone.nordicsemi.com/thread/49832?ContentTypeID=1</link><pubDate>Wed, 13 Apr 2016 11:12:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9dad8f8-807d-4c56-9fc4-3a4e32bdd004</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;You meant you still receive BLE_GATTC_EVT_HVX events &lt;strong&gt;after the first notification&lt;/strong&gt; ?&lt;/p&gt;
&lt;p&gt;If you put a breakpoint inside the ble_ancs_c_on_ble_evt() function to catch that event, what happens after the first notification ?&lt;/p&gt;
&lt;p&gt;There is no ACK for the notification, but there is ACK for every packet on linklayer on BLE.&lt;/p&gt;
&lt;p&gt;Which concept you are talking about ? You can get an idea how BLE work &lt;a href="https://www.youtube.com/watch?v=BZwOrQ6zkzE"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 (sdk2.0 v11) alert notification and android gatt server</title><link>https://devzone.nordicsemi.com/thread/49831?ContentTypeID=1</link><pubDate>Wed, 13 Apr 2016 06:33:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61d3954a-aa0d-4d79-990d-50fb74074129</guid><dc:creator>Matts</dc:creator><description>&lt;p&gt;Regarding that BLE_GATTC_EVT_HVX -event. Yes, it happens. That the indication that notification has occurred. I had a trace in that switch-case. Also I can see the passed message in the nrf side trace. Anything specific I should check with debugger?&lt;/p&gt;
&lt;p&gt;What I&amp;#39;m more conserned, that shouldn&amp;#39;t the notification be somehow acknowledged the received notification?&lt;/p&gt;
&lt;p&gt;And is there anywhere any explanation how this whole consept should work?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 (sdk2.0 v11) alert notification and android gatt server</title><link>https://devzone.nordicsemi.com/thread/49830?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2016 13:52:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01f97b94-dce5-4af2-8571-140d87e65b4a</guid><dc:creator>Matts</dc:creator><description>&lt;p&gt;In phone side:
I just increase the new alert and unread alert counter in those two characteristics. For new alert I also change the payload type (first byte) and actual payload.  The format is like the example value here: &lt;a href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.new_alert.xml"&gt;developer.bluetooth.org/.../CharacteristicViewer.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After that I just call gattserver.notifyCharacteristicChanged for both unread and new alert notification characteristics.&lt;/p&gt;
&lt;p&gt;In the nrf side I&amp;#39;ve added traces to all functions (special emphasis on event handlers) in ble_ans_c.c and main.c. In case of second notification i get no indications at all from any of those that something has occurred on.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll try the debugger tomorrow. Could you also suggest any special points of interest on the nrf side where I could add more traces?&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll update the question with update log.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 (sdk2.0 v11) alert notification and android gatt server</title><link>https://devzone.nordicsemi.com/thread/49829?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2016 11:10:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac238480-9cd2-4429-916e-a9fe900abf89</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;What you described is a little bit strange, on that you receive only one notification before you need to disconnect and reconnect. Could you debug a little bit more ? Maybe check if it&amp;#39;s the problem from the phone or from the nRF. You can use a sniffer to check if the notifications are sent but the nRF52 didn&amp;#39;t catch it or didn&amp;#39;t tell the application. You can run in debug mode and add a breakpoint at BLE_GATTC_EVT_HVX event to check if any event received.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 (sdk2.0 v11) alert notification and android gatt server</title><link>https://devzone.nordicsemi.com/thread/49828?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2016 05:44:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b124f0ec-b877-4226-b13d-e68b93b8b715</guid><dc:creator>Matts</dc:creator><description>&lt;p&gt;Hi Hung Bui.&lt;/p&gt;
&lt;p&gt;The nrf side example is unchanged from the original, other than enabling traces and adding some more.&lt;/p&gt;
&lt;p&gt;In my app side I have a button than changes char value and calls notifyCharacteristicChanged. I can get one notification through per connection. After that I have to disconnect to get another through. The alerts I send are SMS alert, Call alert and email alert. All go trough as single notification. Also the communication is still OK, as the alert disabling (with nrf buttons) cause call to android side descriptor write callback.&lt;/p&gt;
&lt;p&gt;Do I have to add some notification processing to app to make it accept more notifications? A flow how these things should be handled would be nice.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 (sdk2.0 v11) alert notification and android gatt server</title><link>https://devzone.nordicsemi.com/thread/49827?ContentTypeID=1</link><pubDate>Mon, 11 Apr 2016 12:31:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19dd257d-3301-4448-86cb-3496b03872e9</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Matts,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s a little bit unclear for me on what you did on the nRF52 side. Did you do service discovery, and when you have the characteristic&amp;#39;s handle ID, did you do a write to the CCCD to enable notification ?&lt;/p&gt;
&lt;p&gt;Note that there is no nCharacteristicRead event with BluetoothGattServerCallback.&lt;/p&gt;
&lt;p&gt;Have you called notifyCharacteristicChanged() from Android to start sending notification ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 (sdk2.0 v11) alert notification and android gatt server</title><link>https://devzone.nordicsemi.com/thread/49837?ContentTypeID=1</link><pubDate>Mon, 11 Apr 2016 09:40:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0dfe8770-735d-48d7-bc15-3821928d4795</guid><dc:creator>Matts</dc:creator><description>&lt;p&gt;Ok, the problem was that those descriptors needed to be unique. so 00002902 for one and second 10002902. After that the gattserver.sendresponse worked OK.&lt;/p&gt;
&lt;p&gt;EDIT3: one integer value interprited as hex.&lt;/p&gt;
&lt;p&gt;EDIT2: I think this whole problem is somehow related to character/service(?) rights. I changed the notifyCharacteristicChanged(BluetoothDevice device, BluetoothGattCharacteristic characteristic, boolean confirm) confirm-parameter to false and now I can send several notifications.&lt;/p&gt;
&lt;p&gt;HOWEVER if there&amp;#39;s more than few second pause, the&amp;#39;s timeout and connection is dropped. There seems to be ble_ans_c_new_alert_read. tx function doesn&amp;#39;t return any errors, but after while there&amp;#39;s ble_ans_c_on_ble_evt callback with BLE_GATTC_EVT_TIMEOUT -value.&lt;/p&gt;
&lt;p&gt;My New Alert -characteristic has pretty much all modes and priviledges enabled (for testing purposes). Or is this on nrf side?&lt;/p&gt;
&lt;p&gt;My service &amp;amp; characteristics &amp;amp;server connection code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    mGattServer = mBluetoothManager.openGattServer(this, serverCallback);

    mSupportedNewAlertCategory = new BluetoothGattCharacteristic(SampleGattAttributes.UUID_SUPPORTED_NEW_ALERT_CATEGORY,
            BluetoothGattCharacteristic.PROPERTY_READ | BluetoothGattCharacteristic.PROPERTY_WRITE,
            BluetoothGattCharacteristic.PERMISSION_READ | BluetoothGattCharacteristic.PERMISSION_WRITE);
    mSupportedNewAlertCategory.setValue(new byte[]{0x1f});
    /*
    * New alert part (char &amp;amp; descriptor)
    * */
    clientCharacteristicConfigNa = new BluetoothGattDescriptor(SampleGattAttributes.UUID_CLIENT_CHARACTERISTIC_CONFIG_NA,
            BluetoothGattDescriptor.PERMISSION_READ | BluetoothGattDescriptor.PERMISSION_WRITE);
    clientCharacteristicConfigNa.setValue(new byte[]{1});

    mNewAlert = new BluetoothGattCharacteristic(SampleGattAttributes.UUID_NEW_ALERT,
            BluetoothGattCharacteristic.PROPERTY_WRITE |BluetoothGattCharacteristic.PROPERTY_INDICATE | BluetoothGattCharacteristic.PROPERTY_NOTIFY | BluetoothGattCharacteristic.PROPERTY_READ,
            BluetoothGattCharacteristic.PERMISSION_READ | BluetoothGattCharacteristic.PERMISSION_WRITE);

    mNewAlert.addDescriptor(clientCharacteristicConfigNa);
    /*
    * Unread alert status associated with new alert
    * */
    clientCharacteristicConfigUa = new BluetoothGattDescriptor(SampleGattAttributes.UUID_CLIENT_CHARACTERISTIC_CONFIG_UA, BluetoothGattDescriptor.PERMISSION_READ | BluetoothGattDescriptor.PERMISSION_WRITE);
    clientCharacteristicConfigUa.setValue(new byte[]{1});

    mUnreadAlertStatus = new BluetoothGattCharacteristic(SampleGattAttributes.UUID_UNREAD_ALERT_STATUS,
            BluetoothGattCharacteristic.PROPERTY_NOTIFY | BluetoothGattCharacteristic.PROPERTY_INDICATE | BluetoothGattCharacteristic.PROPERTY_READ | BluetoothGattCharacteristic.PROPERTY_WRITE,
            BluetoothGattCharacteristic.PERMISSION_READ | BluetoothGattCharacteristic.PERMISSION_WRITE);
    mUnreadAlertStatus.addDescriptor(clientCharacteristicConfigUa);

    mSupportedUnreadCategory = new BluetoothGattCharacteristic(SampleGattAttributes.UUID_SUPPORTED_UNREAD_ALERT_CATEGORY,
            BluetoothGattCharacteristic.PROPERTY_READ | BluetoothGattCharacteristic.PROPERTY_INDICATE | BluetoothGattCharacteristic.PROPERTY_NOTIFY  | BluetoothGattCharacteristic.PROPERTY_WRITE,
            BluetoothGattCharacteristic.PERMISSION_READ | BluetoothGattCharacteristic.PERMISSION_WRITE);
    mSupportedUnreadCategory.setValue(new byte[]{0x1f});

    mAlertNotificationControlPoint = new BluetoothGattCharacteristic(SampleGattAttributes.UUID_ALERT_NOTIFICATION_CONTROL_POINT,
            BluetoothGattCharacteristic.PROPERTY_READ | BluetoothGattCharacteristic.PROPERTY_INDICATE | BluetoothGattCharacteristic.PROPERTY_NOTIFY | BluetoothGattCharacteristic.PROPERTY_WRITE,
            BluetoothGattCharacteristic.PERMISSION_READ | BluetoothGattCharacteristic.PERMISSION_WRITE);

    mAlertNotificationService = new BluetoothGattService(SampleGattAttributes.UUID_ALERT_NOTIFICATION_SERVICE, BluetoothGattService.SERVICE_TYPE_PRIMARY);

    mAlertNotificationService.addCharacteristic(mSupportedNewAlertCategory);
    mAlertNotificationService.addCharacteristic(mNewAlert);
    mAlertNotificationService.addCharacteristic(mSupportedUnreadCategory);
    mAlertNotificationService.addCharacteristic(mUnreadAlertStatus);
    mAlertNotificationService.addCharacteristic(mAlertNotificationControlPoint);

    mGattServer.addService(mAlertNotificationService);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>