<?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>Bug in Discovery Module ble_db_discovery.c</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37744/bug-in-discovery-module-ble_db_discovery-c</link><description>This is on SDK 15 : Not all services are reported when doing service discovery on more than one connection at a time. 
 Basically, &amp;#39; ble_db_discovery .c&amp;#39; uses &amp;#39; m_pending_usr_evt_index &amp;#39; to keep track of the number of services discovered, and when all</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Apr 2019 12:18:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37744/bug-in-discovery-module-ble_db_discovery-c" /><item><title>RE: Bug in Discovery Module ble_db_discovery.c</title><link>https://devzone.nordicsemi.com/thread/180489?ContentTypeID=1</link><pubDate>Fri, 05 Apr 2019 12:18:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bf0ac0e-6970-44e5-9c0d-cb61502d5473</guid><dc:creator>Tielman</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/goldwake"&gt;goldwake&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;My code is based on SDK 15.0 so it might have already been fixed. Regardless, here is what I did:&lt;/p&gt;
&lt;p&gt;In the ble_db_discovery.c is a function called &amp;quot;discovery_complete_evt_trigger&amp;quot;. At the end of the function instead of incrementing the events counter and then sending the events as a bundle to the higher layer handlers, I simply send the event immediately. Here is the change I made:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;m_pending_user_evts[m_pending_usr_evt_index].evt_handler = p_evt_handler;

// +++++ I added the following line to send every event as it is received and leave it to the upper layer driver to handle the individual events
m_pending_user_evts[0].evt_handler(&amp;amp;(m_pending_user_evts[0].evt));

/* +++++ The below part is what I removed
m_pending_usr_evt_index++;

if (m_pending_usr_evt_index == m_num_of_handlers_reg)
{
    // All registered modules have pending events. Send all pending events to the user
    // modules.
	NRF_LOG_ERROR(&amp;quot;x%d%dx&amp;quot;,conn_handle,m_pending_usr_evt_index);
    pending_user_evts_send();
}
else
{
    // Too many events pending. Do nothing. (Ideally this should not happen.)
	NRF_LOG_ERROR(&amp;quot;x%d%dx&amp;quot;,conn_handle,m_pending_usr_evt_index);
}*/&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is not a perfect fix but works great for me.&lt;/p&gt;
&lt;p&gt;Hope it helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bug in Discovery Module ble_db_discovery.c</title><link>https://devzone.nordicsemi.com/thread/179627?ContentTypeID=1</link><pubDate>Tue, 02 Apr 2019 02:23:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae66de4f-4706-4c6b-807b-27f32bf17ffc</guid><dc:creator>goldwake</dc:creator><description>&lt;p&gt;hi &lt;a href="https://devzone.nordicsemi.com/members/tterblan"&gt;Tielman&lt;/a&gt;, could you post your workaround?. Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bug in Discovery Module ble_db_discovery.c</title><link>https://devzone.nordicsemi.com/thread/145513?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 12:35:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31b150c9-2c2c-49d5-953f-b3feceb060aa</guid><dc:creator>Tielman</dc:creator><description>&lt;p&gt;That&amp;#39;s fine, thanks. The workaround works great.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bug in Discovery Module ble_db_discovery.c</title><link>https://devzone.nordicsemi.com/thread/145486?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 11:22:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad3c73d4-5fe9-4014-829c-dbcd55611959</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for notifying us about this bug. I have added this to our internal tracking system, and it is currently being added to &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/34155/what-are-sdk-15-x-0-known-issues"&gt;SDK 15 known issues&lt;/a&gt;. Unfortunately, I am afraid we do not have time to fix this before the next sdk release.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>