<?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 to know the UUID device on connect</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111404/how-to-to-know-the-uuid-device-on-connect</link><description>I have an application that must manage different ble connection with different device (and so different UUID services). For the scanning and connection I used the bt_scan_filter_add for every UUID to filter the device&amp;#39;s UUIDs with the autoconnect if match</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 May 2024 08:39:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111404/how-to-to-know-the-uuid-device-on-connect" /><item><title>RE: How to to know the UUID device on connect</title><link>https://devzone.nordicsemi.com/thread/485564?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 08:39:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:542ba494-28e2-4aef-b328-4651d303b594</guid><dc:creator>Andrea Verdecchia</dc:creator><description>&lt;p&gt;I found the error: I need to use&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;bt_uuid_to_str( filter_match-&amp;gt;uuid.uuid[ 0 ], uuid, sizeof( uuid ) );&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to to know the UUID device on connect</title><link>https://devzone.nordicsemi.com/thread/485557?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 08:15:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3a2b250-0a8d-430f-9718-dda42970d068</guid><dc:creator>Andrea Verdecchia</dc:creator><description>&lt;p&gt;Ok. But now I&amp;#39;m trying to read the UUID in the&amp;nbsp;&lt;span&gt;scan_filter_match() callback but I can&amp;#39;t. My callback is like&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;void scan_filter_match_cb( struct bt_scan_device_info *device_info, struct bt_scan_filter_match *filter_match, bool connectable )
{
	char addr[ BT_ADDR_LE_STR_LEN ];
    char uuid[ BT_UUID_STR_LEN ];

	bt_addr_le_to_str( device_info-&amp;gt;recv_info-&amp;gt;addr, addr, sizeof( addr ) );
    bt_uuid_to_str( filter_match-&amp;gt;uuid.uuid, uuid, sizeof( uuid ) );
    LOG_INF( &amp;quot;Filters matched. Address: %s connectable: %d uuid: %s&amp;quot;, addr, connectable, uuid );
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;but the uuid string is null. I get&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;Filters matched. Address: C3:73:08:D3:D5:36 (random) connectable: 0 uuid&amp;#160;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Am I fetching the uuid in the right way?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to to know the UUID device on connect</title><link>https://devzone.nordicsemi.com/thread/485368?ContentTypeID=1</link><pubDate>Wed, 22 May 2024 11:03:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc3e0f57-a685-4762-9386-df4c68b8b96f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The connection object only includes information about the connection, such as the BLE address. It does not include information about what was included in the advertisement payload. However, you can use your scan_filter_match() callback to check which UUID filter a given device matched with and map this to a connection object.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>