<?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 Custom Service/Characteristic of BLE peripheral with nRF52 acting as central.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/117049/connecting-to-custom-service-characteristic-of-ble-peripheral-with-nrf52-acting-as-central</link><description>I am currently connected to a BLE peripheral with the nRF52 acting as the central. I am able to scan using the device&amp;#39;s name and connect. I created a custom file to handle the central functions including adding the custom UUID and starting the discovery</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Dec 2024 08:24:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/117049/connecting-to-custom-service-characteristic-of-ble-peripheral-with-nrf52-acting-as-central" /><item><title>RE: Connecting to Custom Service/Characteristic of BLE peripheral with nRF52 acting as central.</title><link>https://devzone.nordicsemi.com/thread/514168?ContentTypeID=1</link><pubDate>Tue, 10 Dec 2024 08:24:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc43d265-d149-42a0-95f9-f007b0ef11e0</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;And if you want us to really be able to debug, I guess you can write a peripheral application that can mimic the server/characteristic setup that you are testing on. Modify e.g. the ble_app_uart example to use these UUIDs (if possible. Not sure).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Tai Le"]&lt;p&gt;Otherwise,&amp;nbsp;you can share your whole central custom ble service so that we can check if the issue is still there.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;I agree. Since the uuid.type = 0x04, I am not sure this is the correct event that is forwarded to the discovery callback handler. But I can&amp;#39;t tell without seeing more of your application.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting to Custom Service/Characteristic of BLE peripheral with nRF52 acting as central.</title><link>https://devzone.nordicsemi.com/thread/514131?ContentTypeID=1</link><pubDate>Mon, 09 Dec 2024 21:09:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d1bf02f-41a8-4005-93ee-de368351b9a0</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;So I guess you just need to update the following parameters and have a test.&amp;nbsp;Hope it works. Otherwise,&amp;nbsp;you can share your whole central custom ble service so that we can check if the issue is still there.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;#define BLE_UUID_OBD_SERVICE 0x0A71&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//&amp;lt; The UUID of the OBD Service.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;#define BLE_UUID_OBD_CHARACTERISTIC 0xD6C9&amp;nbsp; // &amp;lt; The UUID of the RX and TX Characteristic.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting to Custom Service/Characteristic of BLE peripheral with nRF52 acting as central.</title><link>https://devzone.nordicsemi.com/thread/514124?ContentTypeID=1</link><pubDate>Mon, 09 Dec 2024 20:14:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d84425c6-b78e-44ec-884f-4844070c8fc3</guid><dc:creator>inspiringdev123</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/tai-le"&gt;Tai&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You are right. The service is 0X18F. The RX Characteristic is 0x2AF0 and the Notify Characteristic is 0x2AF1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting to Custom Service/Characteristic of BLE peripheral with nRF52 acting as central.</title><link>https://devzone.nordicsemi.com/thread/514121?ContentTypeID=1</link><pubDate>Mon, 09 Dec 2024 19:33:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8af91cb-02a9-41bf-9778-7ef5b725f10b</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;&lt;img style="max-height:204px;max-width:535px;" height="204" src="https://devzone.nordicsemi.com/resized-image/__size/1070x408/__key/communityserver-discussions-components-files/4/pastedimage1733772716735v1.png" width="535" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;This is from iOS wireshark capture, it even didn&amp;#39;t detect ATT from this service UUID:&amp;nbsp;&lt;span&gt;e7810a71-73ae-499d-8c15-faa9aef0c3f2. Thus, I don&amp;#39;t think it&amp;#39;s a correct service that you were looking for to read/write to your peripheral device.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting to Custom Service/Characteristic of BLE peripheral with nRF52 acting as central.</title><link>https://devzone.nordicsemi.com/thread/514119?ContentTypeID=1</link><pubDate>Mon, 09 Dec 2024 19:28:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98d1598f-9f65-4a80-b4bc-b29fc8fdf611</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;I agree with Edvin about the inconsistency of the base UUID which may lead to this issue. Thus, something wrong with the UUID setup in the central custom service.&lt;/p&gt;
&lt;p&gt;Basically, the central custom service has to look for the service UUID and characteristic UUID of the peripheral device.&lt;/p&gt;
[quote userid="116423" url="~/f/nordic-q-a/117049/connecting-to-custom-service-characteristic-of-ble-peripheral-with-nrf52-acting-as-central/514099"]I did a primary service discovery with the VLINK device in the nRF52 firmware and only found 4 Primary Services, 0x1800, 0x1801, 0x18F0, and 0x180A. It never found the Unknown Primary Service (e7810a71-73ae-499d-8c15-faa9aef0c3f2). This is the service with the read and write characteristic.&amp;nbsp;[/quote]
&lt;p&gt;The base uuid should be used for different services (i.e., different service UUIDs). Make sure you use correct service UUID in your central custom BLE.&lt;/p&gt;
&lt;p&gt;Regarding the uuid type, you shouldn&amp;#39;t assign it either&amp;nbsp;BLE_UUID_TYPE_BLE or&amp;nbsp;BLE_UUID_TYPE_VENDOR_BEGIN as it&amp;#39;s supposed to detect by the central custom BLE. This info was obtained from the peripheral device. That&amp;#39;s why you were trying to assign it, but it gave you a different return number.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit1:&lt;/strong&gt;&amp;nbsp;Can you take a capture of nRF connect app in the case that you can use iOS app to read and write your peripheral device? You can show all services available and expand the one that allows you to notify/read/write.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting to Custom Service/Characteristic of BLE peripheral with nRF52 acting as central.</title><link>https://devzone.nordicsemi.com/thread/514100?ContentTypeID=1</link><pubDate>Mon, 09 Dec 2024 16:56:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87fa8d0a-31f0-4311-a2e6-0c76ef388f68</guid><dc:creator>inspiringdev123</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/edvin-holmseth"&gt;Edvin&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What would cause the&amp;nbsp;p_evt-&amp;gt;params.discovered_db.srv_uuid.type to equal 4? This does not seemed defined for UUID type. My custom service is stating it is type 4 even though when I register it as BLE_UUID_TYPE_VENDOR here&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint32_t ble_obd_c_init(ble_obd_c_t * p_obd_service_client, ble_obd_c_init_t * p_ble_obd_c_init)
{
    uint32_t      err_code;
    ble_uuid_t    obd_uuid;
    // TODO VLINK 
    ble_uuid128_t obd_base_uuid = OBD_BASE_UUID;

    obd_uuid.uuid = BLE_UUID_OBD_SERVICE;
    // TODO LE LINK 
    // obd_uuid.type = BLE_UUID_TYPE_BLE;
    // TODO VLINK 
    obd_uuid.type = BLE_UUID_TYPE_VENDOR_BEGIN;

    VERIFY_PARAM_NOT_NULL(p_obd_service_client);
    VERIFY_PARAM_NOT_NULL(p_ble_obd_c_init);
    
    // TODO VLINK
    err_code = sd_ble_uuid_vs_add(&amp;amp;obd_base_uuid, &amp;amp;obd_uuid.type);
    VERIFY_SUCCESS(err_code);

    p_obd_service_client-&amp;gt;conn_handle                    = BLE_CONN_HANDLE_INVALID;
    p_obd_service_client-&amp;gt;evt_handler                    = p_ble_obd_c_init-&amp;gt;evt_handler;
    p_obd_service_client-&amp;gt;error_handler                  = p_ble_obd_c_init-&amp;gt;error_handler;
    p_obd_service_client-&amp;gt;obd_service_char.handle_value  = BLE_GATT_HANDLE_INVALID;
    p_obd_service_client-&amp;gt;p_gatt_queue                   = p_ble_obd_c_init-&amp;gt;p_gatt_queue;
    // TODO LE LINK 
    // p_obd_service_client-&amp;gt;uuid_type                      = BLE_UUID_TYPE_BLE;
    // TODO VLINK
    p_obd_service_client-&amp;gt;uuid_type                      = BLE_UUID_TYPE_VENDOR_BEGIN;

    return ble_db_discovery_evt_register(&amp;amp;obd_uuid);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting to Custom Service/Characteristic of BLE peripheral with nRF52 acting as central.</title><link>https://devzone.nordicsemi.com/thread/514099?ContentTypeID=1</link><pubDate>Mon, 09 Dec 2024 16:53:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b46d033-a475-4dcd-9639-282e7340ec13</guid><dc:creator>inspiringdev123</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/tai-le"&gt;Tai&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The three files are as follows:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The LE Link file is me successfully connecting to and initializing one of the OBD II Devices.&lt;/p&gt;
&lt;p&gt;The VLINK file is me successfully connecting to but unsuccessfully finding the service/characteristic to read and write to.&lt;/p&gt;
&lt;p&gt;The VLINK iOS file is an iPhone OBD II app connecting to and initializing the OBD II Device that I am unable to with the nRF52.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I did a primary service discovery with the VLINK device in the nRF52 firmware and only found 4 Primary Services, 0x1800, 0x1801, 0x18F0, and 0x180A. It never found the Unknown Primary Service (e7810a71-73ae-499d-8c15-faa9aef0c3f2). This is the service with the read and write characteristic.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If I use the database discovery module to look for the service, I can find the service. The issue lies in that the&amp;nbsp;p_evt-&amp;gt;params.discovered_db.srv_uuid.type == p_obd_service_client-&amp;gt;uuid_type) is not what I expect. The uuid type of the service is BLE_VENDOR_BEGIN but the discovered uuid type is 4 (which is undefined). Also, if I dive into the specifics of the service, the characteristic is not there.&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/pastedimage1733763203457v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting to Custom Service/Characteristic of BLE peripheral with nRF52 acting as central.</title><link>https://devzone.nordicsemi.com/thread/514065?ContentTypeID=1</link><pubDate>Mon, 09 Dec 2024 14:41:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cd18718-289a-4095-afa5-d6c5b5a3da32</guid><dc:creator>Edvin</dc:creator><description>[quote user="inspiringdev123"]The peripheral is from an outside source, so I do not have&amp;nbsp;any control over the code.[/quote]
&lt;p&gt;So it is not possible to adjust this, as I see.&lt;/p&gt;
&lt;p&gt;What&amp;nbsp; I notice is that the service and characteristic doesn&amp;#39;t have the same base UUID (service starting with 0xe781, and characteristic starting with 0xbef8), which may be causing the issues that you are seeing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If your implementation is based off the NUS_C implementation, there is a check in the callback handler:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    // Check if the NUS was discovered.
    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_NUS_SERVICE)
        &amp;amp;&amp;amp;  (p_evt-&amp;gt;params.discovered_db.srv_uuid.type == p_ble_nus_c-&amp;gt;uuid_type))
    {
        for (uint32_t i = 0; i &amp;lt; p_evt-&amp;gt;params.discovered_db.char_count; i++)
        {
            switch (p_chars[i].characteristic.uuid.uuid)
            {
                case BLE_UUID_NUS_RX_CHARACTERISTIC:
                    nus_c_evt.handles.nus_rx_handle = p_chars[i].characteristic.handle_value;
                    break;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But I am not sure these will end up in the same callback if the Service&amp;#39;s base UUID and characteristic&amp;#39;s base UUID are different. Perhaps you can step through, or try to print the UUIDs in the callback to see how it behaves.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting to Custom Service/Characteristic of BLE peripheral with nRF52 acting as central.</title><link>https://devzone.nordicsemi.com/thread/513902?ContentTypeID=1</link><pubDate>Sat, 07 Dec 2024 00:06:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ada40fd8-011d-4e0d-85c4-846b4b32d16b</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;I&amp;#39;m a bit confused on 3 files you attached. What are two files (3325.VLINK...and 5381.LE LINK). In addition to the capture with iOS, which one that you can receive or write to your peripheral device?&lt;/p&gt;
&lt;p&gt;Without knowing the peripheral firmware, it&amp;#39;s quite challenging. I think using the capture with iOS, you should check how many characteristics that your peripheral device has and what is its service UUID. Having a quick look at it, seems it has 3 characteristics.&lt;/p&gt;
&lt;p&gt;You said your central code was able to discover the service. Check if its service UUID matches with that in the peripheral device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I notice your central code is quite similar to ble_nus_c ble service, you can run that example using another nRF52 chip as a peripheral (running ble_nus_s ble service) to see how they behave.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting to Custom Service/Characteristic of BLE peripheral with nRF52 acting as central.</title><link>https://devzone.nordicsemi.com/thread/513872?ContentTypeID=1</link><pubDate>Fri, 06 Dec 2024 14:59:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dad1c6c2-c84a-4ea2-9d92-e66ee992fe6a</guid><dc:creator>inspiringdev123</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/tai-le"&gt;Tai&lt;/a&gt;&amp;nbsp;The peripheral is from an outside source, so I do not have&amp;nbsp;any control over the code. Android and iOS devices are able to connect to and talk to this device. Just wondering if you see anything else I am possibly doing wrong?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have attached the wireshark capture from the working OBD Device too to the first message as well as an iOS app connecting to the OBD device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting to Custom Service/Characteristic of BLE peripheral with nRF52 acting as central.</title><link>https://devzone.nordicsemi.com/thread/513732?ContentTypeID=1</link><pubDate>Fri, 06 Dec 2024 01:22:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e047302-fbfe-4a6a-9e1a-cc2c0f69a1d6</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;Taking a look at your wireshark report, the peripheral only&amp;nbsp;sent its Characteristic UUID as highlighted in yellow. I believe it has to send its Service UUID as well to be able to talk with the central. Thus, you can check in your peripheral custom ble service init function if you configure it correctly.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:299px;max-width:552px;" height="299" src="https://devzone.nordicsemi.com/resized-image/__size/1104x598/__key/communityserver-discussions-components-files/4/pastedimage1733447741633v1.png" width="552" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting to Custom Service/Characteristic of BLE peripheral with nRF52 acting as central.</title><link>https://devzone.nordicsemi.com/thread/513719?ContentTypeID=1</link><pubDate>Thu, 05 Dec 2024 22:42:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98cfad1e-bd98-41bc-a30a-f7693d2d25c1</guid><dc:creator>inspiringdev123</dc:creator><description>&lt;p&gt;No bonding is needed I believe. I am going to connect to the OBD device with an iOS OBD Car Reader and get the wireshark report and post that in here tomorrow and see if there is anything useful in there that can help us find the issue.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting to Custom Service/Characteristic of BLE peripheral with nRF52 acting as central.</title><link>https://devzone.nordicsemi.com/thread/513718?ContentTypeID=1</link><pubDate>Thu, 05 Dec 2024 22:31:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aad2308c-d8b1-4e93-a8c6-b2cd34e0da75</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;Did you check if bonding process is needed? Please refer to this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/22249/unable-to-send-messages-nrf52-ble-central-custom-device"&gt;post&lt;/a&gt;. Happy to discuss&amp;nbsp;if the prob is still there after you&amp;nbsp;take a look at that post.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting to Custom Service/Characteristic of BLE peripheral with nRF52 acting as central.</title><link>https://devzone.nordicsemi.com/thread/513717?ContentTypeID=1</link><pubDate>Thu, 05 Dec 2024 22:11:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a23d43de-7b2f-4b68-b6f1-846176c8fadb</guid><dc:creator>inspiringdev123</dc:creator><description>&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/pastedimage1733436540097v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/tai-le"&gt;Tai&lt;/a&gt;&amp;nbsp;Seems to be. This is the only characteristic that returns for the given service UUID&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting to Custom Service/Characteristic of BLE peripheral with nRF52 acting as central.</title><link>https://devzone.nordicsemi.com/thread/513716?ContentTypeID=1</link><pubDate>Thu, 05 Dec 2024 22:05:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aaaa2e2d-909c-406d-a170-4ff793d97613</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;Can you check if your BLE peripheral already enabled WRITE, READ, NOTIFY properties or not? You need to enable them so that the central one can be able to interact with.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>