<?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>battery service</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8876/battery-service</link><description>I&amp;#39;m working on a project and want to use the battery service to do that, send notification when the battery reach to 75%, I decided to use the battery service found on the sdk files &amp;amp; simply like the ble_app_hrs application but I&amp;#39;ll do some edits 
 the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Aug 2015 12:13:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8876/battery-service" /><item><title>RE: battery service</title><link>https://devzone.nordicsemi.com/thread/32653?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2015 12:13:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a872027-f3a7-4259-8f20-6ce747d62919</guid><dc:creator>Mohamed O.Abouzeid</dc:creator><description>&lt;p&gt;thank u michael :) :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: battery service</title><link>https://devzone.nordicsemi.com/thread/32656?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2015 11:52:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:772d5559-aa7c-4c55-9f2b-18441dc51749</guid><dc:creator>Michael Dietz</dc:creator><description>&lt;p&gt;Yes, I think you are correct and you are on the right track. You should be able to test it and see if it works how you think it will. I haven&amp;#39;t actually implemented this myself.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: battery service</title><link>https://devzone.nordicsemi.com/thread/32655?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2015 11:45:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:986730b6-7d4c-4233-b625-608163da61fd</guid><dc:creator>Mohamed O.Abouzeid</dc:creator><description>&lt;p&gt;I won&amp;#39;t call the ble_bas_battery_level_update untill the battery reaches to a certain voltage &amp;amp; the&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;battery_level = (uint8_t)sensorsim_measure(&amp;amp;m_battery_sim_state, &amp;amp;m_battery_sim_cfg);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;is the indication of the battery level &amp;amp; we can use it to indicate the battery level and take actions upon it inside the battery_level_update or any other function
is that true ? ?&lt;/p&gt;
&lt;p&gt;thank you for your help again&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: battery service</title><link>https://devzone.nordicsemi.com/thread/32654?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2015 11:43:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:252a84ed-348c-40b8-9f89-50d21cc2d556</guid><dc:creator>Mohamed O.Abouzeid</dc:creator><description>&lt;p&gt;thank you for your help, what I&amp;#39;m thinking about is to do something like this, is that true ? ?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;	/**@brief Function for performing a battery measurement, and update the Battery Level characteristic in the Battery Service.
 */
static void battery_level_update(void)
{
		uint32_t err_code;
		uint8_t  battery_level;

		battery_level = (uint8_t)sensorsim_measure(&amp;amp;m_battery_sim_state, &amp;amp;m_battery_sim_cfg);
		//set the condition for sending notification
	if(battery_level == 100)
	{
		err_code = ble_bas_battery_level_update(&amp;amp;m_bas, battery_level);
		if ((err_code != NRF_SUCCESS) &amp;amp;&amp;amp;
				(err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp;
				(err_code != BLE_ERROR_NO_TX_BUFFERS) &amp;amp;&amp;amp;
				(err_code != BLE_ERROR_GATTS_SYS_ATTR_MISSING)
		)
		{
				APP_ERROR_HANDLER(err_code);
		}
	}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: battery service</title><link>https://devzone.nordicsemi.com/thread/32652?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2015 07:27:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8deadfb-c2c8-4137-af7e-20656b4a6da2</guid><dc:creator>Michael Dietz</dc:creator><description>&lt;p&gt;See ble_bas.h:&lt;/p&gt;
&lt;p&gt;ble_bas_battery_level_update(...) is called by the application (probably main.c for you) after performing a battery measurement. If notifications are enabled for this service (they are by default, see services_init() in main.c) and the battery level has changed from the last reading, then the battery level characteristic is sent to the client over your ble connection.&lt;/p&gt;
&lt;p&gt;What this means for you is that every time you measure your battery level you will want to call ble_battery_level_update(...). At this point every time the battery level changes the value will be sent over ble. But if you only want to update the value when it reaches a predefined level (say 75%) then keep notifications disabled by default bas_init.support_notification = false; and make this true only when you read 75%. Then set it back to false or whatever you want.&lt;/p&gt;
&lt;p&gt;Experiment with this and let me know if it works!
-Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: battery service</title><link>https://devzone.nordicsemi.com/thread/32651?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2015 01:56:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae02497e-f079-488b-8fee-8d0b39d46b4a</guid><dc:creator>Mohamed O.Abouzeid</dc:creator><description>&lt;p&gt;any help please !!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>