<?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>BLE Central tutorial not connecting to my peripheral</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10497/ble-central-tutorial-not-connecting-to-my-peripheral</link><description>The BLE Central tutorial (S130 based) does not connect to my peripheral. My peripheral connects fine to the Android MCP and the 128-bit service UUID is what I expect. 
 I&amp;#39;m debugging the Central code and looking at the BLE_GAP_EVT_ADV_REPORT case in</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 Dec 2015 19:45:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10497/ble-central-tutorial-not-connecting-to-my-peripheral" /><item><title>RE: BLE Central tutorial not connecting to my peripheral</title><link>https://devzone.nordicsemi.com/thread/39030?ContentTypeID=1</link><pubDate>Wed, 02 Dec 2015 19:45:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec673ab7-b740-48f1-bf6b-38543ce3c21b</guid><dc:creator>Bret Foreman</dc:creator><description>&lt;p&gt;I&amp;#39;ve been working from the BLE Central tutorial all along. The documentation is pretty incomplete and most of the comments in the code are not very helpful. It&amp;#39;s been slow going. For example, it&amp;#39;s not clear at all what&amp;#39;s going on with cccd_configure function or how the arguments sent to it by ble_uart_c_rx_notif_enable work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Central tutorial not connecting to my peripheral</title><link>https://devzone.nordicsemi.com/thread/39031?ContentTypeID=1</link><pubDate>Wed, 02 Dec 2015 10:06:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:565e7859-5062-48c7-91f5-903f82af8089</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;The &lt;a href="https://devzone.nordicsemi.com/tutorials/21"&gt;BLE central tutorial&lt;/a&gt; could be a good starting place.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Central tutorial not connecting to my peripheral</title><link>https://devzone.nordicsemi.com/thread/39029?ContentTypeID=1</link><pubDate>Tue, 01 Dec 2015 19:56:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0391c96-a59b-47ad-9959-02a63bd3ab3d</guid><dc:creator>Bret Foreman</dc:creator><description>&lt;p&gt;I got the the advertising to work and it&amp;#39;s connecting to my BLE Central. Now I&amp;#39;m working on getting the service discovery to work on the Central side. I can see my service in the Android MCP, but not on the Central. I&amp;#39;ll start a new thread for this issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Central tutorial not connecting to my peripheral</title><link>https://devzone.nordicsemi.com/thread/39028?ContentTypeID=1</link><pubDate>Tue, 01 Dec 2015 12:03:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4175152b-47da-4417-8643-9d00eec93c84</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I will start by explaining a couple of concepts regarding UUID&amp;#39;s and advertising. Then i will address your errors.&lt;/p&gt;
&lt;p&gt;When dealing with 128 bits UUID&amp;#39;s, we use a base uuid (128 bit) and a service uuid (16 bit). For example in advertising, the 16 bit uuid is places on byte 12 and 13 of the base uuid, and advertised.&lt;/p&gt;
&lt;p&gt;This is copied from the UUID section of the &lt;a href="https://devzone.nordicsemi.com/tutorials/8/ble-services-a-beginners-tutorial/"&gt;BLE services tutorial&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;quot;The second type is a 128-bit UUID, sometimes referred to as a vendor specific UUID. 
This is the type of UUID you need to use when you are making your own custom services and characteristics. 
It looks something like this: 4A98xxxx-1CC4-E7C1-C757-F1267DD021E8 and is called the “base UUID”. 
The four x’s represent a field where you will insert your own 16-bit IDs for your custom services and characteristics and use them just like a predefined UUID. 
This way you can store the base UUID once in memory, forget about it, and work with 16-bit IDs as normal.&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the nus (Nordic Uart Service) example we use the function&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sd_ble_uuid_vs_add(&amp;amp;nus_base_uuid, &amp;amp;p_nus-&amp;gt;uuid_type)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to add a base uuid to the softdevice. The p_nus-&amp;gt;uuid_type will be written when calling the function. This variable will contain the uuid type of the base uuid. In practice, it is a number to where in a table the base uuid was stored.&lt;/p&gt;
&lt;p&gt;The first time we call &lt;code&gt;sd_ble_uuid_vs_add&lt;/code&gt;, the base uuid we put in is stored at the index BLE_UUID_TYPE_VENDOR_BEGIN. Therefore. If we add another, it will be at BLE_UUID_TYPE_VENDOR_BEGIN+1. Since you are only using one custom service (i am assuming), your base uuid will be at BLE_UUID_TYPE_VENDOR_BEGIN.&lt;/p&gt;
&lt;p&gt;In any case: The best way to do this is to store the value p_nus-&amp;gt;uuid_type, and use this whenever we do anything related to the base uuid. (For example adding a service, or adding the full uuid to the advertising packet). We can see that this is actually being done by the NUS code inside &lt;code&gt;ble_nus_init&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now. In the NUS peripheral example, we see that the type BLE_UUID_TYPE_VENDOR_BEGIN is used for the type in the uuid array m_adv_uuids. This is actually a &amp;quot;shortcut&amp;quot; or easy solution. Since we know that we will only add one custom (or vendor specific) uuid, we know that BLE_UUID_TYPE_VENDOR_BEGIN will be the correct type.&lt;/p&gt;
&lt;p&gt;On to solving your issue. Either use BLE_UUID_TYPE_VENDOR_BEGIN as the uuid type THROUGHPUT_SERVICE_UUID_TYPE. Or use the uuid type stored in m_nus.uuid_type.&lt;/p&gt;
&lt;p&gt;Let me know if anything is unclear.&lt;/p&gt;
&lt;p&gt;-Anders&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Central tutorial not connecting to my peripheral</title><link>https://devzone.nordicsemi.com/thread/39024?ContentTypeID=1</link><pubDate>Tue, 01 Dec 2015 01:11:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edb9d9e1-927a-42b0-bed9-7ea61490ab5c</guid><dc:creator>Bret Foreman</dc:creator><description>&lt;p&gt;One more detail, my UUID type is calculated like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define THROUGHPUT_SERVICE_UUID_TYPE (BLE_UUID_TYPE_VENDOR_BEGIN + 1)
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Central tutorial not connecting to my peripheral</title><link>https://devzone.nordicsemi.com/thread/39023?ContentTypeID=1</link><pubDate>Tue, 01 Dec 2015 01:07:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad7e034e-6204-4fa5-ba65-e884f89c82cf</guid><dc:creator>Bret Foreman</dc:creator><description>&lt;p&gt;Ah, I see what&amp;#39;s wrong. My short and long UUIDs don&amp;#39;t match. I fixed that and now I&amp;#39;m getting an invalid parameter error from ble_advertising_init. Tracing into it makes me think the problem is in the second argument, the scan response. I&amp;#39;m setting up the second argument like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;scanrsp.uuids_complete.uuid_cnt = 1;
scanrsp.uuids_complete.p_uuids  = throughput_short_uuid_list;
err_code = ble_advertising_init(&amp;amp;advdata, &amp;amp;scanrsp, &amp;amp;options, on_adv_evt, NULL);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Where throughput_short_uuid_list is defined like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static ble_uuid_t throughput_short_uuid_list[] = {{ .uuid = 0 , .type = THROUGHPUT_SERVICE_UUID_TYPE }};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Is this the correct way to call the function with this parameter?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Central tutorial not connecting to my peripheral</title><link>https://devzone.nordicsemi.com/thread/39026?ContentTypeID=1</link><pubDate>Mon, 30 Nov 2015 22:32:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0f07293-eb89-435e-b41e-c0217493fbc6</guid><dc:creator>Bret Foreman</dc:creator><description>&lt;p&gt;I should clarify that both the S130 Central and the MCP are seeing the same UUID, with position 12 changed from what I&amp;#39;m trying to send from the Peripheral.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Central tutorial not connecting to my peripheral</title><link>https://devzone.nordicsemi.com/thread/39025?ContentTypeID=1</link><pubDate>Mon, 30 Nov 2015 22:28:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b812e20-b427-4855-b116-2d52d130484a</guid><dc:creator>Bret Foreman</dc:creator><description>&lt;p&gt;I found a problem, though it does not point to any obvious root cause. The peripheral is sending UUID: 0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, 0x00, 0x00, 0x40, 0x6E. But the Central is receiving UUID: 0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, 0x01, 0x00, 0x40, 0x6E.&lt;/p&gt;
&lt;p&gt;Note that position 12 (counting from 0) is a 0x01 at the Central rather than the 0x00 sent by the peripheral.&lt;/p&gt;
&lt;p&gt;Any ideas why this might be happening?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Central tutorial not connecting to my peripheral</title><link>https://devzone.nordicsemi.com/thread/39027?ContentTypeID=1</link><pubDate>Thu, 26 Nov 2015 08:53:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88712b00-8d08-4b6c-8a97-c5ecfcb938ee</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;Can you post a screenshot of the advertisement data shown in MCP? optionally, write all the uuid&amp;#39;s in the advertisement packet here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>