<?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>Connecting to peripheral BLE device using BMD 350 (nrf52 based chip) as central BLE device.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/120470/connecting-to-peripheral-ble-device-using-bmd-350-nrf52-based-chip-as-central-ble-device</link><description>I have been able to connect and initialize two different Bluetooth OBD II Devices. I am running into issues with the third device I am trying to add as an option. I add the Primary Services in the code below. 
 
 I add filters to find the devices by name</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Apr 2025 10:14:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/120470/connecting-to-peripheral-ble-device-using-bmd-350-nrf52-based-chip-as-central-ble-device" /><item><title>RE: Connecting to peripheral BLE device using BMD 350 (nrf52 based chip) as central BLE device.</title><link>https://devzone.nordicsemi.com/thread/531492?ContentTypeID=1</link><pubDate>Fri, 11 Apr 2025 10:14:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6eac384e-39fa-4fd2-9265-951d49839803</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Check out this case that discusses how to use &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/94642/using-ble_db_discovery-to-find-the-dfu-service/400000"&gt;ble_db_discovery to find the DFU service&lt;/a&gt; for example. I think that should give you some intel in the issue you&amp;#39;re seeing here.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting to peripheral BLE device using BMD 350 (nrf52 based chip) as central BLE device.</title><link>https://devzone.nordicsemi.com/thread/531063?ContentTypeID=1</link><pubDate>Tue, 08 Apr 2025 15:11:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec556462-a748-4808-9899-ac254d5bee60</guid><dc:creator>inspiringdev123</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/aryan"&gt;Susheel Nuguru&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have added the following code to add the uuid.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint8_t uuid_type;
    uint32_t err_code;
    ble_uuid128_t base_uuid = { FIXD_BASE_UUID };

    err_code = sd_ble_uuid_vs_add(&amp;amp;base_uuid, &amp;amp;uuid_type);
    APP_ERROR_CHECK(err_code);

    ble_uuid_t obd_uuids[] = 
    {
        { .uuid = BLE_UUID_LELINK_SERVICE, .type = BLE_UUID_TYPE_BLE },
        { .uuid = BLE_UUID_VLINK_SERVICE, .type = BLE_UUID_TYPE_BLE },
        { .uuid = BLE_UUID_FIXD_SERVICE, .type = uuid_type } 
    };&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But after adding the uuid, the uuid type is 0x04 instead of 0x02. I cannot find anywhere that says what 0x04 for uuid type would mean after registering it? It should be 0x02 if it is vendor specific correct?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1744125047153v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;EDIT: I see in the documentation, after each call it increments the uuid type by one. I call for ble_nus and dfu so 4 makes sense since this is the third call.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/pastedimage1695124538674v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;But I am still getting the service not found in the discovery event callback.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1744125575431v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting to peripheral BLE device using BMD 350 (nrf52 based chip) as central BLE device.</title><link>https://devzone.nordicsemi.com/thread/530920?ContentTypeID=1</link><pubDate>Tue, 08 Apr 2025 04:58:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0402e5fc-512b-474b-8b25-bdb21f799bc9</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Matt,&lt;/p&gt;
&lt;p&gt;I can see that you are using nRF5SDK. Your discovery is failing because the FIXD device&amp;#39;s service UUID 0xFFF0 is not a standard 16-I think your BLE UUID, it&amp;#39;s a 128-bit vendor-specific UUID, even though it appears as 0xFFF0 in nRF Connect.&lt;/p&gt;
&lt;p&gt;You registered it as a 16-bit UUID which you should do if the UUID is a BLE standard UUID of type BLE_UUID_TYPE_BLE .&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;{ .uuid = BLE_UUID_FIXD_SERVICE, .type = BLE_UUID_TYPE_BLE }
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The screenshot in the nrf connect app confirms this as it seems 0XFFF0 as unknown service&lt;/p&gt;
&lt;p&gt;In your code you have this check&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;(p_evt-&amp;gt;params.discovered_db.srv_uuid.type == p_obd_service_client-&amp;gt;uuid_type)
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This check fails before&amp;nbsp;BLE_UUID_TYPE_BLE != BLE_UUID_TYPE_VENDOR_BEGIN + X&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;You need to add a full 128 bit UUID for your FIXD service/Device something like this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define FIXD_BASE_UUID  { 0xAB, 0xCD, 0xEF, 0x00, 0x12, 0x34, 0x56, 0x78, \
                          0x9A, 0xBC, 0xDE, 0xF0, 0xF0, 0xFF, 0x00, 0x00 }
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;See that 0XFFF0 is represented in your base UUID in the little endian format.&lt;br /&gt;&lt;br /&gt;Register this to the softdevice uuid database&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ble_uuid128_t base_uuid = { FIXD_BASE_UUID };
uint8_t uuid_type;

err_code = sd_ble_uuid_vs_add(&amp;amp;base_uuid, &amp;amp;uuid_type);
APP_ERROR_CHECK(err_code);
...
...
// Then when you are registering for callback for discovery event of your service, you do this
ble_uuid_t fixd_uuid;
fixd_uuid.uuid = 0xFFF0;
fixd_uuid.type = uuid_type;

err_code = ble_db_discovery_evt_register(&amp;amp;fixd_uuid);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You clearly need to have your uuid.type updated so that your compare in the discovery callback is comparing the right things.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;p_obd_service_client-&amp;gt;uuid_type = uuid_type;

in discovery callback you do this
if (p_evt-&amp;gt;evt_type == BLE_DB_DISCOVERY_COMPLETE &amp;amp;&amp;amp;
    (p_evt-&amp;gt;params.discovered_db.srv_uuid.uuid == BLE_UUID_FIXD_SERVICE) &amp;amp;&amp;amp;
    (p_evt-&amp;gt;params.discovered_db.srv_uuid.type == p_obd_service_client-&amp;gt;uuid_type))

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This should work now&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>