Przeglądaj źródła

fix wrong params of get_report_by_id_and_type in bt_hidd.c

liqigan 3 lat temu
rodzic
commit
2873cefe78

+ 11 - 19
components/esp_hid/src/bt_hidd.c

@@ -1,16 +1,8 @@
-// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+/*
+ * SPDX-FileCopyrightText: 2017-2022 Espressif Systems (Shanghai) CO LTD
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
 #include "bt_hidd.h"
 
 #if CONFIG_BT_HID_DEVICE_ENABLED
@@ -643,8 +635,8 @@ void bt_hidd_cb(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param)
         break;
     case ESP_HIDD_GET_REPORT_EVT: {
         uint8_t *data_ptr = NULL;
-        p_rpt = get_report_by_id_and_type((esp_bt_hidd_dev_t *)s_hidd_param.dev->dev, param->get_report.report_id,
-                                          param->get_report.report_type, &map_index);
+        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_bt_hid_device_report_error(ESP_HID_PAR_HANDSHAKE_RSP_ERR_INVALID_REP_ID);
@@ -684,8 +676,8 @@ void bt_hidd_cb(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param)
         break;
     }
     case ESP_HIDD_SET_REPORT_EVT: {
-        p_rpt = get_report_by_id_and_type((esp_bt_hidd_dev_t *)s_hidd_param.dev->dev, param->set_report.report_id,
-                                          param->set_report.report_type, &map_index);
+        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_bt_hid_device_report_error(ESP_HID_PAR_HANDSHAKE_RSP_ERR_INVALID_REP_ID);
@@ -743,8 +735,8 @@ void bt_hidd_cb(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param)
         break;
     }
     case ESP_HIDD_INTR_DATA_EVT: {
-        p_rpt = get_report_by_id_and_type((esp_bt_hidd_dev_t *)s_hidd_param.dev->dev, param->intr_data.report_id,
-                                          ESP_HID_REPORT_TYPE_OUTPUT, &map_index);
+        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!");
             break;

+ 0 - 1
tools/ci/check_copyright_ignore.txt

@@ -446,7 +446,6 @@ components/esp_hid/private/ble_hidh.h
 components/esp_hid/private/bt_hidd.h
 components/esp_hid/private/bt_hidh.h
 components/esp_hid/private/esp_hidd_private.h
-components/esp_hid/src/bt_hidd.c
 components/esp_hid/src/bt_hidh.c
 components/esp_hid/src/esp_hid_common.c
 components/esp_hid/src/esp_hidd.c