-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Device Identification Profile for esp_hidd component (IDFGH-11794) #12889
base: release/v5.2
Are you sure you want to change the base?
Implement Device Identification Profile for esp_hidd component (IDFGH-11794) #12889
Conversation
Add BT HID task size config option
add #ifndef BT_HID_DEVICE_TASK_SIZE to set a default
add defined BT_HID_DEVICE_TASK_SIZE
Add defined BT_HID_DEVICE_TASK_SIZE
Increase default to 4096
Update default HID task size to 4096 bytes
- Add necessary attributes that get passed along from the esp_hidd component
👋 Welcome mitchellcairns, thank you for your first contribution to 📘 Please check Contributions Guide for the contribution checklist, information regarding code and documentation style, testing and other topics. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for espressif/esp-idf project. Pull request review and merge process you can expectEspressif develops the ESP-IDF project in an internal repository (Gitlab). We do welcome contributions in the form of bug reports, feature requests and pull requests via this public GitHub repository.
🔁 You can re-run automatic PR checks by retrying the DangerJS action |
Add BT HID task size config option Update esp_hid_common.h add #ifndef BT_HID_DEVICE_TASK_SIZE to set a default Update ble_hidd.c add defined BT_HID_DEVICE_TASK_SIZE Update bt_hidd.c Add defined BT_HID_DEVICE_TASK_SIZE Update esp_hid_common.h Increase default to 4096 Update Kconfig.in Update default HID task size to 4096 bytes Implement DID for Bluetooth Classic HID Device - Add necessary attributes that get passed along from the esp_hidd component Remove unneeded comment
uint16_t vendor_id; /*!< HID Vendor ID */ | ||
uint16_t product_id; /*!< HID Product ID */ | ||
uint16_t version; /*!< HID Product Version */ | ||
uint8_t vendor_id_source; /*!< HID Country Code */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to Device Identification Profile Specification or Device Information Service, the filed vendor_id_source
designates which organization assigned the vendor_id
.
vendor_id_source
in Device Identification Profile Specification has two bytes defined values:
- 0x0001 = Bluetooth SIG assigned Device ID Vendor ID value from the Assigned Numbers document
- 0x0002 = USB Implementer’s Forum assigned Vendor ID value
- 0x0000, 0x0003 – 0xFFFF = Reserved for future use
vendor_id_source
in Device Information Service has one byte defined values:
- 0x01 = Bluetooth SIG assigned Device ID Vendor ID value from the Assigned Numbers document
- 0x02 = USB Implementer’s Forum assigned Vendor ID value
- 0x00, 0x03 – 0xFF = Reserved for future use
I think this field can be set as two bytes and added into esp_hid_device_config_t
, since BLE and BR/EDR HID Device both need it for the device information. And vendor_id_source
validity also should be checked in esp_ble_hidd_dev_init
or esp_bt_hidd_dev_init
.
Btw, the following code in /esp-idf/components/esp_hid/src/ble_hidd.c shall be modified from
...
uint8_t pnp_val[7] = {
0x02, //0x1=BT, 0x2=USB
dev->config.vendor_id & 0xFF, (dev->config.vendor_id >> 8) & 0xFF, //VID
dev->config.product_id & 0xFF, (dev->config.product_id >> 8) & 0xFF, //PID
dev->config.version & 0xFF, (dev->config.version >> 8) & 0xFF //VERSION
};
...
to
...
uint8_t pnp_val[7] = {
dev->config.vendor_id_source & 0xFF, //0x1=BT, 0x2=USB
dev->config.vendor_id & 0xFF, (dev->config.vendor_id >> 8) & 0xFF, //VID
dev->config.product_id & 0xFF, (dev->config.product_id >> 8) & 0xFF, //PID
dev->config.version & 0xFF, (dev->config.version >> 8) & 0xFF //VERSION
};
...
@@ -144,6 +144,13 @@ config BT_HID_DEVICE_ENABLED | |||
help | |||
This enables the BT HID Device | |||
|
|||
config BT_HID_DEVICE_TASK_SIZE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this configuration option can be put into the esp_hid component and it would be better to have different configuration options for BLE HIDD and BR/EDR HIDD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can separate these and put it in the esp_hid_component as its own kconfig
@@ -175,6 +175,16 @@ void bta_hd_register_act(tBTA_HD_DATA *p_data) | |||
p_app_data->subclass, p_app_data->d_len, p_app_data->d_data); | |||
bta_sys_add_uuid(UUID_SERVCLASS_HUMAN_INTERFACE); | |||
|
|||
// Set DID Profile SDP Record | |||
tBTA_DI_RECORD bqb_device_info; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bqb
prefix has specific meaning for Bluetooth, device_info
is OK.
@@ -23,6 +23,11 @@ extern "C" { | |||
#include <stdbool.h> | |||
#include <stdio.h> | |||
|
|||
/* HID BT Task Size Def */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to use the configuration option in Kconfig, code needs to be modified as:
#include "sdkconfig.h"
#ifdef CONFIG_BT_HID_DEVICE_TASK_SIZE
#define BT_HID_DEVICE_TASK_SIZE CONFIG_BT_HID_DEVICE_TASK_SIZE
#else
#define BT_HID_DEVICE_TASK_SIZE 4096
#endif
- Ignore boot mode change command or at least pass it through before taking action - Increase SDP padding size
Is this workin now? |
@Zucchy00 This is working now in release/v5.4 or after. BTW, ESP32 Classic Bluetooth have integrated DIP into SDP API, users call create their own DIP records even if they don't use HID. Thanks for your PR again @mitchellcairns ! |
This adds the following
Additionally, this implements an sdk config parameter for the esp_hidd tasks to allow task resizing.