BLE: How change UUID16 by UUID128
Posted: Fri Jan 15, 2021 1:58 am
Hello, I am using the example https://github.com/espressif/esp-idf/bl ... eat_demo.c that sets all UUIDs (Service and Characteristics) to 16 bits by default, however I am interested in setting them to 128 bits.
But I'm having a lot of problems since I don't know what to modify.
I'm pretty sure all I have to do is within the following code excerpt:
If anyone has any advice to modify the code to get UUID128, I will be very grateful.
Thanks a lot
Gustavo
But I'm having a lot of problems since I don't know what to modify.
I'm pretty sure all I have to do is within the following code excerpt:
Code: Select all
static const uint16_t GATTS_SERVICE_UUID_TEST = 0x00FF;
static const uint16_t GATTS_CHAR_UUID_TEST_A = 0xFF01;
Code: Select all
static const esp_gatts_attr_db_t gatt_db[HRS_IDX_NB] =
{
// Service Declaration
[IDX_SVC] =
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&primary_service_uuid, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
sizeof(uint16_t), sizeof(GATTS_SERVICE_UUID_TEST), (uint8_t *)&GATTS_SERVICE_UUID_TEST}},
/* Characteristic Declaration */
[IDX_CHAR_A] =
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_128, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
CHAR_DECLARATION_SIZE, CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_read_write}},
/* Characteristic Value */
[IDX_CHAR_VAL_A] =
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_128, (uint8_t *)&GATTS_CHAR_UUID_TEST_A, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
GATTS_DEMO_CHAR_VAL_LEN_MAX, sizeof(char_value), (uint8_t *)char_value}},
.
.
.
Thanks a lot
Gustavo