<?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>Easiest way for two nRF52x devices to ping each other?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19708/easiest-way-for-two-nrf52x-devices-to-ping-each-other</link><description>Greetings Nords,
total noob here,
I&amp;#39;ve got two preview nRF52840 devices (as well as the two normal nRF52 devices),
I want my two preview devices to be able to ping each other,
what is the easiest way to achieve this? Do I need to setup a router, or</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Mar 2017 07:59:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19708/easiest-way-for-two-nrf52x-devices-to-ping-each-other" /><item><title>RE: Easiest way for two nRF52x devices to ping each other?</title><link>https://devzone.nordicsemi.com/thread/76689?ContentTypeID=1</link><pubDate>Mon, 20 Mar 2017 07:59:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad6dd2e4-fc4a-4ae1-9181-ece398035881</guid><dc:creator>embo san</dc:creator><description>&lt;p&gt;I think it already is&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Easiest way for two nRF52x devices to ping each other?</title><link>https://devzone.nordicsemi.com/thread/76688?ContentTypeID=1</link><pubDate>Mon, 20 Mar 2017 07:57:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cde8a2c4-f2f3-40f6-ab01-e25f1452a8a8</guid><dc:creator>Adrian Eggenberger</dc:creator><description>&lt;p&gt;I was looking for long range example code and found this answer. Great! When will the softdevice support the long range advertising?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Easiest way for two nRF52x devices to ping each other?</title><link>https://devzone.nordicsemi.com/thread/76687?ContentTypeID=1</link><pubDate>Wed, 15 Feb 2017 13:51:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:180e21f7-0bec-4369-98d3-9c2a4a0a884d</guid><dc:creator>embo san</dc:creator><description>&lt;p&gt;thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Easiest way for two nRF52x devices to ping each other?</title><link>https://devzone.nordicsemi.com/thread/76686?ContentTypeID=1</link><pubDate>Wed, 15 Feb 2017 13:42:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6ebaf86-fd88-4576-bc33-1c2b567b7b73</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;If you just want two nRF52840 kits to talk to each other you can use any combination of central and peripheral in the SDK.&lt;/p&gt;
&lt;p&gt;If you want bluetooth long range you need to be in a connection and set the PHYsical layer data rate. The SoftDevice does not support long range advertising at the moment. One example that shows how to set the PHY data rate is the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v13.0.0/ble_sdk_app_att_mtu.html?cp=4_0_0_4_2_1_0"&gt;ATT MTU throughput example&lt;/a&gt;, but you can easily modify any examples to change to long range mode during a connection. What you have to do is first set the preferred PHY at startup to include long range mode (called CODED_PHY), for example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_opt_t opts;
memset(&amp;amp;opts, 0x00, sizeof(ble_opt_t));

opts.gap_opt.preferred_phys.tx_phys = BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_CODED;
opts.gap_opt.preferred_phys.rx_phys = BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_CODED;

ret_code_t err_code = sd_ble_opt_set(BLE_GAP_OPT_PREFERRED_PHYS_SET, &amp;amp;opts);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then when you connect (for example in on_ble_gap_evt_connected(..) function) you have to call sd_ble_gap_phy_request(..) from either the peripheral or the central to actually set the PHY data rate:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_gap_phys_t phys =
{
    .tx_phys = BLE_GAP_PHY_CODED,
    .rx_phys = BLE_GAP_PHY_CODED,
};

err_code = sd_ble_gap_phy_request(p_gap_evt-&amp;gt;conn_handle, &amp;amp;phys);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should also check that you get the BLE_GAP_EVT_PHY_UPDATE event in &lt;code&gt;on_ble_evt(..)&lt;/code&gt; and check that the PHY data rate was set correctly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Easiest way for two nRF52x devices to ping each other?</title><link>https://devzone.nordicsemi.com/thread/76685?ContentTypeID=1</link><pubDate>Wed, 15 Feb 2017 13:26:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:435ca729-8f41-4ab3-b571-8dfc11c3035f</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;What do you mean by, &amp;quot;ping&amp;quot; in this context?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>