Browse Source

Merge branch 'test/bqb_test_bt_classic_hid' into 'master'

feat(bt/bqb): Add setting local di record function for specific hid case of bqb auto test

Closes BT-3359

See merge request espressif/esp-idf!25055
Wang Meng Yang 2 years ago
parent
commit
efeb308bc0

+ 17 - 0
components/bt/host/bluedroid/bta/hd/bta_hd_main.c

@@ -317,4 +317,21 @@ static const char *bta_hd_state_code(tBTA_HD_STATE state_code)
         return "<unknown>";
     }
 }
+
+#if BT_HID_DEVICE_BQB_INCLUDED
+tBTA_STATUS bta_hd_bqb_set_local_di_record(void)
+{
+    tBTA_STATUS status = BTA_FAILURE;
+
+    tBTA_DI_RECORD bqb_device_info;
+    bqb_device_info.vendor = 0;
+    bqb_device_info.vendor_id_source = 0xff; // BTA_HH_VENDOR_ID_INVALID
+    bqb_device_info.product = 1;
+    bqb_device_info.version = 0;
+    bqb_device_info.primary_record = TRUE;
+
+    return BTA_DmSetLocalDiRecord(&bqb_device_info, &bta_hd_cb.sdp_handle);
+}
+#endif /* BT_HID_DEVICE_BQB_INCLUDED */
+
 #endif /* BTA_HD_INCLUDED */

+ 6 - 0
components/bt/host/bluedroid/common/include/common/bt_target.h

@@ -2034,6 +2034,12 @@
 #define HID_DEV_FLUSH_TO 0xffff
 #endif
 
+#if (BTA_HD_INCLUDED == TRUE) && (HID_DEV_INCLUDED == TRUE) && (BT_CLASSIC_BQB_INCLUDED == TRUE)
+#define BT_HID_DEVICE_BQB_INCLUDED      TRUE
+#else
+#define BT_HID_DEVICE_BQB_INCLUDED      FALSE
+#endif
+
 /*************************************************************************
 ** Definitions for Both HID-Host & Device
 */

+ 5 - 13
components/esp_hid/src/esp_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-2023 Espressif Systems (Shanghai) CO LTD
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
 
 #include "esp_hidd.h"
 #include "esp_hidd_private.h"

+ 0 - 1
tools/ci/check_copyright_ignore.txt

@@ -419,7 +419,6 @@ 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/esp_hid_common.c
-components/esp_hid/src/esp_hidd.c
 components/esp_hid/test/hid_descriptor.h
 components/esp_hid/test/test_esp_hid.c
 components/esp_local_ctrl/src/esp_local_ctrl_handler.c