|
|
@@ -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;
|