<?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 connect to one specific master</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/507/how-to-connect-to-one-specific-master</link><description>Hi, 
 I&amp;#180;m using nRF51822 with my own application and I want to connect just to one specific master device (for example smartphone) after this one is bonded: 
 
 nRF51822 wakes up and clears all bonded master 
 start adervertising 
 bonding to master</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 01 Oct 2013 12:30:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/507/how-to-connect-to-one-specific-master" /><item><title>RE: How to connect to one specific master</title><link>https://devzone.nordicsemi.com/thread/2651?ContentTypeID=1</link><pubDate>Tue, 01 Oct 2013 12:30:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70b1b64f-7b1f-48ba-904a-fac6c2863a4e</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;I&amp;#39;ve discussed this with some developers, and it seems that under certain circumstances you may see the above mentioned problem (that the whitelist is ignored) more often, so I suspect that might be the case here after all.&lt;/p&gt;
&lt;p&gt;However, if possible, I&amp;#39;d be happy to take a look on your code, and possibly test it on a development kit here, to see if I can see the same issue. If you don&amp;#39;t want to share your complete code project here, feel free to create a regular support case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to connect to one specific master</title><link>https://devzone.nordicsemi.com/thread/2652?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2013 10:45:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d00ba451-d43c-46b5-a72c-bf0f1d154de3</guid><dc:creator>Guest</dc:creator><description>&lt;p&gt;What I´ve realized / tested:
I tested advertising with whitelist with a second iPhone and now it works -&amp;gt; when my application was once paired/bonded with iPhone1 I can not connect with iPhone2. But when I use the Master Emulator instead of iPhone2 it doesn´t work --&amp;gt; the Master Emulator can still connect to my module?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to connect to one specific master</title><link>https://devzone.nordicsemi.com/thread/2650?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2013 10:45:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4ab6dca-f4f3-4aac-a23e-ba6e2f96159f</guid><dc:creator>Bastiaan</dc:creator><description>&lt;p&gt;What I´ve realized / tested:
I tested advertising with whitelist with a second iPhone and now it works -&amp;gt; when my application was once paired/bonded with iPhone1 I can not connect with iPhone2. But when I use the Master Emulator instead of iPhone2 it doesn´t work --&amp;gt; the Master Emulator can still connect to my module?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to connect to one specific master</title><link>https://devzone.nordicsemi.com/thread/2649?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2013 07:08:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8b2b7a8-6a01-4234-8b0b-9ed82d873d65</guid><dc:creator>Marcel</dc:creator><description>&lt;p&gt;Hi guys,
thanks for your reply and sorry for my late answer.&lt;/p&gt;
&lt;p&gt;Yes Ole, I can reproduce this behavior everytime. Here are the advertisment parameter which are shown in the Master Control Panel:
ble_remote (0xC1C55E4C8046)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Address: 0xC1C55E4C8046&lt;/li&gt;
&lt;li&gt;Address Type: Random&lt;/li&gt;
&lt;li&gt;Advertising Type: Connectable&lt;/li&gt;
&lt;li&gt;Bonded: False&lt;/li&gt;
&lt;li&gt;Advertising Data
&lt;ul&gt;
&lt;li&gt;CompleteLocalName: ble_remote&lt;/li&gt;
&lt;li&gt;Appearance: 0x03C1&lt;/li&gt;
&lt;li&gt;Flags: BrEdrNotSupported&lt;/li&gt;
&lt;li&gt;ServiceCompleteUuid16: 0x1812&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Scan Response Data&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All parameters except the advertisment flags are equal to advertisment with or without whiteliste.
So, any ideas?&lt;/p&gt;
&lt;p&gt;Regards
Marcel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to connect to one specific master</title><link>https://devzone.nordicsemi.com/thread/2648?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2013 06:49:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecfc6be0-4463-49b0-93a0-a66ab43b0400</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;Your code looks reasonable. When you see your device in Master Control Panel, what kind of flags does it advertise with? Could it be that some of the functions you call return an error, ending up in app_error_handler(), which does a reset by default?&lt;/p&gt;
&lt;p&gt;Also, if you&amp;#39;ve based your code on for example the proximity example in the SDK, this will time out after a while, and go from advertising with whitelist to advertising without whitelist, could that be the problem?&lt;/p&gt;
&lt;p&gt;Finally, as is stated in the release notes for S110 version 5.2.1, there is a known issue which could cause non-whitelisted devices to connect, but if this is the problem you&amp;#39;re hitting, you should not see this very often. Are you able to reproduce this each and every time you try?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to connect to one specific master</title><link>https://devzone.nordicsemi.com/thread/2647?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2013 05:54:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f257b6d6-bd31-4491-a896-72a6d471c884</guid><dc:creator>P&amp;#229;l H&amp;#229;land</dc:creator><description>&lt;p&gt;Based on what your APP_ADV_INTERVAL is and what the scan interval is on the master emulator, it can take some time before the adv interval actually hits the scan interval of the master. To improve this you can increase the scan window to be less than or equal to scan interval on the master device, this would make the master list the devices quicker. If the APP_ADV_INTERVAL is 1 second, then it might be that it would take at least one second to find it, if it is not able to hit the first possible adv event in the scan window. RF noise in the environment as other advertising devices could also impact the time for the Master Emulator to locate your peripheral.&lt;/p&gt;
&lt;p&gt;There should not be any significant delays when advertising with whitelist.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to connect to one specific master</title><link>https://devzone.nordicsemi.com/thread/2646?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2013 05:29:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dfe8a6f-31a0-4aa8-9893-158dc43ac214</guid><dc:creator>Marcel</dc:creator><description>&lt;p&gt;Hi, thanks for your reply. I use a iPhone and the master emulator for testing. I try to explain it more detailed:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;nRF51822 wakes up and all master are cleared&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;nRF51822 starts advertising&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;connect nRF51822 to the iPhone (got the demand of pairing)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;disconnect iPhone from nRF51822&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;force sleep mode to nRF51822&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;wake up nRF51822&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;nRF51822 starts advertising with whitelist&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;start master emulator and discovery mode&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;master emulator connects to nRF51822&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;What I´ve noticed:
It takes a few seconds between point 8 &amp;amp; 9 until the nRF51822 appears into the master emulator screen. Is there a special timeout for advertising with whitelist?&lt;/p&gt;
&lt;p&gt;Here´s my source code (based of hid keyboard example):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
static void _advertising_init(uint8_t adv_flags)
{
  uint32_t      err_code;
  ble_advdata_t advdata;

  ble_uuid_t adv_uuids[] = { { BLE_UUID_HUMAN_INTERFACE_DEVICE_SERVICE, BLE_UUID_TYPE_BLE } };

  // Build and set advertising data
  memset(&amp;amp;advdata, 0, sizeof(advdata));

  advdata.name_type               = BLE_ADVDATA_FULL_NAME;
  advdata.include_appearance      = true;
  advdata.flags.size              = sizeof(adv_flags);
  advdata.flags.p_data            = &amp;amp;adv_flags;
  advdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
  advdata.uuids_complete.p_uuids  = adv_uuids;

  err_code = ble_advdata_set(&amp;amp;advdata, NULL);
  APP_ERROR_CHECK(err_code);

  // Initialise advertising parameters (used when starting advertising)
  memset(&amp;amp;adv_params, 0, sizeof(adv_params));

  adv_params.type        = BLE_GAP_ADV_TYPE_ADV_IND;
  adv_params.p_peer_addr = NULL;                           // Undirected advertisement
  adv_params.fp          = BLE_GAP_ADV_FP_ANY;
  adv_params.p_whitelist = NULL;
  adv_params.interval    = APP_ADV_INTERVAL;
  adv_params.timeout     = APP_ADV_TIMEOUT_IN_SECONDS;

  advertising_mode = BLE_NO_ADV;
}


static void _advertising_start(void)
{
  uint32_t             err_code;
  ble_gap_whitelist_t  whitelist;
  ble_gap_addr_t       peer_address;
  char str[6];

  err_code = ble_bondmngr_whitelist_get(&amp;amp;whitelist);
  APP_ERROR_CHECK(err_code);

  if (ble_bondmngr_master_addr_get(last_connected_master, &amp;amp;peer_address) == NRF_SUCCESS) {
    adv_params.p_peer_addr = &amp;amp;peer_address;
    debug_print_array_hex(peer_address.addr, BLE_GAP_ADDR_LEN);
    debug_uart_putstring(&amp;quot;&amp;quot;);
    advertising_mode = BLE_DIRECTED_ADV;
  } else if ((whitelist.addr_count != 0) || (whitelist.irk_count != 0)) {
    _advertising_init(BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED);
		adv_params.fp          = BLE_GAP_ADV_FP_FILTER_BOTH;
		adv_params.p_whitelist = &amp;amp;whitelist;
		advertising_mode = BLE_ADV_WHITELIST;
  } else {
  	advertising_mode = BLE_ADV;
  }

  debug_fmt_u32(str, advertising_mode);
	debug_uart_putstring(str);
	debug_uart_new_line();

  err_code = sd_ble_gap_adv_start(&amp;amp;adv_params);
  APP_ERROR_CHECK(err_code);
}

&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to connect to one specific master</title><link>https://devzone.nordicsemi.com/thread/2645?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2013 04:33:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09529d44-1d4d-463b-a27c-6db4ee369ca3</guid><dc:creator>P&amp;#229;l H&amp;#229;land</dc:creator><description>&lt;blockquote&gt;
&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I´m using nRF51822 with my own application and I want to connect just to one specific master device (for example smartphone) after this one is bonded:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;nRF51822 wakes up and clears all bonded master&lt;/li&gt;
&lt;li&gt;start adervertising&lt;/li&gt;
&lt;li&gt;bonding to master&lt;/li&gt;
&lt;li&gt;disconnect and store master information
...&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;How can I make sure that there is no other master device (for example master emulator) is connecting to my device when I´m advertising to my first master device. I´ve also tried direct advertising and advertising with whitelist but it doesn´t work.&lt;/p&gt;
&lt;p&gt;Thanks
Marcel&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you are doing it in this order, then you should make sure you are not trying to connect to the peripheral with the Master Emulator (depending on how you are using it), might as well shut it down. And if it is a smartphone, then you could either turn off the Bluetooth on it, or delete the bond information if you have no intention in retaining it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to connect to one specific master</title><link>https://devzone.nordicsemi.com/thread/2644?ContentTypeID=1</link><pubDate>Tue, 24 Sep 2013 18:50:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6da151e-ac05-42e9-a4eb-530ccf6f10a3</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;Whitelisting and directed advertising are the methods that the Core Specification sets up for this use case, and as far as we&amp;#39;ve seen internally, this mostly works correctly. There is unfortunately a bug with the current release of the softdevice, which could cause whitelist to not be applied, but this should happen only rarely. In that case, even a non-whitelisted device may be able to connect.&lt;/p&gt;
&lt;p&gt;Several of our SDK examples implement whitelisting (for example ble_app_proximity), and some also directed advertising (ble_app_hids_keyboard). Have you tested them as is?&lt;/p&gt;
&lt;p&gt;With your own code, in what way exactly can you not get it working? Could you please share your code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>