<?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>Where is the code of reading battery level?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20524/where-is-the-code-of-reading-battery-level</link><description>Hi Nordic team,
I print logs at each function in ble_bas.c. I used the App of nRF connect to test BAS. I can see on_connect, on_disconnect and on_write at enabling/disabling notification. I cannot see the code of reading battery level when I pressed</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 Mar 2017 09:54:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20524/where-is-the-code-of-reading-battery-level" /><item><title>RE: Where is the code of reading battery level?</title><link>https://devzone.nordicsemi.com/thread/80020?ContentTypeID=1</link><pubDate>Fri, 24 Mar 2017 09:54:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a62c817-b5e9-49c5-946b-bbf8b2dcf9bb</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v4.0.2/group___b_l_e___g_a_t_t_s___r_e_a_d___r_e_q___n_o___a_u_t_h___m_s_c.html?cp=2_3_0_1_1_2_4_3_14"&gt;The read&lt;/a&gt; will be handled by the softdevice. If the peer perfomes a read it will simply reply to that without notifying the application. It is possible to &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v4.0.2/group___b_l_e___g_a_t_t_s___r_e_a_d___r_e_q___a_u_t_h___m_s_c.html?cp=2_3_0_1_1_2_4_3_13"&gt;use authorization&lt;/a&gt; if wanted.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Where is the code of reading battery level?</title><link>https://devzone.nordicsemi.com/thread/80019?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2017 05:50:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8be157e9-a3f9-40e9-ab54-f347916e27d2</guid><dc:creator>Ted</dc:creator><description>&lt;p&gt;I am tracing the source code of ble_bas.c in SDK11. I can get battery level correctly when I press the button (read battery level, please see the attach file in red circle) on APP. But I cannot see the source code of reading battery level in ble_bas.c. I want to know where it it. Enabling/disabling notification will run the function of on_write. Which function will be run if I read the battery level from APP? Thanks you very much.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Where is the code of reading battery level?</title><link>https://devzone.nordicsemi.com/thread/80018?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2017 12:22:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd49780d-59c0-4162-8580-5c1483cd580b</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;The battery is emulated so the actual code to &amp;quot;measure the battery level&amp;quot; is in the function battery_level_update which is called from the battery_level_meas_timeout_handler.&lt;/p&gt;
&lt;p&gt;However we have an example that shows how you can do battery measurements on the nRF51 &lt;a href="https://github.com/NordicSemiconductor/nrf51-ADC-examples/tree/master/ble_app_hrs_adc_battery_measurement"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>