Questions regarding GATT table in examples
Posted: Mon Nov 08, 2021 1:54 pm
Hello!
I'm quite new to the ESP32 and ESP-IDF, so some patience will be greatly appretiated.
I'm trying to understand the GATT table on several GATT Server examples included in the ESP-IDF suite. I'll show the code where the table is generated
When checking with the nRF Connect app, I get the information shown on the attached image
I'm having a hard time figuring out how both things are related. Some UUID apears, others don't, why? How different elements of the table are related to the same attribute if no variables are shared between table elements? What does each element of the table means? What is that I'm not getting?
It would be great if somebody would be so kind to point me in the right direction or explain to me a little bit what's happening
Regards!
I'm quite new to the ESP32 and ESP-IDF, so some patience will be greatly appretiated.
I'm trying to understand the GATT table on several GATT Server examples included in the ESP-IDF suite. I'll show the code where the table is generated
- /* Full Database Description - Used to add attributes into the database */
- 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,
- 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_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
- CHAR_DECLARATION_SIZE, CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_read_write_notify}},
- /* Characteristic Value */
- [IDX_CHAR_VAL_A] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (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}},
- /* Client Characteristic Configuration Descriptor */
- [IDX_CHAR_CFG_A] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_client_config_uuid, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- sizeof(uint16_t), sizeof(heart_measurement_ccc), (uint8_t *)heart_measurement_ccc}},
- /* Characteristic Declaration */
- [IDX_CHAR_B] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
- CHAR_DECLARATION_SIZE, CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_read}},
- /* Characteristic Value */
- [IDX_CHAR_VAL_B] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&GATTS_CHAR_UUID_TEST_B, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- GATTS_DEMO_CHAR_VAL_LEN_MAX, sizeof(char_value), (uint8_t *)char_value}},
- /* Characteristic Declaration */
- [IDX_CHAR_C] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
- CHAR_DECLARATION_SIZE, CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_write}},
- /* Characteristic Value */
- [IDX_CHAR_VAL_C] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&GATTS_CHAR_UUID_TEST_C, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- GATTS_DEMO_CHAR_VAL_LEN_MAX, sizeof(char_value), (uint8_t *)char_value}},
- };
I'm having a hard time figuring out how both things are related. Some UUID apears, others don't, why? How different elements of the table are related to the same attribute if no variables are shared between table elements? What does each element of the table means? What is that I'm not getting?
It would be great if somebody would be so kind to point me in the right direction or explain to me a little bit what's happening
Regards!