Skip to content

Commit c9b6b4b

Browse files
committed
[ESP32]: Fixed the bluedroid commissioning with latest chip-tool (#37786)
- Added the indicate flag instead of notify as per spec in bluedroid implementation. - Fixes the commissioning failure due to "No valid C2" error.
1 parent c5b37f0 commit c9b6b4b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/platform/ESP32/bluedroid/BLEManagerImpl.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ const ChipBleUUID ChipUUID_CHIPoBLEChar_RX = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0
105105
const ChipBleUUID ChipUUID_CHIPoBLEChar_TX = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F,
106106
0x9D, 0x12 } };
107107

108-
const uint8_t CharProps_ReadNotify = ESP_GATT_CHAR_PROP_BIT_READ | ESP_GATT_CHAR_PROP_BIT_NOTIFY;
109-
const uint8_t CharProps_Write = ESP_GATT_CHAR_PROP_BIT_WRITE;
108+
const uint8_t CharProps_ReadIndicate = ESP_GATT_CHAR_PROP_BIT_READ | ESP_GATT_CHAR_PROP_BIT_INDICATE;
109+
const uint8_t CharProps_Write = ESP_GATT_CHAR_PROP_BIT_WRITE;
110110

111111
// Offsets into CHIPoBLEGATTAttrs for specific attributes.
112112
enum
@@ -136,7 +136,7 @@ const esp_gatts_attr_db_t CHIPoBLEGATTAttrs[] = {
136136

137137
// Characteristic declaration
138138
{ { ESP_GATT_AUTO_RSP },
139-
{ ESP_UUID_LEN_16, (uint8_t *) UUID_CharDecl, ESP_GATT_PERM_READ, 1, 1, (uint8_t *) &CharProps_ReadNotify } },
139+
{ ESP_UUID_LEN_16, (uint8_t *) UUID_CharDecl, ESP_GATT_PERM_READ, 1, 1, (uint8_t *) &CharProps_ReadIndicate } },
140140
// Characteristic value
141141
{ { ESP_GATT_RSP_BY_APP }, { ESP_UUID_LEN_128, (uint8_t *) UUID_CHIPoBLEChar_TX, ESP_GATT_PERM_READ, 512, 0, NULL } },
142142
// Client characteristic configuration description (CCCD) value
@@ -575,7 +575,7 @@ void BLEManagerImpl::gattc_profile_event_handler(esp_gattc_cb_event_t event, esp
575575
{
576576
gl_profile_tab[PROFILE_A_APP_ID].write_char_handle = char_elem_result[i].char_handle;
577577
}
578-
else if (char_elem_result[i].properties & CharProps_ReadNotify)
578+
else if (char_elem_result[i].properties & CharProps_ReadIndicate)
579579
{
580580
gl_profile_tab[PROFILE_A_APP_ID].notify_char_handle = char_elem_result[i].char_handle;
581581
esp_ble_gattc_register_for_notify(gattc_if, gl_profile_tab[PROFILE_A_APP_ID].remote_bda,

0 commit comments

Comments
 (0)