<?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>NRF52 ble_db_discovery failed to initialize correctly when repeats the service discovery</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16029/nrf52-ble_db_discovery-failed-to-initialize-correctly-when-repeats-the-service-discovery</link><description>Hi 
 We are using NRF52 and SDK 11 and S132. 
 The nrf52 acts as a central and selectively	connects to the closest phones (ios) that are acting as a pheripheral.
For this purpose we have 4 characteristics (TX, RX, RSSI and heartbeat-HB ) 
 The application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Mar 2017 04:11:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16029/nrf52-ble_db_discovery-failed-to-initialize-correctly-when-repeats-the-service-discovery" /><item><title>RE: NRF52 ble_db_discovery failed to initialize correctly when repeats the service discovery</title><link>https://devzone.nordicsemi.com/thread/61132?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2017 04:11:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0389352-f18e-4d7b-be9e-a3af771c5a2d</guid><dc:creator>Vincent</dc:creator><description>&lt;p&gt;I got it.
Next time I will create a new case.
And about the Polar HR and Wahoo Speed Device problem I found the reason.
If I read those two device service UUID(HR or CSC) and Appearance the adv_report_parse will return not NRF_SUCCESS.
Now I realize that is not every BLE device are follow Standard BLE device does.
I modify my project fw code to scan device only read the device name and mac address.
Sorry about the scan Polar device problem I did not check each adv_report_parse function return vaule very carefully.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 ble_db_discovery failed to initialize correctly when repeats the service discovery</title><link>https://devzone.nordicsemi.com/thread/61130?ContentTypeID=1</link><pubDate>Mon, 20 Mar 2017 15:24:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b7176e7-24ad-4629-91b2-099df4710c16</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Vincent: Yes you are right, if we may connect to multiple server we need to handle like that.&lt;/p&gt;
&lt;p&gt;Next time please create new case if you have a new question. Have you tried to use nRFConnect /Master Control panel on PC to scan for the Polar ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 ble_db_discovery failed to initialize correctly when repeats the service discovery</title><link>https://devzone.nordicsemi.com/thread/61131?ContentTypeID=1</link><pubDate>Sat, 18 Mar 2017 02:42:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1446dab6-c0c0-44d2-b33d-31542fb9f860</guid><dc:creator>Vincent</dc:creator><description>&lt;p&gt;Hi Hung Bui,
My project is follow:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;memset(&amp;amp;m_ble_db_discovery,0,sizeof(m_ble_db_discovery)); 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;before ble_db_discovery_start()&lt;/p&gt;
&lt;p&gt;But I saw the sdk 13 this part is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;memset(&amp;amp;m_ble_db_discovery[p_gap_evt-&amp;gt;conn_handle], 0x00, sizeof(ble_db_discovery_t));
err_code = ble_db_discovery_start(&amp;amp;m_ble_db_discovery[p_gap_evt-&amp;gt;conn_handle], p_gap_evt-&amp;gt;conn_handle);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There is modify for one device so should I follow sdk 13 example does.
and There is one more question is BLE central scan device problem
Where is Document for BLE scan because I test SDK10~12.2 but non of one could scan the Polar Heart Rate belt Device but other HR device and any BLE device is fine.
In the same time the Cell phone nRF ToolBox can scan Polar HR belt.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 ble_db_discovery failed to initialize correctly when repeats the service discovery</title><link>https://devzone.nordicsemi.com/thread/61129?ContentTypeID=1</link><pubDate>Fri, 03 Mar 2017 14:12:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aaa5fa97-cbf9-47cb-b6bf-085e7914db0c</guid><dc:creator>Vincent</dc:creator><description>&lt;p&gt;OK, I will keep test my project.
Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 ble_db_discovery failed to initialize correctly when repeats the service discovery</title><link>https://devzone.nordicsemi.com/thread/61128?ContentTypeID=1</link><pubDate>Fri, 03 Mar 2017 14:09:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15925d7e-ac98-4e2b-be24-8717a3d0eb05</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Vincent,&lt;/p&gt;
&lt;p&gt;I think just zero-initialized p_db_discovery before calling ble_db_discovery_start() should works. I will update my answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 ble_db_discovery failed to initialize correctly when repeats the service discovery</title><link>https://devzone.nordicsemi.com/thread/61127?ContentTypeID=1</link><pubDate>Fri, 03 Mar 2017 12:55:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99977485-3584-42a5-abe3-33785e341ef1</guid><dc:creator>Vincent</dc:creator><description>&lt;p&gt;Could you be more specific about
&amp;quot;In ble_db_discovery.c move p_db_discovery-&amp;gt;curr_char_ind = 0; from line 237 to line 234.&amp;quot;&lt;/p&gt;
&lt;p&gt;Because I am use SDK12.2 and I just add memset(&amp;amp;m_ble_db_discovery,0,sizeof(m_ble_db_discovery)); before ble_db_discovery_start()
Now I can connect to my target device and disconnect and reconnect but before I can not.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 ble_db_discovery failed to initialize correctly when repeats the service discovery</title><link>https://devzone.nordicsemi.com/thread/61126?ContentTypeID=1</link><pubDate>Thu, 15 Sep 2016 08:26:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e60cbc8-4c2f-4382-bd32-1b3dc8acaa61</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Text from @hungbui from internal ticket explaining why this happens&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;ble_db_discovery failed to initialize
correctly. In on_srv_disc_completion()
we don&amp;#39;t set
p_db_discovery-&amp;gt;curr_char_ind = 0; if
there is no further service to be
discovered. This results in the bug
that if there is a reconnection and
the client try to do service discovery
again, the curr_char_ind will not be =
0. As it will start with the last one from previous service discovery of the
previous connection. Suggest to always
reinitialize curr_char_ind when we
discover a service.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;adding this thread to&lt;br /&gt;
&lt;a href="https://devzone.nordicsemi.com/question/71366/what-are-sdk-1100-known-issues/"&gt;SDK11 known issues&lt;/a&gt;&lt;br /&gt;
&lt;a href="https://devzone.nordicsemi.com/question/93241/what-are-sdk-1200-known-issues/"&gt;SDK12 known issues&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 ble_db_discovery failed to initialize correctly when repeats the service discovery</title><link>https://devzone.nordicsemi.com/thread/61125?ContentTypeID=1</link><pubDate>Tue, 06 Sep 2016 13:26:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c8ec9e7-d72f-4236-b12f-035d6f1e0878</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Case was solved with  fix required :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Re-initialize m_ble_db_discovery database in main.c whenever we call ble_db_discovery_start(). Suggest to add &lt;code&gt;memset(&amp;amp;m_ble_db_discovery,0,sizeof(m_ble_db_discovery));&lt;/code&gt; before ble_db_discovery_start()&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;According to ble_db_discovery_start() documentation the database shall be zero initialized before use:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; @warning p_db_discovery structure must be zero-initialized.
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 ble_db_discovery failed to initialize correctly when repeats the service discovery</title><link>https://devzone.nordicsemi.com/thread/61123?ContentTypeID=1</link><pubDate>Mon, 29 Aug 2016 14:33:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8acd10ec-5054-4580-aa7f-881239843f2b</guid><dc:creator>Unnar</dc:creator><description>&lt;p&gt;We created a case using MyPage, id is 31245 where we shared the code&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 ble_db_discovery failed to initialize correctly when repeats the service discovery</title><link>https://devzone.nordicsemi.com/thread/61124?ContentTypeID=1</link><pubDate>Mon, 29 Aug 2016 10:14:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79b8377c-6b2d-4eda-b1df-9037c8e2f0e0</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Could you try to catch this on a sniffer trace? You can use the nRF Sniffer. Do you ever &amp;quot;unsubscribe&amp;quot; in your code? When you reconnect, are you sure sd_ble_gattc_write() is called, and returns NRF_SUCCESS? Would it be possible to share somre more code? Maybe even the complete project? You can do it privately through your MyPage at nordicsemi.com&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>