-
Notifications
You must be signed in to change notification settings - Fork 930
扩充 CONFIG_BLE_CONN_MGR_EXTENDED_ADV_CAP 的值空间 (AEGHB-1315) #613
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
base: master
Are you sure you want to change the base?
Conversation
esp_ble_conn_ext_advertise 方法中, 针对 adv_params 使用了 CONFIG_BLE_CONN_MGR_EXTENDED_ADV_CAP & BIT(0)~BIT(7) 进行了赋值, 但现在只能设置 0~15, 最多只能控制 BIT(0)~BIT(3), 无法控制高位的 BIT(4)~BIT(7), 如果扩充到 BIT(7) 应该是 0xFF, 转为 10 进制应该为 255.
|
|
👋 Hello wppurking, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
acouvreur
left a comment
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.
Tried the fix and ended up with:
/myproject/managed_components/espressif__ble_conn_mgr/src/esp_nimble.c:1022:28: error: conversion from 'long unsigned int' to 'unsigned char:1' changes value from '2' to '0' [-Werror=overflow]
1022 | adv_params.scannable = (CONFIG_BLE_CONN_MGR_EXTENDED_ADV_CAP & BIT(1));
| ^
/myproject/managed_components/espressif__ble_conn_mgr/src/esp_nimble.c:1025:29: error: conversion from 'long unsigned int' to 'unsigned char:1' changes value from '16' to '0' [-Werror=overflow]
1025 | adv_params.legacy_pdu = (CONFIG_BLE_CONN_MGR_EXTENDED_ADV_CAP & BIT(4));
| ^
/myproject/managed_components/espressif__ble_conn_mgr/src/esp_nimble.c:1027:35: error: conversion from 'long unsigned int' to 'unsigned char:1' changes value from '64' to '0' [-Werror=overflow]
1027 | adv_params.include_tx_power = (CONFIG_BLE_CONN_MGR_EXTENDED_ADV_CAP & BIT(6));
|
I have tried doing the following: /* extended advertising capability */
adv_params.connectable = !!(CONFIG_BLE_CONN_MGR_EXTENDED_ADV_CAP & BIT(0));
adv_params.scannable = !!(CONFIG_BLE_CONN_MGR_EXTENDED_ADV_CAP & BIT(1));
adv_params.directed = !!(CONFIG_BLE_CONN_MGR_EXTENDED_ADV_CAP & BIT(2));
adv_params.high_duty_directed = !!(CONFIG_BLE_CONN_MGR_EXTENDED_ADV_CAP & BIT(3));
adv_params.legacy_pdu = !!(CONFIG_BLE_CONN_MGR_EXTENDED_ADV_CAP & BIT(4));
adv_params.anonymous = !!(CONFIG_BLE_CONN_MGR_EXTENDED_ADV_CAP & BIT(5));
adv_params.include_tx_power = !!(CONFIG_BLE_CONN_MGR_EXTENDED_ADV_CAP & BIT(6));
adv_params.scan_req_notif = !!(CONFIG_BLE_CONN_MGR_EXTENDED_ADV_CAP & BIT(7));But I must have done something wrong with my cap value: 83 (01010011) because I have: |
Description
In the esp_ble_conn_ext_advertise method, the adv_params are assigned using CONFIG_BLE_CONN_MGR_EXTENDED_ADV_CAP & BIT(0) ~ BIT(7), but now only 0~15 can be set, at most controlling BIT(0) ~ BIT(3), unable to control the higher bits BIT(4) ~ BIT(7). If expanded to BIT(7), it should be 0xFF, which in decimal is 255.
Related
https://github.com/espressif/esp-iot-solution/blob/master/components/bluetooth/ble_conn_mgr/src/esp_nimble.c#L1021
Testing
I just tested it in my project.
Checklist
Before submitting a Pull Request, please ensure the following: