Creating service and characteristic with 128 bit UUID

sankharay
Posts: 4
Joined: Wed Oct 24, 2018 7:02 am

Creating service and characteristic with 128 bit UUID

Postby sankharay » Wed Oct 24, 2018 9:04 am

Hi
I am trying to create a service and characteristic with 128 bit UUID. I am using gatt_server_service_table_demo (in table services and characteristic are 16 bit in example code) . I have changed the service to 128 bit in gatt tab but after that service is not getting discovered. Please let me know how I can declare services and characteristic with 128 bit UUID or I have to use esp_ble_gatts_create_service function.

sankharay
Posts: 4
Joined: Wed Oct 24, 2018 7:02 am

Re: Creating service and characteristic with 128 bit UUID

Postby sankharay » Wed Oct 31, 2018 12:58 pm

Hi
as I told I am not able to create services and characteristic of 128 bit UUID by declaring gatt_db array for example I am using a 128 bit service as below

// Service Declaration
[IDX_SVC] =
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_128, (uint8_t *)service_uuid, ESP_GATT_PERM_READ,
ESP_UUID_LEN_128, sizeof(service_uuid), (uint8_t *)service_uuid}}

service_uuid contains 128 bit UUID in an array.
Which is not working. Please let me know the correct way to declare 128 bit UUID

Karim1993
Posts: 20
Joined: Mon Aug 27, 2018 4:28 am

Re: Creating service and characteristic with 128 bit UUID

Postby Karim1993 » Thu Nov 01, 2018 12:06 pm

Any Update On this ???

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

Re: Creating service and characteristic with 128 bit UUID

Postby chegewara » Thu Nov 01, 2018 12:22 pm

Here you have nice tutorial with info you need:
https://github.com/espressif/esp-idf/bl ... bute-table

You changed this initialization too much:

Code: Select all

[IDX_SVC] =
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_128, (uint8_t *)service_uuid, ESP_GATT_PERM_READ,
ESP_UUID_LEN_128, sizeof(service_uuid), (uint8_t *)service_uuid}}
(uint8_t *)&primary_service_uuid: UUID to identify the service as a primary one (0x2800).

Who is online

Users browsing this forum: No registered users and 91 guests