<?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 switch between peripheral mode and central mode?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15316/how-to-switch-between-peripheral-mode-and-central-mode</link><description>Hi there,I am using s130, my device is now working at peripheral mode, it&amp;#39;s advertising. I want to switch it into central mode by pressing a button. and switch back to peripheral mode when I press the button again. Anyone can help or give me some idea</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Jul 2016 13:40:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15316/how-to-switch-between-peripheral-mode-and-central-mode" /><item><title>RE: how to switch between peripheral mode and central mode?</title><link>https://devzone.nordicsemi.com/thread/58535?ContentTypeID=1</link><pubDate>Mon, 25 Jul 2016 13:40:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4d745d0-f788-4900-82d6-4bad78294a33</guid><dc:creator>Manhull1989</dc:creator><description>&lt;p&gt;I did it by refering to example ble_app_hrs_rscs_relay, thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to switch between peripheral mode and central mode?</title><link>https://devzone.nordicsemi.com/thread/58534?ContentTypeID=1</link><pubDate>Mon, 25 Jul 2016 12:24:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69473961-a6bd-4e6d-93d5-5d28d02e93d4</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/?answer=60126#post-id-60126"&gt;Does it restart because you call a function that returns an error?&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to switch between peripheral mode and central mode?</title><link>https://devzone.nordicsemi.com/thread/58533?ContentTypeID=1</link><pubDate>Mon, 25 Jul 2016 02:29:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1958bac3-646f-4f93-b9b4-6ad61e5fdb9d</guid><dc:creator>Manhull1989</dc:creator><description>&lt;p&gt;Thanks RK!&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;I do this on system start:&lt;/p&gt;
&lt;p&gt;ble_stack_init();
gap_params_init();
services_init();
advertising_init();
conn_params_init();
ble_advertising_start(BLE_ADV_MODE_FAST);
db_discovery_init();
nus_c_init();&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;2.when I press the button:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_advertising_start(BLE_ADV_MODE_IDLE);
sd_ble_gap_adv_stop();
scan_start();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;but when I do step 2, the system restart, I don&amp;#39;t know what is wrong and how to deal with it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to switch between peripheral mode and central mode?</title><link>https://devzone.nordicsemi.com/thread/58532?ContentTypeID=1</link><pubDate>Mon, 25 Jul 2016 01:32:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0928cace-c06e-434c-ac11-ceeebe6bffa9</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;well what have you tried? Since S130 can be both peripheral and central at the same time all you have to do is advertise when you want to be in peripheral mode and scan when you want to be in central mode. Nothing special required.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>