<?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 stop a service then start another service?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27853/how-to-stop-a-service-then-start-another-service</link><description>Hi all,
I want accive this situation. My peripheral connecting a central with a service for example hrs, then i stop the conect with the function sd_ble_gap_disconnect(m_conn_handle_peripheral, BLE_HCI_STATUS_CODE_SUCCESS).
Then i want to stop the service</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 23 Nov 2015 10:07:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27853/how-to-stop-a-service-then-start-another-service" /><item><title>RE: How to stop a service then start another service?</title><link>https://devzone.nordicsemi.com/thread/109754?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2015 10:07:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddc81922-32a5-4d34-bc8e-11d3e58f70f5</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;If you insist on changing the attribute table this is possible by disabling / re-enabling the softdevice. However note that some masters cache the attribute table so you will also need to send service changed indications. A better solution would normally be to populate the attribute table with all the services you need. The peer will have to subscribe to notificaitons/indications anyway...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to stop a service then start another service?</title><link>https://devzone.nordicsemi.com/thread/109753?ContentTypeID=1</link><pubDate>Sun, 22 Nov 2015 17:17:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99e0bd3b-8b09-4280-9552-25e0d6f26651</guid><dc:creator>shibshab</dc:creator><description>&lt;p&gt;This can be achieved by restarting the softdevice.&lt;/p&gt;
&lt;p&gt;When &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v1.0.0/group___n_r_f___s_d_m___f_u_n_c_t_i_o_n_s.html?cp=2_7_2_1_0_2_5_4_0#ga45900ecbe6d5ebf9ae78894fe6c75b23"&gt;sd_softdevice_disable&lt;/a&gt; is called, all memory used by the softdevice is freed. This includes the GATT database.&lt;/p&gt;
&lt;p&gt;After re-starting the softdevice, you can re-populate the GATT database with the new service. (Note that you also need to call sd_ble_enable to re-enable the BLE extension of the softdevice).&lt;/p&gt;
&lt;p&gt;To update the advertisement data, simply call sd_ble_gap_adv_data_set.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to stop a service then start another service?</title><link>https://devzone.nordicsemi.com/thread/109752?ContentTypeID=1</link><pubDate>Fri, 20 Nov 2015 18:45:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64dc65fb-090f-4de4-8e11-8a70a2aa4b53</guid><dc:creator>Eric Stutzenberger</dc:creator><description>&lt;p&gt;Why do you want to do this exactly?  You can add multiple services to your GATT table.  Then you don&amp;#39;t need to add and remove services from the table.&lt;/p&gt;
&lt;p&gt;When calling sd_ble_gap_disconnect(), you should provide the remote client terminated connection reason instead of the success reason:
sd_ble_gap_disconnect(m_conn_handle_peripheral, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>