Skip to content

Commit 409c94b

Browse files
committed
[ESP32]: Fixed the bluedroid commissioning with latest chip-tool
- 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 06edeee commit 409c94b

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
@@ -100,8 +100,8 @@ const uint8_t UUID_CHIPoBLEChar_TX[] = { 0x12, 0x9D, 0x9F, 0x42, 0x9C, 0x4F
100100
const uint8_t ShortUUID_CHIPoBLE_CharTx_Desc[] = { 0x02, 0x29 };
101101
#endif
102102

103-
const uint8_t CharProps_ReadNotify = ESP_GATT_CHAR_PROP_BIT_READ | ESP_GATT_CHAR_PROP_BIT_NOTIFY;
104-
const uint8_t CharProps_Write = ESP_GATT_CHAR_PROP_BIT_WRITE;
103+
const uint8_t CharProps_ReadIndicate = ESP_GATT_CHAR_PROP_BIT_READ | ESP_GATT_CHAR_PROP_BIT_INDICATE;
104+
const uint8_t CharProps_Write = ESP_GATT_CHAR_PROP_BIT_WRITE;
105105

106106
// Offsets into CHIPoBLEGATTAttrs for specific attributes.
107107
enum
@@ -131,7 +131,7 @@ const esp_gatts_attr_db_t CHIPoBLEGATTAttrs[] = {
131131

132132
// Characteristic declaration
133133
{ { ESP_GATT_AUTO_RSP },
134-
{ ESP_UUID_LEN_16, (uint8_t *) UUID_CharDecl, ESP_GATT_PERM_READ, 1, 1, (uint8_t *) &CharProps_ReadNotify } },
134+
{ ESP_UUID_LEN_16, (uint8_t *) UUID_CharDecl, ESP_GATT_PERM_READ, 1, 1, (uint8_t *) &CharProps_ReadIndicate } },
135135
// Characteristic value
136136
{ { ESP_GATT_RSP_BY_APP }, { ESP_UUID_LEN_128, (uint8_t *) UUID_CHIPoBLEChar_TX, ESP_GATT_PERM_READ, 512, 0, NULL } },
137137
// Client characteristic configuration description (CCCD) value
@@ -568,7 +568,7 @@ void BLEManagerImpl::gattc_profile_event_handler(esp_gattc_cb_event_t event, esp
568568
{
569569
gl_profile_tab[PROFILE_A_APP_ID].write_char_handle = char_elem_result[i].char_handle;
570570
}
571-
else if (char_elem_result[i].properties & CharProps_ReadNotify)
571+
else if (char_elem_result[i].properties & CharProps_ReadIndicate)
572572
{
573573
gl_profile_tab[PROFILE_A_APP_ID].notify_char_handle = char_elem_result[i].char_handle;
574574
esp_ble_gattc_register_for_notify(gattc_if, gl_profile_tab[PROFILE_A_APP_ID].remote_bda,

0 commit comments

Comments
 (0)