Merge 7520829ddd20852bcfb04487b401d36c462ed684 into 83e8f70ee4f7ddb6b874bdb81a1f75ceeeba58e4

This commit is contained in:
mitchellcairns 2025-02-28 20:09:35 -08:00 committed by GitHub
commit 68b98092b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -476,6 +476,17 @@ static void hid_event_handler(esp_ble_hidd_dev_t *dev, int device_index, esp_gat
dev->conn_id = param->connect.conn_id;
memcpy(dev->remote_bda, param->connect.remote_bda, ESP_BD_ADDR_LEN);
// ADD THIS BLOCK: Initialize CCC for all reports
for (int i = 0; i < dev->devices[device_index].reports_len; i++) {
hidd_le_report_item_t *map = &dev->devices[device_index].reports[i];
if (map->ccc_handle && !map->ccc.notify_enable && !map->ccc.indicate_enable) {
ESP_LOGW(TAG, "Initializing CCC for report %d", map->report_id);
map->ccc.notify_enable = true;
map->ccc.indicate_enable = true;
map->ccc.value = 0x03; // Enable notifications and indications
}
}
esp_ble_set_encryption(param->connect.remote_bda, ESP_BLE_SEC_ENCRYPT_NO_MITM);
esp_hidd_event_data_t cb_param = {