<?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 can I read batt service and value of characteristic?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21404/how-can-i-read-batt-service-and-value-of-characteristic</link><description>I connected by centrale to peripherial on NRF51 SDK9.
Wich function can I observe value of my batt level?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Apr 2017 14:39:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21404/how-can-i-read-batt-service-and-value-of-characteristic" /><item><title>RE: how can I read batt service and value of characteristic?</title><link>https://devzone.nordicsemi.com/thread/83904?ContentTypeID=1</link><pubDate>Tue, 18 Apr 2017 14:39:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0353cc87-27dd-4498-848a-97c186d0591a</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;thanks for aswer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how can I read batt service and value of characteristic?</title><link>https://devzone.nordicsemi.com/thread/83903?ContentTypeID=1</link><pubDate>Tue, 18 Apr 2017 14:16:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d5209a5-bb6a-418a-8389-0767a1b0da77</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I recommend adding the Battery Service Client module(ble_bas_c) to your central application. It&amp;#39;s located in the folder &lt;code&gt;SDK_folder\components\ble\ble_services\ble_bas_c&lt;/code&gt;. The ble_app_hrs_c example(&lt;code&gt;SDK_folder\examples\ble_central\ble_app_hrs_c&lt;/code&gt;) in the SDK uses this module, so take a look at that example to see how to implement the module into your central application.&lt;/p&gt;
&lt;p&gt;The module will enable &lt;em&gt;Battery Level Notification&lt;/em&gt; if the Batttery service is discovered at the peer, and you will receive the battery level on the &lt;code&gt;BLE_BAS_C_EVT_BATT_NOTIFICATION&lt;/code&gt; event:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;case BLE_BAS_C_EVT_BATT_NOTIFICATION:
     printf(&amp;quot;Battery = %d %%\r\n&amp;quot;, p_bas_c_evt-&amp;gt;params.battery_level);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Take a look at the &lt;code&gt;bas_c_evt_handler()&lt;/code&gt; function in main.c in the ble_app_hrs_c example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>