<?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>nRF51822/ BLE nano: Connect to a blue tooth by address</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18514/nrf51822-ble-nano-connect-to-a-blue-tooth-by-address</link><description>I am developing a script that runs on the nRF51822/ BLE nano to connect to other devices using blue tooth low energy. To do this currently I am looking at the heart rate example that comes with the Nordic SDK. The problem I am having is that the central</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 11 Jan 2017 08:16:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18514/nrf51822-ble-nano-connect-to-a-blue-tooth-by-address" /><item><title>RE: nRF51822/ BLE nano: Connect to a blue tooth by address</title><link>https://devzone.nordicsemi.com/thread/71451?ContentTypeID=1</link><pubDate>Wed, 11 Jan 2017 08:16:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc5ccea6-baed-45b2-b4c8-407437139623</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Yes, you have to be in the scanning state and respond right after receiving the advertisement package when connecting. &lt;a href="https://devzone.nordicsemi.com/question/13222/nrf51822-connect-without-advertising/?answer=13223#post-id-13223"&gt;You cannot connect directly using the address&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822/ BLE nano: Connect to a blue tooth by address</title><link>https://devzone.nordicsemi.com/thread/71450?ContentTypeID=1</link><pubDate>Tue, 10 Jan 2017 16:47:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4d2e0b8-ca8b-4a3b-8727-de4a0d128413</guid><dc:creator>tyler</dc:creator><description>&lt;p&gt;Do I have to wait for the on_ble_evt to fire before doing this?  Like basically I&amp;#39;m asking if I can just enter in an address and have the device connect or if you need to wait for them to find each other first?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822/ BLE nano: Connect to a blue tooth by address</title><link>https://devzone.nordicsemi.com/thread/71449?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2016 09:51:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a856644-0439-4f44-a41a-f23730ce9f7b</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;If you want to connect to a specified address you should do something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static const uint8_t m_target_periph_addr[6] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF};

if (memcmp(m_target_periph_addr, p_adv_report-&amp;gt;peer_addr.addr, sizeof(p_adv_report-&amp;gt;peer_addr.addr)) == 0)
{
    sd_ble_gap_connect(&amp;amp;p_gap_evt-&amp;gt;params.adv_report.peer_addr,
                       &amp;amp;m_scan_param,
                       &amp;amp;m_connection_param);
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822/ BLE nano: Connect to a blue tooth by address</title><link>https://devzone.nordicsemi.com/thread/71448?ContentTypeID=1</link><pubDate>Mon, 26 Dec 2016 20:10:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f45f602e-b69a-4aa2-b966-8bfeaeb4312d</guid><dc:creator>tyler</dc:creator><description>&lt;p&gt;So if I set p_adv_report-&amp;gt;peer_addr.addr to the peripherals bluetooth address and run the example code it will work?  I&amp;#39;m trying to enter my bluetooth address into the ble_central and can&amp;#39;t find how to add it in and also remove the search for the heart beat UUID.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822/ BLE nano: Connect to a blue tooth by address</title><link>https://devzone.nordicsemi.com/thread/71447?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 09:34:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2fd3ced8-83ba-4fa3-a31f-1e47dfb856b9</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can take a look at the &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;Nordic UART Service Client example&lt;/a&gt; in the SDK. The address is present in the advertising packet and can be read as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void on_ble_evt(ble_evt_t * p_ble_evt)
{
    const ble_gap_evt_t * p_gap_evt = &amp;amp;p_ble_evt-&amp;gt;evt.gap_evt;
    switch (p_ble_evt-&amp;gt;header.evt_id)
    {
        case BLE_GAP_EVT_ADV_REPORT:
        {
            const ble_gap_evt_adv_report_t * p_adv_report = &amp;amp;p_gap_evt-&amp;gt;params.adv_report;
            printf(&amp;quot;Advertising packet from: %02x%02x%02x%02x%02x%02x\r\n&amp;quot;,
                      p_adv_report-&amp;gt;peer_addr.addr[0],
                      p_adv_report-&amp;gt;peer_addr.addr[1],
                      p_adv_report-&amp;gt;peer_addr.addr[2],
                      p_adv_report-&amp;gt;peer_addr.addr[3],
                      p_adv_report-&amp;gt;peer_addr.addr[4],
                      p_adv_report-&amp;gt;peer_addr.addr[5]
                      );
        }break; // BLE_GAP_EVT_ADV_REPORT
    }
}
&lt;/code&gt;&lt;/pre&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></channel></rss>