<?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>Custom BLE Client with 128BIT UUID</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/101717/custom-ble-client-with-128bit-uuid</link><description>Hello, 
 I&amp;#39;ve needed recently to relay some results from my 52840 peripherals to the 7002dk which has the 5340 on it. I&amp;#39;ve managed to get the Central HR and Peripheral HR examples to work flawlessly however I&amp;#39;d like to send my custom data and respective</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 Jul 2023 12:10:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/101717/custom-ble-client-with-128bit-uuid" /><item><title>RE: Custom BLE Client with 128BIT UUID</title><link>https://devzone.nordicsemi.com/thread/435968?ContentTypeID=1</link><pubDate>Wed, 12 Jul 2023 12:10:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7086dab-a689-4059-96c2-6cd5fbd16a0f</guid><dc:creator>DougMortime</dc:creator><description>&lt;p&gt;Haha no problems! Thanks for pointing me to the&amp;nbsp;scanning module.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;DM&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom BLE Client with 128BIT UUID</title><link>https://devzone.nordicsemi.com/thread/435966?ContentTypeID=1</link><pubDate>Wed, 12 Jul 2023 12:09:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b400dd4b-6069-4441-bff7-be693bf55506</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I was just about to review your code. Thanks for the update!&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom BLE Client with 128BIT UUID</title><link>https://devzone.nordicsemi.com/thread/435965?ContentTypeID=1</link><pubDate>Wed, 12 Jul 2023 12:08:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f81dde6-1f14-45be-9e39-bfd4285861b3</guid><dc:creator>DougMortime</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Finally, tracked down the issue. It was the gatt_chrc.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;params.value_handle = gatt_chrc-&amp;gt;value_handle&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Now its working as intended.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;DM&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom BLE Client with 128BIT UUID</title><link>https://devzone.nordicsemi.com/thread/435803?ContentTypeID=1</link><pubDate>Tue, 11 Jul 2023 19:17:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4a52711-b3c3-49b0-bbf4-60e72c596787</guid><dc:creator>DougMortime</dc:creator><description>&lt;p&gt;Hello Vidar,&lt;/p&gt;
&lt;p&gt;After a long slog I finally have it connecting and discovering the service as well as the characteristic. The notification however won&amp;#39;t come through, I&amp;#39;ve tried the peripheral on another device (iPad as client) and it works seamlessly.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I note that when I disconnect the peripheral, turn off the power, finally my notify_func gets called albeit its null.&lt;br /&gt;&lt;br /&gt;Any thoughts&amp;nbsp;at all would be appreciated greatly.&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve attached the relevant code based on your input to use the scanning module.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static struct bt_conn *default_conn;

static uint8_t notify_func(struct bt_conn *conn,
						   struct bt_gatt_subscribe_params *params,
						   const void *data, uint16_t length)
{

	printk(&amp;quot;Notification: data %p length %u\n&amp;quot;, data, length);
	return BT_GATT_ITER_CONTINUE;
}

static void discovery_complete(struct bt_gatt_dm *dm,
							   void *context)
{

	printk(&amp;quot;Service discovery completed\n&amp;quot;);

	bt_gatt_dm_data_print(dm);
	const struct bt_gatt_dm_attr *gatt_service_attr = bt_gatt_dm_service_get(dm);
	const struct bt_gatt_service_val *gatt_service = bt_gatt_dm_attr_service_val(gatt_service_attr);
	char uuid_str[37];
	bt_uuid_to_str(gatt_service-&amp;gt;uuid, uuid_str, sizeof(uuid_str));
	printk(&amp;quot;Discovered service %s\n&amp;quot;, uuid_str);
	memset(uuid_str, 0, sizeof(uuid_str));

	const struct bt_uuid *chrc_ptr = BT_UUID_DECLARE_128(BT_UUID_SENSOR_INPUT1);
	bt_uuid_to_str(chrc_ptr, uuid_str, sizeof(uuid_str));
	printk(&amp;quot;CHRC UUID %s\n&amp;quot;, uuid_str);
	const struct bt_gatt_dm_attr *gatt_chrc_attr = bt_gatt_dm_char_by_uuid(dm, chrc_ptr);
	if (!gatt_chrc_attr)
	{
		printk(&amp;quot;No matching characteristics found\n&amp;quot;);
		return;
	}

	const struct bt_gatt_chrc *gatt_chrc = bt_gatt_dm_attr_chrc_val(gatt_chrc_attr);

	const struct bt_gatt_dm_attr *gatt_chrc_ccc = bt_gatt_dm_desc_by_uuid(dm, gatt_chrc_attr, BT_UUID_GATT_CCC);
	if (!gatt_chrc_ccc)
	{
		printk(&amp;quot;CCC handle not found\n&amp;quot;);
		return;
	}

	struct bt_gatt_subscribe_params params;
	memset(&amp;amp;params, 0, sizeof(params));
	params.ccc_handle = gatt_chrc_ccc-&amp;gt;handle;
	params.value_handle = gatt_chrc_attr-&amp;gt;handle; 
	params.value = BT_GATT_CCC_NOTIFY;
	params.notify = notify_func;

	int err = bt_gatt_subscribe(default_conn, &amp;amp;params);
	if (err &amp;amp;&amp;amp; err != -EALREADY)
	{
		printk(&amp;quot;Subscribe failed (err %d)\n&amp;quot;, err);
	}
	else
	{
		printk(&amp;quot;Subscribed\n&amp;quot;);
	}

	bt_gatt_dm_data_release(dm);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;DM&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom BLE Client with 128BIT UUID</title><link>https://devzone.nordicsemi.com/thread/435717?ContentTypeID=1</link><pubDate>Tue, 11 Jul 2023 12:18:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dde8f4fc-3c00-4877-b38c-11ab5c9ffd66</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello Doug,&lt;/p&gt;
&lt;p&gt;I think it&amp;#39;s easier to use&amp;nbsp;our&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/bluetooth_services/scan.html#scanning-module"&gt;Scanning module&lt;/a&gt;&amp;nbsp;with filter matching, same as we do in the central uart sample here:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/samples/bluetooth/central_uart/src/main.c#L502"&gt;https://github.com/nrfconnect/sdk-nrf/blob/main/samples/bluetooth/central_uart/src/main.c#L502&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Now to the section where I think the issue really is, the eir_found callback function.[/quote]
&lt;p&gt;I&amp;nbsp;guess it fails because it does not find a matching UUID? I would suggest to print the UUIDs parsed from the adv. packets to see if the expected UUID is found our not.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom BLE Client with 128BIT UUID</title><link>https://devzone.nordicsemi.com/thread/435564?ContentTypeID=1</link><pubDate>Mon, 10 Jul 2023 17:45:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:771943d0-356d-4865-a729-7ba5e258a61e</guid><dc:creator>DougMortime</dc:creator><description>&lt;p&gt;I should have been clearer, what doesn&amp;#39;t work is that I can&amp;#39;t seem to connect to any peripherals at all, the scanning seems to be fine.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;DM&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>