<?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 add default services like hrs,battery and temperature in our program</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38855/how-to-add-default-services-like-hrs-battery-and-temperature-in-our-program</link><description>hi i am using nrf52840 s140 softdevice and 15.2 sdk. 
 can anyone tell how to add default services like hrs,battery and temperature in our own programs</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 Oct 2018 12:56:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38855/how-to-add-default-services-like-hrs-battery-and-temperature-in-our-program" /><item><title>RE: how to add default services like hrs,battery and temperature in our program</title><link>https://devzone.nordicsemi.com/thread/151447?ContentTypeID=1</link><pubDate>Wed, 03 Oct 2018 12:56:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:862fe8f2-df6a-4a3f-9382-805c80b7eadf</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Taking a closer look at the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fble_sdk_app_nus_eval.html&amp;amp;cp=4_0_0_4_1_2_24"&gt;BLE UART Emulation example&lt;/a&gt;&amp;nbsp;will provide an answer to your question. If you take a closer look at the ble_advertising.h file (&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Flib_ble_advertising.html&amp;amp;cp=4_0_0_3_2_1"&gt;Advertising module&lt;/a&gt;), you can see that&amp;nbsp;it includes an observer&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;.
.
.
NRF_SDH_BLE_OBSERVER(_name ## _ble_obs,                                                             \
                     BLE_ADV_BLE_OBSERVER_PRIO,                                                     \
                     ble_advertising_on_ble_evt, &amp;amp;_name); 
.
.
.
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Every time a BLE event happens (for example BLE_GAP_EVT_DISCONNECTED), the function &lt;em&gt;ble_advertising_on_ble_evt(..)&lt;/em&gt; is called. Inside that function&amp;nbsp;there is a switch case that will handle a disconnect event, and start advertising again through &lt;em&gt;on_disconnected(..)&lt;/em&gt;--&amp;gt;&lt;em&gt;ble_advertising_start(..)&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to add default services like hrs,battery and temperature in our program</title><link>https://devzone.nordicsemi.com/thread/150356?ContentTypeID=1</link><pubDate>Wed, 26 Sep 2018 04:14:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bc1a892-cef1-4553-aa4e-6a5cc5d9b1c7</guid><dc:creator>mohanraj360</dc:creator><description>&lt;p&gt;thanku simon iversen&lt;/p&gt;
&lt;p&gt;and i got one more problem, when i connect to the advertising device its connected and when disconnect it and its stops advertising and when i reset means its again starts advertising. what is the solution&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to add default services like hrs,battery and temperature in our program</title><link>https://devzone.nordicsemi.com/thread/150286?ContentTypeID=1</link><pubDate>Tue, 25 Sep 2018 13:32:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90f2b49c-2e17-46f5-9e94-5c133a460d56</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I would recommend you to go through these tutorials (uses SDK v15.0.0):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial"&gt;Bluetooth low energy Advertising, a beginner&amp;#39;s tutorial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-services-a-beginners-tutorial"&gt;Bluetooth low energy Services, a beginner&amp;#39;s tutorial&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial"&gt;Bluetooth low energy Characteristics, a beginner&amp;#39;s tutorial&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Number 2 is most relevant for you, initially it goes through some basic theory regarding GATT, services, characteristics and UUID&amp;#39;s. Then it will guide you, step by step, through the making of custom services.&lt;/p&gt;
&lt;p&gt;It is recommended to have gone through tutorial number 1 first, but not necessary. The last tutorial shows how to add characteristics to your custom services.&lt;/p&gt;
&lt;p&gt;This approach will give you a good understanding of services, and you will be able to add the default services you mentioned.&lt;/p&gt;
&lt;p&gt;If you have any more questions, please ask.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards, Simon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>