<?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 specified service when duplicate services discovered with same UUID in one peripheral?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91658/how-to-connect-to-specified-service-when-duplicate-services-discovered-with-same-uuid-in-one-peripheral</link><description>Hello, 
 I am working on a project that modified from ble_app_uart_c, with sdk v16.0, softdevice S140. The 52840 board as ble central and an android app as virtual NUS peripheral. 
 It should be straightforward work, but the board can only connect the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Sep 2022 06:05:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91658/how-to-connect-to-specified-service-when-duplicate-services-discovered-with-same-uuid-in-one-peripheral" /><item><title>RE: How to connect to specified service when duplicate services discovered with same UUID in one peripheral?</title><link>https://devzone.nordicsemi.com/thread/384909?ContentTypeID=1</link><pubDate>Wed, 07 Sep 2022 06:05:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f8297c0-66a4-447c-8190-faf0f4c3e209</guid><dc:creator>esonhon</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;Thanks for ur valuable advice. And yes,&amp;nbsp; after a power recyle, duplicate services gone, my board works. You saved my ass!!&lt;/p&gt;
&lt;p&gt;For others who may be interested in this topic, I&amp;#39;d like to&amp;nbsp;share more information.&lt;/p&gt;
&lt;p&gt;Actually, restart the android APP will release the service. But if you terminate the APP by pushing te STOP DEBUG button in Android Studio, the zombie-service created.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to connect to specified service when duplicate services discovered with same UUID in one peripheral?</title><link>https://devzone.nordicsemi.com/thread/384780?ContentTypeID=1</link><pubDate>Tue, 06 Sep 2022 11:47:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a025867-4090-4fed-8065-0c5bedddb08d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Weihe,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I would need to check with our Android experts to check if there is anything wrong.&amp;nbsp;&lt;br /&gt;But could you try to do a test to reset the phone (and turn off and on Bluetooth) and try again. I suspect that every time you run your app it will try to create a new UART service&amp;nbsp;on the phone and it explain why you have so many duplicated.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We will need to look into how the service should be released after the app is closed.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The reason for that you can use only one single service and not able to choose between them when there are multiple duplicated is that the ble_app_uart_c or specifically the&amp;nbsp;database discovery module was not designed to handle multiple instance of the same service on a server. So it basically return the first instance of the service in the table. And I don&amp;#39;t think there is a straightforward way to continue discovery the next service except for manually start the discovery again using&amp;nbsp;ble_db_discovery_start() with correct&amp;nbsp;curr_char_ind and&amp;nbsp;curr_srv_ind parameter.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I would suggest to focus on solving the issue on the Android app.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>