<?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 make GATT client aware of changes to a characteristic?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7739/how-to-make-gatt-client-aware-of-changes-to-a-characteristic</link><description>Hi, 
 I trying to write an application with android for my nRF51822 device
I use Battery service example but every time i update battery level i need to request for changed value from my android program, how to make battery service example push updated</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 21 Jun 2015 13:20:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7739/how-to-make-gatt-client-aware-of-changes-to-a-characteristic" /><item><title>RE: How to make GATT client aware of changes to a characteristic?</title><link>https://devzone.nordicsemi.com/thread/27564?ContentTypeID=1</link><pubDate>Sun, 21 Jun 2015 13:20:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12710107-5522-47ae-bd17-5e84b033888f</guid><dc:creator>Victor Nascimento</dc:creator><description>&lt;p&gt;To send data with notification, you have to do:
&lt;code&gt;memset(&amp;amp;hvx_params, 0, sizeof(hvx_params)); hvx_params.handle = p_nus-&amp;gt;rx_handles.value_handle; hvx_params.p_data = p_string; hvx_params.p_len = &amp;amp;length; hvx_params.type = BLE_GATT_HVX_NOTIFICATION; sd_ble_gatts_hvx(p_nus-&amp;gt;conn_handle, &amp;amp;hvx_params);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Take a look at the service file on the UART example. The file is &lt;code&gt;ble_nus.c&lt;/code&gt;. There you can find this function to send a string.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make GATT client aware of changes to a characteristic?</title><link>https://devzone.nordicsemi.com/thread/27563?ContentTypeID=1</link><pubDate>Sun, 21 Jun 2015 13:16:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0c7f3eb-022e-4ff9-a02f-ed18fa7c1d8b</guid><dc:creator>john kotkin</dc:creator><description>&lt;p&gt;As i said my problem is in nRF51822 not in android because i can get answer from my android application when i use mbed.org library battery example but with battery example from nordicsemi there is no update on characteristic and i can get updated value just by requesting from android program&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make GATT client aware of changes to a characteristic?</title><link>https://devzone.nordicsemi.com/thread/27562?ContentTypeID=1</link><pubDate>Sun, 21 Jun 2015 13:08:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99be39ad-7883-48df-babb-39b67f27e37e</guid><dc:creator>Victor Nascimento</dc:creator><description>&lt;p&gt;In my application, I follow the life-cycle:&lt;/p&gt;
&lt;p&gt;Scan -&amp;gt;
Connect -&amp;gt;
Discover Services -&amp;gt;
Subscribe to characteristic -&amp;gt;
Idle&lt;/p&gt;
&lt;p&gt;Then, the event comes on android as a subscription callback.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make GATT client aware of changes to a characteristic?</title><link>https://devzone.nordicsemi.com/thread/27561?ContentTypeID=1</link><pubDate>Sun, 21 Jun 2015 13:02:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8e8c872-bdc0-4ee1-99f3-59dc9afffbc9</guid><dc:creator>john kotkin</dc:creator><description>&lt;p&gt;If you mean this part hvx_params.type   = BLE_GATT_HVX_NOTIFICATION; i can see it&amp;#39;s notification on ble_bas.c service file but still i can get notification on change&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make GATT client aware of changes to a characteristic?</title><link>https://devzone.nordicsemi.com/thread/27560?ContentTypeID=1</link><pubDate>Sun, 21 Jun 2015 12:29:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7d45047-5bd5-4b73-9dda-f87dc5ea3e7d</guid><dc:creator>john kotkin</dc:creator><description>&lt;p&gt;Thank you for your answer, I don&amp;#39;t have any problem in android side my android program work okay if nrf51822 send notification for updated value but i don&amp;#39;t get it exactly i need to look for what? these notification and indication are where in my application?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make GATT client aware of changes to a characteristic?</title><link>https://devzone.nordicsemi.com/thread/27559?ContentTypeID=1</link><pubDate>Sun, 21 Jun 2015 12:16:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cade55a3-de9f-4255-8e27-2be2aaae4d15</guid><dc:creator>Victor Nascimento</dc:creator><description>&lt;p&gt;For this you have to use a Notification / Indication. Please have a look on the UART example. The TX characteristic has notification properties. On the App side, you have to subscribe to a particular characteristic and you will get an event callback whenever the BLE module writes to that characteristic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>