esp-idf: Bluedroid 128 bit UUID Guide not working (IDFGH-10691)

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

I am trying to follow the Readme here but cant get past step 3, since it fails to build with different variations of this error: variable “remote_filter_service_uuid” is not a type name

My code below: `static uint8_t gatts_service_uuid128[ESP_UUID_LEN_128] = {0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0xe9, 0xfe, 0x00, 0x00}; static esp_bt_uuid_t remote_filter_service_uuid = { .len = ESP_UUID_LEN_128, // Changed from ESP_UUID_LEN_16 .uuid = { //.uuid128 = {0xfb,0x34,0x9b,0x5f,0x80,0x00,0x00,0x80,0x00,0x10,0x00,0x00,0xe9,0xfe,0x00,0x00}, .uuid128 = {0}, }, }; // memcpy(&remote_filter_service_uuid.uuid.uuid128, gatts_service_uuid128, ESP_UUID_LEN_128); // Doesn’t work memcpy(remote_filter_service_uuid.uuid.uuid128, gatts_service_uuid128, ESP_UUID_LEN_128); // Doesn’t work // esp_bt_uuid_t *remote_filter_service_uuid_pointer; // memcpy((remote_filter_service_uuid_pointer->uuid.uuid128), gatts_service_uuid128, ESP_UUID_LEN_128);// Doesn’t work

static uint8_t gatts_char_uuid128[ESP_UUID_LEN_128] = {0x01, 0x96, 0x12, 0x16, 0x54, 0x92, 0x75, 0xb5, 0xa2, 0x45, 0xfd, 0xab, 0x39, 0xc4, 0x4b, 0xd4}; static esp_bt_uuid_t remote_filter_char_uuid = { .len = ESP_UUID_LEN_128, // Changed from ESP_UUID_LEN_16 .uuid = { //.uuid128 = {0x01, 0x96, 0x12, 0x16, 0x54, 0x92, 0x75, 0xb5, 0xa2, 0x45, 0xfd, 0xab, 0x39, 0xc4, 0x4b, 0xd4}, .uuid128 = {0}, }, }; // memcpy(&remote_filter_char_uuid.uuid.uuid128, gatts_char_uuid128, ESP_UUID_LEN_128); // Doesn’t work memcpy(remote_filter_char_uuid.uuid.uuid128, gatts_char_uuid128, ESP_UUID_LEN_128); // Doesn’t work`

It would help immensely if the Readme would include a working example where its easier to see where and how to implement step 3 (memcpy).

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17

Most upvoted comments

@Svahnen-Perific You need to pay attention that The client-side has converted a 128-bit UUID to a 16-bit UUID. If you still have questions, you can provide more information. Thanks.