<?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>Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/6408/increase-service-discovery-speed-by-master</link><description>Hi,
So i&amp;#39;m working on an android app that communicates with two nrf51822 devices on the s110 softdevice by switching between them continuously (connecting one, disconnecting the other and vice versa).
My issue is that the service discovery seems to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 22 Aug 2020 12:18:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/6408/increase-service-discovery-speed-by-master" /><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/265843?ContentTypeID=1</link><pubDate>Sat, 22 Aug 2020 12:18:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7dcf5a2-c0a7-4fb2-a633-50216a274428</guid><dc:creator>Ron</dc:creator><description>&lt;p&gt;A question relating to the issue of speed vs data&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If I need to to add a new &lt;span&gt;characteristic&amp;nbsp;to my system, and I am inclined (for convenience and structural&amp;nbsp;reasons) to include it in a whole new different service, will this be disadvantageous&amp;nbsp;speed-wise, meaning, is adding more and more characteristic&amp;nbsp;to the same service, better than creating new services (given that the overall amount characteristic stays the same) ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22350?ContentTypeID=1</link><pubDate>Wed, 08 Apr 2015 19:23:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a048f7e-e5ac-4310-843f-0367ccec4568</guid><dc:creator>Kosidinma</dc:creator><description>&lt;p&gt;Seems it might be the phone hardware/defaults as u mentioned before because I tried using the lightblue app on IOS to connect and it took about 0.7 seconds less time to discover services.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22349?ContentTypeID=1</link><pubDate>Wed, 08 Apr 2015 18:23:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48bb6cb9-8da5-4d71-a16b-ed83babae82d</guid><dc:creator>Locky</dc:creator><description>&lt;p&gt;The only way to increase discovery speed is with a faster connection speed.  There aren&amp;#39;t really any other tricks besides a faster connection interval.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22348?ContentTypeID=1</link><pubDate>Wed, 08 Apr 2015 15:16:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e52b0c45-5480-4c92-b245-c58c935f1622</guid><dc:creator>Kosidinma</dc:creator><description>&lt;p&gt;So I found out that your answer affected initial connections but not service discovery. My main concern is the service discovery .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22347?ContentTypeID=1</link><pubDate>Wed, 08 Apr 2015 00:42:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22522cf9-d290-4dea-8a88-6bcd211118f3</guid><dc:creator>Kosidinma</dc:creator><description>&lt;p&gt;I will try and see if I can get my hands on a more recent android phone to check for differences. In the mean time, I&amp;#39;ll wait and see if anyone else has a different solution. Thanks for your help and quick responses...really appreciate it. :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22346?ContentTypeID=1</link><pubDate>Wed, 08 Apr 2015 00:26:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:821af43a-f9ee-435c-9916-117980de2472</guid><dc:creator>Locky</dc:creator><description>&lt;p&gt;You cannot change the default setting on the Phone.  Its different for every phone.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22345?ContentTypeID=1</link><pubDate>Wed, 08 Apr 2015 00:24:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6c3d196-52e5-4391-833b-68d55f20e54b</guid><dc:creator>Kosidinma</dc:creator><description>&lt;p&gt;Huh, that makes sense. So is there a way of changing the phone defaults or do I need to get a more powerful phone??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22344?ContentTypeID=1</link><pubDate>Wed, 08 Apr 2015 00:13:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1acedae-fb20-445e-a72e-0809a6d7345a</guid><dc:creator>Locky</dc:creator><description>&lt;p&gt;At FIRST_CONN_PARAMS_UPDATE_DELAY = 2  means you won&amp;#39;t get any connection parameter update before discovery finishes at 1.5sec.   So there won&amp;#39;t be any change regarding of what you set your preferred Conenction Parameters to be.&lt;/p&gt;
&lt;p&gt;The BLE rule is that the Central must allow atleast 5 connection events before updating the Connection Parameters settings of the link.   I don&amp;#39;t know what the default settings are for your phone, but it sounds like they are oddly long.   If for example they are set to 150msec,  then you can&amp;#39;t update the Connection Parameters until alteast 750msec,  meanwhile you&amp;#39;ve burned up your time at a Slower setting.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22343?ContentTypeID=1</link><pubDate>Wed, 08 Apr 2015 00:09:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f7e0469-1f1a-46ae-a1b2-a252fb637556</guid><dc:creator>Kosidinma</dc:creator><description>&lt;p&gt;It seemed ok at FIRST_CONN_PARAMS_UPDATE_DELAY = 2 seconds but bizzare at 0.2. But even before disconnection, the logs showed the discovery time to be the same at 20, 2 and 0.2...same thing happened when I changed the vales you suggested above and used the originals...still had the same discovery time (about 1.5s).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22342?ContentTypeID=1</link><pubDate>Wed, 08 Apr 2015 00:00:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84df1f91-a117-42b5-bf73-4dfed9f095f7</guid><dc:creator>Locky</dc:creator><description>&lt;p&gt;I meant using the PCA10001 Bluetooth Dongle from Nordic and use the Master Emulator Software on a desktop to test as a Central.  Do not use an Android to test, I don&amp;#39;t think it has the same logging capability as the Desktop version.&lt;/p&gt;
&lt;p&gt;Its bizarre that the connection parameters would cause disconnects as these meet Apple&amp;#39;s standards which are more strict than Android.&lt;/p&gt;
&lt;p&gt;What is your FIRST_CONN_PARAMS_UPDATE_DELAY set to?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22341?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2015 23:54:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46c79812-c62a-443b-81c2-d4a4dc874f99</guid><dc:creator>Kosidinma</dc:creator><description>&lt;p&gt;Actually, I just tested this on my android phone using the master control panel app. No matter the values I set, logged discovery time was still the same (approximately 1.5s). Also, changing to your suggested values caused unwanted disconnection of the device :(. So I don&amp;#39;t think those values affect it greatly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22340?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2015 23:36:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b60ccda7-1501-46c3-93a2-a700406169ec</guid><dc:creator>Kosidinma</dc:creator><description>&lt;p&gt;Thank you, I&amp;#39;ll look into this tomorrow and inform you of the results&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22339?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2015 23:27:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:272ec794-eff3-445b-8e7b-b9e371861e20</guid><dc:creator>Locky</dc:creator><description>&lt;p&gt;Connect to a BT Dongle (PCA10001) and use the Master Emulator as a central to connect to your device.  The Log will show you when the Connection Parameters update.    If its not updated within the Discovery Time, you need to reduce your FIRST_CONN_PARAMS_UPDATE_DELAY and change to the parameters I suggested as yours are way too slow.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22338?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2015 23:15:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a8d7a29-45e8-4c19-886e-5b49db642c5f</guid><dc:creator>Kosidinma</dc:creator><description>&lt;p&gt;So all I need to do is change the parameters to your suggested values?? Or is there a way to check if my parameters are updating before discovery?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22337?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2015 23:07:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e2e2ed7-0d3c-46af-b9e5-72528fe02091</guid><dc:creator>Locky</dc:creator><description>&lt;p&gt;#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(22, UNIT_1_25_MS)&lt;br /&gt;
#define MAX_CONN_INTERVAL               MSEC_TO_UNITS(46, UNIT_1_25_MS)
#define SLAVE_LATENCY                   0                                           /**&amp;lt; Slave latency. */
#define CONN_SUP_TIMEOUT                MSEC_TO_UNITS(200, UNIT_10_MS)&lt;/p&gt;
&lt;p&gt;You likely are not updating your parameters before discovery, meaning you are relying on the default Connection Parameters of the Android phone to be fast enough.   If this is not the case, you need to send a Connection Parameter update sooner.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22336?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2015 23:02:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c050aed7-424c-4a16-a2e2-08e4476a439d</guid><dc:creator>Kosidinma</dc:creator><description>&lt;p&gt;Its set to 20s but my services don&amp;#39;t take that long so I included this aspect of my code; maybe it&amp;#39;ll help. Thanks for your help so far.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; #define MIN_CONN_INTERVAL               MSEC_TO_UNITS(100, UNIT_1_25_MS)            /**&amp;lt; Minimum acceptable connection interval (0.5 seconds). */
    #define MAX_CONN_INTERVAL               MSEC_TO_UNITS(200, UNIT_1_25_MS)            /**&amp;lt; Maximum acceptable connection interval (1 second). */
    #define SLAVE_LATENCY                   0                                           /**&amp;lt; Slave latency. */
    #define CONN_SUP_TIMEOUT                MSEC_TO_UNITS(4000, UNIT_10_MS)             /**&amp;lt; Connection supervisory timeout (4 seconds). */
    #define FIRST_CONN_PARAMS_UPDATE_DELAY  APP_TIMER_TICKS(20000, APP_TIMER_PRESCALER) /**&amp;lt; Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (15 seconds). */
    #define NEXT_CONN_PARAMS_UPDATE_DELAY   APP_TIMER_TICKS(5000, APP_TIMER_PRESCALER)  /**&amp;lt; Time between each call to sd_ble_gap_conn_param_update after the first call (5 seconds). */
    #define MAX_CONN_PARAMS_UPDATE_COUNT    3                                           /**&amp;lt; Number of attempts before giving up the connection parameter negotiation. */
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22335?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2015 22:57:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f79c9f7f-26bd-48fc-a6d4-0cd056eba8b2</guid><dc:creator>Locky</dc:creator><description>&lt;p&gt;What are your preferred connection parameters?&lt;/p&gt;
&lt;p&gt;What do you have FIRST_CONN_PARAMS_UPDATE_DELAY set to?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22334?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2015 22:56:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a044176-6d62-49d2-bedf-78c72d9f9f4b</guid><dc:creator>Kosidinma</dc:creator><description>&lt;p&gt;Each sensor service uses only &amp;quot;notify&amp;quot; characteristic and all values are uint_8. My initialised connection parameters are:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void conn_params_init(void)
{
    uint32_t               err_code;
    ble_conn_params_init_t cp_init;

    memset(&amp;amp;cp_init, 0, sizeof(cp_init));

    cp_init.p_conn_params                  = NULL;
    cp_init.first_conn_params_update_delay = FIRST_CONN_PARAMS_UPDATE_DELAY;
    cp_init.next_conn_params_update_delay  = NEXT_CONN_PARAMS_UPDATE_DELAY;
    cp_init.max_conn_params_update_count   = MAX_CONN_PARAMS_UPDATE_COUNT;
    cp_init.start_on_notify_cccd_handle    = BLE_GATT_HANDLE_INVALID;
    cp_init.disconnect_on_fail             = false;
    cp_init.evt_handler                    = on_conn_params_evt;
    cp_init.error_handler                  = conn_params_error_handler;

    err_code = ble_conn_params_init(&amp;amp;cp_init);
    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: Increase Service Discovery Speed by Master</title><link>https://devzone.nordicsemi.com/thread/22333?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2015 22:43:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5def5f30-c0c0-41bb-8d0b-8f82316604f6</guid><dc:creator>Locky</dc:creator><description>&lt;p&gt;What do you set your preferred Connection Parameters to?  When do you request the Connection Parameter Update?&lt;/p&gt;
&lt;p&gt;Your only options of increasing Discovery Speed are using the fastest Connection Parameters, and streamlining your Service.  Meaning remove anything characteristic that are unnecessary and reduce the characteristic sizes to only required size.   i.e. don&amp;#39;t create a uint32_t characteristic that will only use 0-255 values.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>