From c37523a06f8ea25fd85ad72be0d83ee2eea3c952 Mon Sep 17 00:00:00 2001 From: Mitch Cairns Date: Thu, 4 Jul 2024 21:02:00 -0700 Subject: [PATCH] Stack fixes - Ignore boot mode change command or at least pass it through before taking action - Increase SDP padding size --- .../host/bluedroid/common/include/common/bt_target.h | 3 ++- components/esp_hid/src/bt_hidd.c | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/components/bt/host/bluedroid/common/include/common/bt_target.h b/components/bt/host/bluedroid/common/include/common/bt_target.h index cb87f02f22..b38187a4e3 100644 --- a/components/bt/host/bluedroid/common/include/common/bt_target.h +++ b/components/bt/host/bluedroid/common/include/common/bt_target.h @@ -1501,7 +1501,8 @@ #endif #ifndef SDP_MAX_PAD_LEN -#define SDP_MAX_PAD_LEN 300 +// HHL Custom Code we have to increase this to 500 to fit the full procon descriptor +#define SDP_MAX_PAD_LEN 500 #endif /* The maximum length, in bytes, of an attribute. */ diff --git a/components/esp_hid/src/bt_hidd.c b/components/esp_hid/src/bt_hidd.c index 40b8126fef..623dabbbe1 100644 --- a/components/esp_hid/src/bt_hidd.c +++ b/components/esp_hid/src/bt_hidd.c @@ -643,7 +643,7 @@ void bt_hidd_cb(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param) p_rpt = get_report_by_id_and_type(s_hidd_param.dev, param->get_report.report_id, param->get_report.report_type, &map_index); if (p_rpt == NULL) { - ESP_LOGE(TAG, "Can not find report!"); + ESP_LOGE(TAG, "Can not find report EVT: %d", param->get_report.report_id); esp_bt_hid_device_report_error(ESP_HID_PAR_HANDSHAKE_RSP_ERR_INVALID_REP_ID); break; } @@ -684,7 +684,7 @@ void bt_hidd_cb(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param) p_rpt = get_report_by_id_and_type(s_hidd_param.dev, param->set_report.report_id, param->set_report.report_type, &map_index); if (p_rpt == NULL) { - ESP_LOGE(TAG, "Can not find report!"); + ESP_LOGE(TAG, "Can not find report SET: %d", param->set_report.report_type); esp_bt_hid_device_report_error(ESP_HID_PAR_HANDSHAKE_RSP_ERR_INVALID_REP_ID); break; } @@ -721,6 +721,9 @@ void bt_hidd_cb(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param) break; } case ESP_HIDD_SET_PROTOCOL_EVT: { + ESP_LOGI(TAG, "Ignoring protocol mode change."); + break; + if (param->set_protocol.protocol_mode != ESP_HIDD_UNSUPPORTED_MODE) { if (s_hidd_param.dev->protocol_mode == param->set_protocol.protocol_mode) { break; @@ -730,7 +733,7 @@ void bt_hidd_cb(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param) osi_mutex_unlock(&s_hidd_param.mutex); cb_param.protocol_mode.dev = s_hidd_param.dev->dev; cb_param.protocol_mode.protocol_mode = s_hidd_param.dev->protocol_mode; - cb_param.protocol_mode.map_index = 0; + //cb_param.protocol_mode.map_index = 0; esp_event_post_to(s_hidd_param.dev->event_loop_handle, ESP_HIDD_EVENTS, ESP_HIDD_PROTOCOL_MODE_EVENT, &cb_param, sizeof(esp_hidd_event_data_t), portMAX_DELAY); } else { @@ -743,7 +746,7 @@ void bt_hidd_cb(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param) p_rpt = get_report_by_id_and_type(s_hidd_param.dev, param->intr_data.report_id, ESP_HID_REPORT_TYPE_OUTPUT, &map_index); if (p_rpt == NULL) { - ESP_LOGE(TAG, "Can not find report!"); + ESP_LOGE(TAG, "Can not find report INTR: %d", param->intr_data.report_id); break; }