<?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 connection by UUID</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99857/ble-connection-by-uuid</link><description>Hello there, I want to connect my nordic nrf52840 with another BLE device and then I&amp;#39;ll try to send from the nordic to the device some data. 
 The nordic acts as central and I made it scan by name the BLE devices. So I can connect to the other device</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 01 Jun 2023 07:59:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99857/ble-connection-by-uuid" /><item><title>RE: BLE connection by UUID</title><link>https://devzone.nordicsemi.com/thread/428628?ContentTypeID=1</link><pubDate>Thu, 01 Jun 2023 07:59:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e35ad6f3-2671-4297-8eb9-3033f86a142a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;bt_nus_send() is the function used for the peripheral to send a notification to the central (if the central has enabled notifications. You want to look at the &lt;strong&gt;central_uart&lt;/strong&gt; sample, and how it uses&amp;nbsp;bt_nus_client_send(). Note that in order for this to work, you need to do a service discovery. Note how discovery_complete uses bt_nus_handles_assign() to assign the correct handles to the different characteristics. You need to do the same for your service/characteristics.&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection by UUID</title><link>https://devzone.nordicsemi.com/thread/428233?ContentTypeID=1</link><pubDate>Tue, 30 May 2023 14:44:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:452dea70-660a-483a-b0ec-10e593480285</guid><dc:creator>DenRatio</dc:creator><description>&lt;p&gt;Hello Edvin!&amp;nbsp;&lt;br /&gt;of course! they are connected!, but I&amp;#39;m not able to send data from the central to the peripheral.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;No, I didn&amp;#39;t enable notifications from my central app. I&amp;#39;ll try to enable them, but for now I need to send data from central to peripheral; then later I&amp;#39;ll try to send from the peripheral to the central.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;More than this, I tried to find services using the function bt_gatt_dm_start as done in the central_uart example, but passing to the function bt_gatt_dm_start the service I indicated in the first post.&lt;br /&gt;Something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define BT_UUID_MICROCHIP_VAL \
	BT_UUID_128_ENCODE(0x49535343, 0xfe7d, 0x4ae5, 0x8fa9, 0x9fafd205e455)
#define BT_UUID_MICROCHIP_TX_VAL \
	BT_UUID_128_ENCODE(0x49535343, 0x1e4d, 0x4bd9, 0xba61, 0x23c647249616)
#define BT_UUID_MICROCHIP_RX_VAL \
	BT_UUID_128_ENCODE(0x49535343, 0x8841, 0x43f4, 0xa8d4, 0xecbe34729bb3)

....

static void gatt_discover(struct bt_conn *conn)
{
	int err;
    ...
	err = bt_gatt_dm_start(conn, BT_UUID_MICROCHIP_SERVICE, &amp;amp;discovery_cb, &amp;amp;nus_client);
    ...
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The gatt_discover function is called in the &amp;quot;connected&amp;quot; callback after MTU has been axchanged.&lt;br /&gt;&lt;br /&gt;How can I print discovered services? I tried with the function&amp;nbsp;bt_gatt_dm_data_print enabling it in my prj.conf but I have not a print result.&lt;br /&gt;&lt;br /&gt;And how can I send (or try to) data over gatt? I tried with bt_nus_send function but I&amp;#39;m doing something wrong, probably...&lt;/p&gt;
&lt;p&gt;Thank you again for your help.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection by UUID</title><link>https://devzone.nordicsemi.com/thread/428174?ContentTypeID=1</link><pubDate>Tue, 30 May 2023 13:04:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4870424e-7794-4807-ab62-5096ff3e840b</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;It looks like the UUID byte order is fine.&lt;/p&gt;
&lt;p&gt;I am a bit confused. You talk about sending data, but are you actually able to find the device and connect?&lt;/p&gt;
[quote user="DenRatio"]Using a no security connection I see them connected using on the nordic the &amp;quot;central_uart&amp;quot; example modified a little because of make a connection.&lt;br /&gt;[/quote]
&lt;p&gt;I assume they are connected.&lt;/p&gt;
&lt;p&gt;Did you enable notifications from your central application, like the ble_app_uart_c does? This is needed for the peripheral to send data to the central. Then you can write to the RX characteristic, it appears, just like you can write to the RX characteristic of the Nordic UART service.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How are you currently trying to send the data? What does it say/return when you are trying to do so?&lt;/p&gt;
&lt;p&gt;Are you able to send data to the device using the mobile app that your screenshots are from (nRF Connect for Android, I guess)?&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: BLE connection by UUID</title><link>https://devzone.nordicsemi.com/thread/427819?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 13:16:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8949c425-213c-41b2-88bd-3f7d7f5b74e5</guid><dc:creator>DenRatio</dc:creator><description>&lt;p&gt;Hello there!&lt;/p&gt;
&lt;p&gt;I tried to do as you described:&lt;br /&gt;I installed on my DK the peripheral example and on nRF connect app I looked at the uuids my peripheral chip &amp;quot;shares&amp;quot;.&lt;br /&gt;I put here pictures of how the two peripherals UUID appeared.&lt;/p&gt;
&lt;p&gt;Here is how Nordic&amp;#39;s UUID appears&lt;br /&gt;&lt;br /&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/NORDICUART.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Here, instead, you can see the other chip&amp;#39;s ones&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:502px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1004x480/__key/communityserver-discussions-components-files/4/RATIOUART.jpg" /&gt;&lt;br /&gt;It seems they have the same shape exactly you described, but the little difference that they has all different values (not for the one weird byte)&lt;br /&gt;&lt;br /&gt;So, what can I do to make them comunicate?&amp;nbsp;&lt;br /&gt;Using a no security connection I see them connected using on the nordic the &amp;quot;central_uart&amp;quot; example modified a little because of make a connection.&lt;br /&gt;But I can not filter in scan phase for UUID services...&lt;br /&gt;&lt;br /&gt;After this I can&amp;#39;t understand how to send a data from the central to peripheral using the chip uuid.&lt;br /&gt;Can you help me in this? Am I clear?&lt;br /&gt;Thank you for your help.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection by UUID</title><link>https://devzone.nordicsemi.com/thread/426608?ContentTypeID=1</link><pubDate>Mon, 22 May 2023 13:44:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78ecad8f-fc3e-46e4-a5e7-0a8cdaf72711</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The first thing that comes to mind is the way that UUIDs are represented, which is not really that intuitive.&amp;nbsp;&lt;/p&gt;
[quote user=""]&lt;span&gt;Service UUID: 49535343FE7D4AE58FA99FAFD205E455&lt;/span&gt;&lt;br /&gt;&lt;span&gt;TX characteristic UUID: 495353431E4D4BD9BA6123C647249616&lt;/span&gt;&lt;br /&gt;&lt;span&gt;RX characteristic UUID: 49535343884143F4A8D4ECBE34729BB3&lt;/span&gt;[/quote]
&lt;p&gt;Where did you find these values? Typically, UUIDs are represented in chunks of 4 + 2 + 2 + 2 + 6 bytes, where the endianness is a bit weird. What I suggest you do is to flash a DK with the peripheral_uart sample, and connect to it with whatever central you have available (extra DK running with nRF Connect for Desktop -&amp;gt; Bluetooth Low Energy, or a mobile phone). Take note of the UUID that you see for this service/characteristic. Then connect to your peripheral, and take note of it&amp;#39;s UUID. Then compare the Nordic UART Service UUID with the way it is represented in the nus.h file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/** @brief UUID of the NUS Service. **/
#define BT_UUID_NUS_VAL \
	BT_UUID_128_ENCODE(0x6e400001, 0xb5a3, 0xf393, 0xe0a9, 0xe50e24dcca9e)

/** @brief UUID of the TX Characteristic. **/
#define BT_UUID_NUS_TX_VAL \
	BT_UUID_128_ENCODE(0x6e400003, 0xb5a3, 0xf393, 0xe0a9, 0xe50e24dcca9e)

/** @brief UUID of the RX Characteristic. **/
#define BT_UUID_NUS_RX_VAL \
	BT_UUID_128_ENCODE(0x6e400002, 0xb5a3, 0xf393, 0xe0a9, 0xe50e24dcca9e)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Looking at nRF Connect for Desktop -&amp;gt; Bluetooth Low Energy, the Nordic UART Service UUID looks like this:&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/pastedimage1684763011774v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Is your peripheral&amp;#39;s UUID represented in the same order as you wrote, or are the chunks perhaps swapped?&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: BLE connection by UUID</title><link>https://devzone.nordicsemi.com/thread/426306?ContentTypeID=1</link><pubDate>Fri, 19 May 2023 12:18:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d4379ef-c655-4934-9bdc-8a8ded06e84d</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;I am sorry, but we are short staffed this week due to Public Holidays in Norway. We will be back on Monday 22nd and hope to be able to answer all incoming requests within a couple of days, depending on the backlog. I am sorry for the inconvenience.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>