128 bit UUID in Client example

tombo89
Posts: 3
Joined: Wed Aug 29, 2018 9:13 pm

128 bit UUID in Client example

Postby tombo89 » Wed Aug 29, 2018 9:24 pm

Hello,
I'm trying to build a code with the Client Example to connect to a Android App with custom UUID. I have managed to establish the connection, but can't find the Service. I didn't find anything about using 128 bit UUIDS.

My Problems are in this line

Code: Select all

 if (p_data->search_res.srvc_id.uuid.len == ESP_UUID_LEN_128 && p_data->search_res.srvc_id.uuid.uuid.uuid16 == REMOTE_SERVICE_UUID)
Error Message, Conversion always false due to limited range of data type.

I've defined the UUID like this

Code: Select all

#define REMOTE_SERVICE_UUID         0x71C1E128D92F4FA8A2B20F171DB3436C
#define REMOTE_NOTIFY_CHAR_UUID    0x503DD6059BCB4F6EB235270A57483026

Code: Select all

static esp_bt_uuid_t remote_filter_service_uuid = {
    .len = ESP_UUID_LEN_128,
	.uuid.uuid128 =
	        {
	        		0x71, 0xC1, 0xE1, 0x28, 0xD9, 0x2F, 0x4F, 0xA8, 0xA2, 0xB2, 0x0F, 0x17, 0x1D, 0xB3, 0x43, 0x6C,
	},

};

static esp_bt_uuid_t remote_filter_char_uuid = {
    .len = ESP_UUID_LEN_128,
    .uuid.uuid128=
    		{0x50, 0x3D, 0xD6, 0x05, 0x9B, 0xCB, 0x4F, 0x6E, 0xB2, 0x35, 0x27, 0x0A, 0x57, 0x48, 0x30, 0x26},
};
Maybe someone have a Link or some Info for me?

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

Re: 128 bit UUID in Client example

Postby chegewara » Fri Aug 31, 2018 11:48 pm

This should work, but you have to remember that uuid is little endian in this case:

Code: Select all

static esp_bt_uuid_t remote_filter_service_uuid = {
    .len = ESP_UUID_LEN_128,
   .uuid.uuid128 =
           {
                 0x71, 0xC1, 0xE1, 0x28, 0xD9, 0x2F, 0x4F, 0xA8, 0xA2, 0xB2, 0x0F, 0x17, 0x1D, 0xB3, 0x43, 0x6C,
   },

};

tombo89
Posts: 3
Joined: Wed Aug 29, 2018 9:13 pm

Re: 128 bit UUID in Client example

Postby tombo89 » Sun Sep 02, 2018 1:58 pm

Hello, but then i have not defined 128 bit UUID to " REMOTE_SERVICE_UUID" for this line

Code: Select all

if (p_data->search_res.srvc_id.uuid.len == ESP_UUID_LEN_16 && p_data->search_res.srvc_id.uuid.uuid.uuid16 == REMOTE_SERVICE_UUID) {

Who is online

Users browsing this forum: ESP_Sprite, Google [Bot] and 53 guests