<?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>Refresh services in nrf Master Control Panel</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10146/refresh-services-in-nrf-master-control-panel</link><description>Sometimes the service discovery procedure in Android will discover all services but not the characteristics included in them. So all services will be empty. If I then open the nrf Master Control Panel and connect to the peripheral it will also show all</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 27 Nov 2015 12:16:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10146/refresh-services-in-nrf-master-control-panel" /><item><title>RE: Refresh services in nrf Master Control Panel</title><link>https://devzone.nordicsemi.com/thread/37625?ContentTypeID=1</link><pubDate>Fri, 27 Nov 2015 12:16:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36073380-755f-4e10-a23e-beeb0d62d0e0</guid><dc:creator>Erik</dc:creator><description>&lt;p&gt;Ok, I think I understand now whats going on.
I noticed a lot of 133 status error codes in the log when doing a service discovery and just assumed
that the service table was corrupt, since that was my problem in the first place. But then I noticed the same
error codes when doing a refresh in the MCP. So after digging a bit in the sources I note that a lot of the events delivered to BluetoothGatt are in fact normal errors during a discovery, for instance trying to lookup an included service when there is none present. So, in short it does work, but the status errors in the android debug log made me confused. Thanks for your help. /Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Refresh services in nrf Master Control Panel</title><link>https://devzone.nordicsemi.com/thread/37624?ContentTypeID=1</link><pubDate>Thu, 26 Nov 2015 12:43:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:299a424d-72ad-4069-8ac0-ce9a0c63ce2c</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The refresh() method does perform the service discovery, but you are not aware of it (no callback is called). My suggestion would be either to call it after you disconnected (on onConnectionStateChanged-&amp;gt;STATE_DISCONNECTED, before you call close() ), or after you connected but delay calling discoverServices() about 600ms. If you are bonded, shortly after you get state connected the device may receive the Service Changed indication and may refresh services automatically.
I recommend checking the source code of nRF Toolbox here: &lt;a href="https://github.com/NordicSemiconductor/Android-nRF-Toolbox/blob/master/app/src/main/java/no/nordicsemi/android/nrftoolbox/profile/BleManager.java#L626"&gt;github.com/.../BleManager.java&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Sequence of actions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;State changed to connected&lt;/li&gt;
&lt;li&gt;Refresh&lt;/li&gt;
&lt;li&gt;Wait 600 ms&lt;/li&gt;
&lt;li&gt;Call discoverServices()&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Also, I have never experienced issue you are talking about. What phone are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Refresh services in nrf Master Control Panel</title><link>https://devzone.nordicsemi.com/thread/37626?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2015 12:08:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef68bd05-b6f8-4dcb-a5b2-6d5a4e18c8fc</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;There is a hidden method in BluetoothGatt, refresh(); You can see more details &lt;a href="https://devzone.nordicsemi.com/question/22751/nrftoobox-on-android-not-recognizing-changes-in-application-type-running-on-nordic-pcb/"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>