<?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 change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18334/how-to-change-from-ble-central-to-peripheral-mode-by-buttons</link><description>Hi, I was wondering how to change from central mode of the NRF52 board to peripheral mode and from peripheral mode to central mode by pressing the input buttons on the board. For example, button 1 would enable the central mode which is when the NRF52</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Dec 2016 11:20:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18334/how-to-change-from-ble-central-to-peripheral-mode-by-buttons" /><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70805?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2016 11:20:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7dcb0d7-8273-4394-8527-cca91631d4ed</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Here is a project which use UART/printf instead of NRF_LOG: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_hrs_5F00_nus_5F00_printf.zip"&gt;ble_app_hrs_nus_printf.zip&lt;/a&gt;. If you are only using NUS, you should use combine the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/ble_sdk_app_nus_eval.html?cp=4_0_1_4_2_2_18"&gt;ble_app_uart&lt;/a&gt; and &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/ble_sdk_app_nus_c.html?cp=4_0_1_4_2_0_2"&gt;ble_app_uart_c&lt;/a&gt; applications to have both peripheral and central with UART communication.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70804?ContentTypeID=1</link><pubDate>Sat, 24 Dec 2016 20:22:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:237b9c02-d568-4792-8236-3e381e850793</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Yes, I tried the instruction that you gave me with the NRF_LOG_ENABLED 0 and the RETARGET_ENABLED 1, but then when I run the code and observe the terminal, there were no words and it is blank meaning that it is not printing correctly. Also, put printf() on the main.c code instead of NRF_LOG_INFO Is there anything else that I need to do? Do you think if I don&amp;#39;t use the heart rate service in the future, which example from the ones that you provided in the SDK is suitable? As I said before, I need something that is able to have UART communication as well have a user application that can have both central and peripheral. Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70803?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2016 11:36:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1325267-a6bc-428d-8522-3e2cd4d43c53</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;If you are not planning to connect any devices that is running the heart rate service, it would just be waste of space and resources to have code that handles this on the device, but if you are planning to connect such devices in the future, this should be OK. You can call &lt;code&gt;uart_init()&lt;/code&gt;, just not if you have NRF_LOG with UART backend enabled. If you disable the logging module (set &lt;code&gt;NRF_LOG_ENABLED 0&lt;/code&gt; in &lt;em&gt;sdk_config.h&lt;/em&gt;) and adds &lt;code&gt;#define RETARGET_ENABLED 1&lt;/code&gt; in the same file, you can call &lt;code&gt;uart_init()&lt;/code&gt; and use &lt;code&gt;printf()&lt;/code&gt; in place of &lt;code&gt;NRF_LOG_INFO()&lt;/code&gt; for UART logging.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70802?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 17:29:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3969272d-9e71-4d1e-b18a-ba65fb8280b3</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Basically, my application is used to connect to both central and/or peripheral devices.I am using a single central code which is the HRS example with some modifications because I thought it would be easier since it already had the central and peripheral implementation.  However, for my application, there needs to be UART service implemented for which there is a central UART terminal which will send data to the peripheral UART terminal through the user application. This is why I used the UART example that was provided and was trying to combine both UART and the HRS example. Currently I do not have any heart rate devices but other devices such as GoPro that I want to connect. Is this alright to do or do we need to handle it in a different way?&lt;/p&gt;
&lt;p&gt;UPDATE: Also wanted to ask how I can use the uart_event_handle() in the HRS example? It contains the necessary function ble_nus_c_string_send which would allow the user to send information through UART.  It is because in the UART example, it is called in the uart_init() method which cannot be used for the HRS example like you described.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70800?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 15:35:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c8f2c56-7113-4a05-bd8c-3246e28b6398</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Yes. Are you trying to create an application that can either connect to HRS devices or to NUS devices? Typically it would be more convenient to create a single central code and handle the different services when discovered. If you want to handle both services on a device, you might have to handle this in another way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70801?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 15:08:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f87d1ac6-1b87-46d2-97d0-d5503772e45d</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Thank you for the response. How about the discovery handler, should I do the similar process to the dispatch as you suggested and add the method call inside the db_disc_handler(ble_db_discovery_evt_t * p_evt) in the HRS example?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void db_disc_handler(ble_db_discovery_evt_t * p_evt)

    ble_hrs_on_db_disc_evt(&amp;amp;m_ble_hrs_c, p_evt);
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70797?ContentTypeID=1</link><pubDate>Tue, 20 Dec 2016 09:42:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f4d5fdb-9675-49e3-801f-f21fb48a9c56</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You should dispatch all the ble events inside the same &lt;code&gt;ble_evt_dispatch()&lt;/code&gt; function, not in two separate functions. Just add &lt;code&gt;ble_nus_c_on_ble_evt(&amp;amp;m_ble_nus_c,p_ble_evt)&lt;/code&gt; inside &lt;code&gt;ble_evt_dispatch()&lt;/code&gt; in the HRS example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70799?ContentTypeID=1</link><pubDate>Mon, 19 Dec 2016 18:11:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a537fdd-2f0f-497f-a470-049b46542e35</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Thank you I have successfully fixed the L6218E errors. Last question, as I was observing the ble_app_uart_c I noticed some of the methods in that example code which are not included in my code. Is it neccessary to another ble_evt_dispatch method for the calling of &amp;amp;m_ble_nus_c. Currently there is another dispatch for &amp;amp;m_hrs.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;p&gt;From the ble_app_uart example&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void ble_evt_dispatch(ble_evt_t * p_ble_evt)
{
    on_ble_evt(p_ble_evt);
    bsp_btn_ble_on_ble_evt(p_ble_evt);
    ble_db_discovery_on_ble_evt(&amp;amp;m_ble_db_discovery, p_ble_evt);
    **ble_nus_c_on_ble_evt(&amp;amp;m_ble_nus_c,p_ble_evt);**
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;From the BLE hrs_multi example&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void ble_evt_dispatch(ble_evt_t * p_ble_evt)

{
    uint16_t conn_handle;
    uint16_t role;

    ble_conn_state_on_ble_evt(p_ble_evt);
    pm_on_ble_evt(p_ble_evt);

    // The connection handle should really be retrievable for any event type.
    conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
    role        = ble_conn_state_role(conn_handle);

    // Based on the role this device plays in the connection, dispatch to the right applications.
    if (role == BLE_GAP_ROLE_PERIPH)
    {
        // Manages peripheral LEDs.
        on_ble_peripheral_evt(p_ble_evt);

        ble_advertising_on_ble_evt(p_ble_evt);
        ble_conn_params_on_ble_evt(p_ble_evt);

        // Dispatch to peripheral applications.
        **ble_hrs_on_ble_evt (&amp;amp;m_hrs, p_ble_evt);**
.......
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70798?ContentTypeID=1</link><pubDate>Mon, 19 Dec 2016 17:10:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c134f55a-d850-48bf-b1e0-fbb063e7e18f</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;If you get L6218E errors, you either have not included the correct source file, or have not enabled the module in the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/sdk_config.html?cp=4_0_1_1_6"&gt;SDK configuation header file&lt;/a&gt;. I looked through you code and see that you are calling &lt;code&gt;nus_c_init()&lt;/code&gt; before &lt;code&gt;ble_stack_init()&lt;/code&gt;. &lt;code&gt;nus_c_init()&lt;/code&gt; contains calls to softdevice functions, so calling this before enabling the softdevice/bluetooth stack will lead to an error. I&amp;#39;m not sure if you have enabled the NRF_LOG module in the SDK configuration header, but if you have, you should not call uart_init(). This will lead to the hardware UART interface being initialized two times. I recommend to use the NRF_LOG module. I attached a working Keil project containing your code and my fixes: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_hrs_5F00_nus.zip"&gt;ble_app_hrs_nus.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70796?ContentTypeID=1</link><pubDate>Mon, 19 Dec 2016 14:19:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:215b0516-56a9-459c-910a-928a1fb8bdd9</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Thank you that is what I have done. However, when I flashed the code in the NRF52 board and checked in the UART terminal, it would give me a APP_ERROR:ERROR:Fatal when attempting to have a UART service as we discussed before. I was not sure why though.&lt;/p&gt;
&lt;p&gt;Should I keep the m_ble_nus_c and the m_ble_hrs_c variables because I am trying to implement the m_ble_nus_c similar to the UART example that you have provided, but still implement it within the heart rate example?&lt;/p&gt;
&lt;p&gt;UPDATE: The line number for the error code is 0x6508, the p_file_name is 0x000281D5, and the error code is 0x00000106.&lt;/p&gt;
&lt;p&gt;Here is what I have so far if you wanted to take a look at it.
&lt;a href="https://gist.github.com/anonymous/26f0a96596d019c414d641fe2c5a157f"&gt;gist.github.com/.../26f0a96596d019c414d641fe2c5a157f&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70795?ContentTypeID=1</link><pubDate>Mon, 19 Dec 2016 09:20:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:715b65ea-c9cd-4c07-9689-794cca8ab8ea</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Is the file not added when you try to add it to the Keil project? If you are using SDK 12.x, you also have to enable the module in the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/sdk_config.html?cp=4_0_1_1_6"&gt;SDK configuration header&lt;/a&gt;, by setting &lt;code&gt;#define APP_UART_ENABLED 1&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70794?ContentTypeID=1</link><pubDate>Fri, 16 Dec 2016 16:11:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97a1034c-9fea-45b9-b981-9c9e36be91cc</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Thanks for you help. When I was implementing the UART example and attempted to compile the main.c file, there was an error L6218E. I was trying to import the libraries such as the app_uart_fifo.c to the project that I have but it doesn&amp;#39;t allow me to do that even when I right clicked to on the project tab and  tried to add the existing files. Any ideas?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70793?ContentTypeID=1</link><pubDate>Fri, 16 Dec 2016 15:29:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a4571d8-81ca-4c90-83e1-1a5346b8b281</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You have to study the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/ble_sdk_app_nus_eval.html?cp=4_0_1_4_2_2_18"&gt;ble_app_uart&lt;/a&gt; example. The handler function should could be implemented in &lt;em&gt;main.c&lt;/em&gt; or any other file you see fit. Have a look at the &lt;code&gt;nus_data_handler()&lt;/code&gt; function in the example. &lt;em&gt;nrf_drv_uart.c&lt;/em&gt; is used for controlling the hardware UART interface, it has nothing to do with BLE NUS. What you are looking for is propably &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/group__ble__nus.html?cp=4_0_1_6_4_22"&gt;&lt;em&gt;ble_nus.h/c&lt;/em&gt;&lt;/a&gt;, which can be found in &lt;code&gt;[SDK_ROOT]\components\ble\ble_services&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70792?ContentTypeID=1</link><pubDate>Fri, 16 Dec 2016 14:47:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:084cb146-de8d-41c9-8f2c-afbe45fc2f3c</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Ok I will add it to the GATT table. Where should I add the handler functions? Would it be in the main.c file?  Also, I noticed that there is a nrf_drv_uart.c driver file that came with the SDK. Do you think I can utilize that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70791?ContentTypeID=1</link><pubDate>Fri, 16 Dec 2016 14:37:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efac5617-d813-4dbf-9ee9-fa348fc39b89</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;This should not be a problem, you just have to add the relevant service/characteristics to the GATT table in the relay example, and add the corresponding handler functions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70790?ContentTypeID=1</link><pubDate>Fri, 16 Dec 2016 14:33:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:babac3fe-9a1e-4e7f-a1f7-d09c204e35c1</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Nordic UART Service over BLE but I wanted to implement with the BLE relay example. The reason is that I want to create an application where central can connect to any peripherals and also the central can transmit data to any peripheral device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70789?ContentTypeID=1</link><pubDate>Fri, 16 Dec 2016 14:28:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da980240-15e7-48c6-9c15-d06ba8546387</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hardware UART or Nordic UART Service/UART emulation over BLE?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70788?ContentTypeID=1</link><pubDate>Fri, 16 Dec 2016 14:15:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cecab93-23e7-405a-846a-0e282baaff4b</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Thank you for you answer. It really helped. Also, do you think there is a way to implement UART for the BLE relay example?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70787?ContentTypeID=1</link><pubDate>Thu, 15 Dec 2016 10:31:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f9e6e8a-08a1-4126-93b3-94d0a871d873</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;It should be possible, but we don&amp;#39;t have any examples showing this. You will have to initialize buttons in main, and do all initialization of the program you want to run, and shutdown of the currently running program, in the button event handler (you can also use a flag and do initialization in main based on the set flag). I attached pseudocode to show principle:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;enum OP_MODE {INIT,CENTRAL,PERIPHERAL);
OP_MODE mode = INIT;

button_event_handler()
{
	switch (button_evt)
	case BUTTON_0: //Switch to Central mode
		if(mode == PERIPHERAL)
		{
			advertising_stop();
		}
		init_central();
		start_scan();
		mode = CENTRAL;
	break;
	
	case BUTTON_1: //Switch to Peripheral mode
		if(mode == CENTAL)
		{
			scan_stop();
		}
		init_peripheral();
		advertising_start();
		mode = PERIPHERAL;
	break;
	
	case BUTTON_2: //Turn off both modes
		if(mode == CENTAL)
		{
			advertising_stop();
		}
		else if(mode == PERIPHERAL)
		{
			scan_stop();
		}
		mode = INIT;
	break;
	
	default:
	break;
}

main()
{
	buttons_init();
	ble_stack_init();
	while(1)
	{
		sd_app_evt_wait();
	}
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70786?ContentTypeID=1</link><pubDate>Wed, 14 Dec 2016 15:50:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19e1019d-208b-42fd-9004-73a708f40c23</guid><dc:creator>Jimmy</dc:creator><description>&lt;p&gt;Hi, thanks for your response. Do you know if there is a way that I can run an example code for each button that I press. For example, for button 1, is there a way to run the Central mode connection example that you provided and for button 2 have a peripheral mode example code run. I wasn&amp;#39;t sure how to do that in the BLE Relay example. I know that I have to call  the button_handler method, but I was not sure how to move forward from that. Please let me know if you have any questions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70785?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2016 11:37:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30bd2d49-7bd4-4e08-ba3a-ffa67e1a93a1</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://www.nordicsemi.com/eng/nordic/Products/nRF51422/S130-SD-v2/53727"&gt;S130&lt;/a&gt; (nRF51) and &lt;a href="http://www.nordicsemi.com/eng/nordic/Products/nRF52832/S132-SD-v3/56261"&gt;S132&lt;/a&gt; (nRF52) softdevices are capable of running concurrently in peripheral and central mode with up to 8 individual links (up to 20 in latest &lt;a href="http://www.nordicsemi.com/eng/nordic/Products/nRF52832/S132-SD-v4/58803"&gt;S132 v4.0.0 alpha release&lt;/a&gt;). You are therefore not required to switch from central to peripheral mode and back, but you can of course do this if you want to. It is also possible to configure button presses to start advertising/scanning for a predefined period of time if this is what you want.&lt;/p&gt;
&lt;p&gt;I recommand that you take a look at the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/ble_sdk_app_rscs_relay.html"&gt;BLE Relay example&lt;/a&gt; and &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/ble_sdk_app_multirole_lesc.html"&gt;the BLE LE Secure Connections multirole example&lt;/a&gt;, which both use concurrent paripheral and central mode.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change from BLE central to peripheral mode by buttons</title><link>https://devzone.nordicsemi.com/thread/70784?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2016 08:01:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f5c7b05-9ae7-4098-ae3c-cfdabfaf082f</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;You have 2 entirely separate and unrelated things here:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Detecting button presses;&lt;/li&gt;
&lt;li&gt;Switching between Central &amp;amp; Peripheral modes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So which one do you actually require the help with?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>