forked from espressif/esp-idf
Compare commits
341 Commits
fixes
...
release/v5
Author | SHA1 | Date | |
---|---|---|---|
cbe9388f45 | |||
1d9e0ac834 | |||
b37d4b338c | |||
5986566708 | |||
20ec15edff | |||
60e884b438 | |||
589c2516c8 | |||
5210e576d5 | |||
e7a76ff71e | |||
8694f893ea | |||
5c6701aad0 | |||
4d06a6ec9d | |||
6cb9214520 | |||
b62e55db0b | |||
8ac432ec0a | |||
6fd5f51432 | |||
0eb2407a26 | |||
85c77bdb82 | |||
391c39414e | |||
df19d0421f | |||
5558a08c07 | |||
8aa235a9a5 | |||
9c61e31be4 | |||
f0d7baae5e | |||
9189406b05 | |||
30c24b2f31 | |||
23bc0a51fb | |||
16985bfd3c | |||
e454c9be2d | |||
4fd109860b | |||
88f234f1ef | |||
e44e7ce2f9 | |||
06268a4efc | |||
4684d3dffc | |||
d8f3e05201 | |||
0104bcde1a | |||
aac26c847e | |||
4a21060839 | |||
9671a5d3b0 | |||
2f3351f1a9 | |||
39ebd0b143 | |||
cfe6cbaaa0 | |||
c7990e649e | |||
adc3a80381 | |||
e0f7f4e539 | |||
42a3c9b024 | |||
a468bbcadd | |||
d0d04bd986 | |||
7b1cbb89e0 | |||
e17993b175 | |||
36749445f4 | |||
a644e9073e | |||
191a24cb6d | |||
24e323685a | |||
7bbaba909f | |||
f7046307a5 | |||
cd7c97e6eb | |||
624175fc01 | |||
8cf17632c2 | |||
9a74093e98 | |||
fa889bf5b6 | |||
c4747aae02 | |||
0ea73a9273 | |||
80d191e797 | |||
ba0da6f2a6 | |||
c943797004 | |||
1a40b106b4 | |||
10a210d08a | |||
56a4c70c31 | |||
5a04cfded1 | |||
3fe9252c3f | |||
c837712306 | |||
80abd1c7e4 | |||
3da3f6f2e2 | |||
8d7aefa890 | |||
ef71aad834 | |||
73058bfca0 | |||
d5323cfaaa | |||
6e82c7a061 | |||
6cf1a6f297 | |||
95b7c023da | |||
f4669e3377 | |||
7e28275ac1 | |||
da534bf462 | |||
59434db045 | |||
2e7a9174fc | |||
fc77b58ced | |||
770052e859 | |||
71f83ca625 | |||
156ead0cd5 | |||
5555ef7425 | |||
4b93bde59b | |||
04f5e591c0 | |||
2d5d7b819f | |||
908ff6e5df | |||
0dd5b0b979 | |||
e536aa670b | |||
1df4f13b2e | |||
bb72c42611 | |||
d8fa0886b0 | |||
08d78dcd7e | |||
849c74b2b9 | |||
e32bd2502d | |||
666f3db1a3 | |||
79da851a4c | |||
3f8da22ae0 | |||
f523943972 | |||
fc71a8643e | |||
0e585a2994 | |||
f5be149eb2 | |||
ccef14fad2 | |||
bb8338b17a | |||
53534bc5ce | |||
ace361e7e1 | |||
ec2f1c0023 | |||
5584880376 | |||
ebdafe8e0c | |||
addc2101dc | |||
6078213bcd | |||
4869e83855 | |||
37f017585d | |||
8f57d672d2 | |||
881c5a9795 | |||
2e760d374e | |||
e22c523b55 | |||
7c2734dc02 | |||
9e7325a3d6 | |||
29ba5469ef | |||
20d66da972 | |||
4c3d086c13 | |||
d0e0c188fb | |||
19b0d6c13c | |||
e9e995bd0a | |||
7914e75525 | |||
90b3d29223 | |||
30d77f494e | |||
7557ec0951 | |||
e29823cfe0 | |||
f0a4d73ea1 | |||
22aeb00462 | |||
fd3178eb6b | |||
7cf59adc0c | |||
96b43c9797 | |||
168808248d | |||
fc72303490 | |||
6b74032d2e | |||
39c6c703b1 | |||
ce09a8c037 | |||
370ac37623 | |||
98cd765953 | |||
73747da716 | |||
18b6997e32 | |||
693a5393b2 | |||
23892d857a | |||
087727a693 | |||
49b5cc9e50 | |||
33c71ea033 | |||
5961670d06 | |||
07ae83249a | |||
fa75a4dd67 | |||
b002e50857 | |||
f19263a97c | |||
7f8290e911 | |||
0170c56e04 | |||
7b66ed489f | |||
35876be5e6 | |||
e2b524c609 | |||
30859ceaff | |||
99e5203d89 | |||
c48b74805f | |||
a2cd564044 | |||
ad5d36257b | |||
52e3d9bb5f | |||
d881dda91c | |||
ecb5fc3075 | |||
cd1601f408 | |||
4d83f1b8af | |||
0fe8891e3a | |||
b1a379d574 | |||
84973428b2 | |||
41a17b71ad | |||
253ca4267a | |||
60ab2598c5 | |||
b9c586ebd1 | |||
3d09da9251 | |||
fddf34d7b0 | |||
2e761da92a | |||
b045635cea | |||
3b596bb602 | |||
45fed1d225 | |||
d7216d221b | |||
80c5fd1836 | |||
b3843ea09a | |||
6687749fae | |||
2b0c548593 | |||
59496b4927 | |||
b977a13796 | |||
0a3cc83a86 | |||
d5d713cff2 | |||
80c92bae34 | |||
0904640409 | |||
b0f107b69a | |||
1c81d11ec3 | |||
059a675e5c | |||
4c7a13b570 | |||
5be9ac3d93 | |||
e100fc790c | |||
a73197e886 | |||
9e0c4d226a | |||
68dd2c9a3c | |||
3d3b7caf95 | |||
0e59feac9d | |||
c0f77d8993 | |||
3092578b4a | |||
fafc25b8b9 | |||
e7c8f555e7 | |||
5f71d958c3 | |||
e26be2be8f | |||
e8475d7796 | |||
31149354a9 | |||
833df30063 | |||
1cc377a373 | |||
a74197c552 | |||
d482206483 | |||
27496e47f0 | |||
eca7c7296c | |||
039cc1ac80 | |||
ee3baa4ca7 | |||
ba70c7f3d1 | |||
c5b725fc50 | |||
10a690fe10 | |||
758da73338 | |||
27b85137c7 | |||
06ee44ef46 | |||
f4add076a8 | |||
5e6ecd81b5 | |||
45fb5fb793 | |||
63f72f659d | |||
7910ea8571 | |||
7f46f6152e | |||
5da8865f9b | |||
c771e4508e | |||
375d675cdc | |||
2252a4166a | |||
1f4fbd060c | |||
f97fd7490f | |||
dbfb663b66 | |||
429183de1e | |||
1ba8abd8b7 | |||
5b1588e0db | |||
3ded40b276 | |||
a6db9d402f | |||
693dfe6b0e | |||
d738d889d8 | |||
ce340fcce7 | |||
b1218adfae | |||
aff86ba14b | |||
c85c74f54b | |||
0778748506 | |||
8a54378b95 | |||
43ff2531ab | |||
a3edce572a | |||
4aa47aacc3 | |||
379f4de500 | |||
048d03e94d | |||
29520e982c | |||
527e2f38b8 | |||
9cf4ddf797 | |||
3052ad53e7 | |||
1adbeceb27 | |||
d1c131f649 | |||
7b52c11661 | |||
5bb83afac7 | |||
669e677ba3 | |||
1909105acf | |||
afcb8199b0 | |||
0a17f79cc7 | |||
de17b6ff94 | |||
046479c23f | |||
79d2bedbf9 | |||
6514df1ba9 | |||
692f7df5aa | |||
f6cb4422db | |||
60adcc5980 | |||
a544a33131 | |||
4f56bba225 | |||
5273ba9731 | |||
eb0cf524c0 | |||
6ba1a3a427 | |||
f9597a06f4 | |||
f056662cd5 | |||
e1aee3ff2b | |||
2e02c26b81 | |||
f5748f3d9b | |||
8a138cbd22 | |||
c18e53b672 | |||
28ac0243bb | |||
c61f36de13 | |||
6fdcf9efc1 | |||
a652a8473e | |||
6f82f332fd | |||
b095331a51 | |||
084dfefd6f | |||
04d83433c3 | |||
dd1a331f4f | |||
0f7b621d47 | |||
72ae023a42 | |||
84e62daedc | |||
0d5d31b343 | |||
05617e458b | |||
f8284e1733 | |||
b9e03c3cf4 | |||
4498eea285 | |||
af9e528409 | |||
d35923141d | |||
81f5d899f6 | |||
2eac57a1da | |||
2fd71413f0 | |||
b8badb85d1 | |||
f8cdf02b55 | |||
ac12d560a2 | |||
18cd0fa030 | |||
269f1d110d | |||
f03b0fe0c5 | |||
a0fc3e68a8 | |||
0993f1e67b | |||
45831351fa | |||
37e28522c2 | |||
8ea6b3170b | |||
2de265b3e7 | |||
953fe222ec | |||
70f19793f8 | |||
0b2f639c62 | |||
a3cb7f4404 | |||
b264d7f89b | |||
14c29c467e | |||
3b7f4e2341 | |||
3a6e5dba88 | |||
27e1a30acc | |||
c0d91e33d0 | |||
a4d0ab04c5 |
@ -2,253 +2,5 @@
|
||||
#
|
||||
# https://docs.gitlab.com/ee/user/project/code_owners.html#the-syntax-of-code-owners-files
|
||||
#
|
||||
# If more than one rule matches a given file, the latest rule is used.
|
||||
# The file should be generally kept sorted, except when it is necessary
|
||||
# to use a different order due to the fact above. In that case, use
|
||||
# '# sort-order-reset' comment line to reset the sort order.
|
||||
#
|
||||
# Recipes for a few common cases:
|
||||
#
|
||||
# 1. Specific directory with all its contents:
|
||||
#
|
||||
# /components/app_trace/
|
||||
#
|
||||
# Note the trailing slash!
|
||||
#
|
||||
# 2. File with certain extension in any subdirectory of a certain directory:
|
||||
#
|
||||
# /examples/**/*.py
|
||||
#
|
||||
# This includes an *.py files in /examples/ directory as well.
|
||||
#
|
||||
# 3. Contents of a directory with a certain name, anywhere in the tree:
|
||||
#
|
||||
# test_*_host/
|
||||
#
|
||||
# Will match everything under components/efuse/test_efuse_host/,
|
||||
# components/heap/test_multi_heap_host/, components/lwip/test_afl_host/, etc.
|
||||
#
|
||||
# 4. Same as above, except limited to a specific place in the tree:
|
||||
#
|
||||
# /components/esp32*/
|
||||
#
|
||||
# Matches everything under /components/esp32, /components/esp32s2, etc.
|
||||
# Doesn't match /tools/some-test/components/esp32s5.
|
||||
#
|
||||
# 5. Specific file:
|
||||
#
|
||||
# /tools/tools.json
|
||||
#
|
||||
# 6. File with a certain name anywhere in the tree
|
||||
#
|
||||
# .gitignore
|
||||
#
|
||||
|
||||
* @esp-idf-codeowners/other
|
||||
|
||||
/.* @esp-idf-codeowners/tools
|
||||
/.codespellrc @esp-idf-codeowners/ci
|
||||
/.github/workflows/ @esp-idf-codeowners/ci
|
||||
/.gitlab-ci.yml @esp-idf-codeowners/ci
|
||||
/.gitlab/ci/ @esp-idf-codeowners/ci
|
||||
/.pre-commit-config.yaml @esp-idf-codeowners/ci
|
||||
/.readthedocs.yml @esp-idf-codeowners/docs
|
||||
/.vale.ini @esp-idf-codeowners/docs
|
||||
/CMakeLists.txt @esp-idf-codeowners/build-config
|
||||
/COMPATIBILITY*.md @esp-idf-codeowners/peripherals
|
||||
/CONTRIBUTING.md @esp-idf-codeowners/docs
|
||||
/Kconfig @esp-idf-codeowners/build-config
|
||||
/README*.md @esp-idf-codeowners/docs
|
||||
/ROADMAP*.md @esp-idf-codeowners/docs
|
||||
/SUPPORT_POLICY*.md @esp-idf-codeowners/docs
|
||||
/add_path.sh @esp-idf-codeowners/tools
|
||||
/conftest.py @esp-idf-codeowners/ci
|
||||
/export.* @esp-idf-codeowners/tools
|
||||
/install.* @esp-idf-codeowners/tools
|
||||
/pytest.ini @esp-idf-codeowners/ci
|
||||
/ruff.toml @esp-idf-codeowners/tools
|
||||
/sdkconfig.rename @esp-idf-codeowners/build-config
|
||||
/sonar-project.properties @esp-idf-codeowners/ci
|
||||
|
||||
# sort-order-reset
|
||||
|
||||
/components/app_trace/ @esp-idf-codeowners/debugging
|
||||
/components/app_update/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
|
||||
/components/bootloader*/ @esp-idf-codeowners/system @esp-idf-codeowners/security
|
||||
/components/bootloader_support/bootloader_flash/ @esp-idf-codeowners/peripherals
|
||||
/components/bt/ @esp-idf-codeowners/bluetooth
|
||||
/components/cmock/ @esp-idf-codeowners/system
|
||||
/components/console/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities/console
|
||||
/components/cxx/ @esp-idf-codeowners/system
|
||||
/components/driver/ @esp-idf-codeowners/peripherals
|
||||
/components/efuse/ @esp-idf-codeowners/system
|
||||
/components/esp_adc/ @esp-idf-codeowners/peripherals
|
||||
/components/esp_app_format/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
|
||||
/components/esp_bootloader_format/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
|
||||
/components/esp_coex/ @esp-idf-codeowners/wifi @esp-idf-codeowners/bluetooth @esp-idf-codeowners/ieee802154
|
||||
/components/esp_common/ @esp-idf-codeowners/system
|
||||
/components/esp_driver_*/ @esp-idf-codeowners/peripherals
|
||||
/components/esp_driver_sdmmc/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/storage
|
||||
/components/esp_eth/ @esp-idf-codeowners/network
|
||||
/components/esp_event/ @esp-idf-codeowners/system
|
||||
/components/esp_gdbstub/ @esp-idf-codeowners/debugging
|
||||
/components/esp_hid/ @esp-idf-codeowners/bluetooth
|
||||
/components/esp_http_client/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_http_server/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_https_ota/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_https_server/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_hw_support/ @esp-idf-codeowners/system @esp-idf-codeowners/peripherals
|
||||
/components/esp_hw_support/lowpower/ @esp-idf-codeowners/power-management
|
||||
/components/esp_lcd/ @esp-idf-codeowners/peripherals
|
||||
/components/esp_local_ctrl/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_mm/ @esp-idf-codeowners/peripherals
|
||||
/components/esp_netif/ @esp-idf-codeowners/network
|
||||
/components/esp_netif_stack/ @esp-idf-codeowners/network
|
||||
/components/esp_partition/ @esp-idf-codeowners/storage
|
||||
/components/esp_phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
|
||||
/components/esp_pm/ @esp-idf-codeowners/power-management @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/system
|
||||
/components/esp_psram/ @esp-idf-codeowners/peripherals
|
||||
/components/esp_psram/system_layer/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
|
||||
/components/esp_ringbuf/ @esp-idf-codeowners/system
|
||||
/components/esp_rom/ @esp-idf-codeowners/system @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi
|
||||
/components/esp_security/ @esp-idf-codeowners/security
|
||||
/components/esp_system/ @esp-idf-codeowners/system
|
||||
/components/esp_tee/ @esp-idf-codeowners/security
|
||||
/components/esp_timer/ @esp-idf-codeowners/system
|
||||
/components/esp-tls/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_vfs_*/ @esp-idf-codeowners/storage
|
||||
/components/esp_vfs_console/ @esp-idf-codeowners/storage @esp-idf-codeowners/system
|
||||
/components/esp_wifi/ @esp-idf-codeowners/wifi
|
||||
/components/espcoredump/ @esp-idf-codeowners/debugging
|
||||
/components/esptool_py/ @esp-idf-codeowners/tools
|
||||
/components/fatfs/ @esp-idf-codeowners/storage
|
||||
/components/freertos/ @esp-idf-codeowners/system
|
||||
/components/hal/ @esp-idf-codeowners/peripherals
|
||||
/components/hal/test_apps/crypto/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/security
|
||||
/components/heap/ @esp-idf-codeowners/system
|
||||
/components/http_parser/ @esp-idf-codeowners/app-utilities
|
||||
/components/idf_test/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
|
||||
/components/ieee802154/ @esp-idf-codeowners/ieee802154
|
||||
/components/json/ @esp-idf-codeowners/app-utilities
|
||||
/components/linux/ @esp-idf-codeowners/system
|
||||
/components/log/ @esp-idf-codeowners/system
|
||||
/components/lwip/ @esp-idf-codeowners/lwip
|
||||
/components/mbedtls/ @esp-idf-codeowners/app-utilities/mbedtls @esp-idf-codeowners/security
|
||||
/components/mqtt/ @esp-idf-codeowners/network
|
||||
/components/newlib/ @esp-idf-codeowners/system @esp-idf-codeowners/toolchain
|
||||
/components/nvs_flash/ @esp-idf-codeowners/storage
|
||||
/components/nvs_sec_provider/ @esp-idf-codeowners/storage @esp-idf-codeowners/security
|
||||
/components/openthread/ @esp-idf-codeowners/ieee802154
|
||||
/components/partition_table/ @esp-idf-codeowners/system
|
||||
/components/perfmon/ @esp-idf-codeowners/debugging
|
||||
/components/protobuf-c/ @esp-idf-codeowners/app-utilities
|
||||
/components/protocomm/ @esp-idf-codeowners/app-utilities/provisioning
|
||||
/components/pthread/ @esp-idf-codeowners/system
|
||||
/components/riscv/ @esp-idf-codeowners/system
|
||||
/components/rt/ @esp-idf-codeowners/system
|
||||
/components/sdmmc/ @esp-idf-codeowners/storage
|
||||
/components/soc/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
|
||||
/components/spi_flash/ @esp-idf-codeowners/peripherals
|
||||
/components/spiffs/ @esp-idf-codeowners/storage
|
||||
/components/tcp_transport/ @esp-idf-codeowners/network
|
||||
/components/touch_element/ @esp-idf-codeowners/peripherals
|
||||
/components/ulp/ @esp-idf-codeowners/system
|
||||
/components/unity/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
|
||||
/components/usb/ @esp-idf-codeowners/peripherals/usb
|
||||
/components/vfs/ @esp-idf-codeowners/storage
|
||||
/components/wear_levelling/ @esp-idf-codeowners/storage
|
||||
/components/wifi_provisioning/ @esp-idf-codeowners/app-utilities/provisioning
|
||||
/components/wpa_supplicant/ @esp-idf-codeowners/wifi @esp-idf-codeowners/app-utilities/mbedtls
|
||||
/components/xtensa/ @esp-idf-codeowners/system
|
||||
|
||||
/docs/ @esp-idf-codeowners/docs
|
||||
/docs/docs_not_updated/ @esp-idf-codeowners/all-maintainers
|
||||
/docs/**/api-guides/tools/ @esp-idf-codeowners/tools
|
||||
/docs/en/api-guides/core_dump.rst @esp-idf-codeowners/debugging
|
||||
/docs/**/api-guides/wifi* @esp-idf-codeowners/wifi
|
||||
/docs/**/api-guides/esp-wifi-mesh.rst @esp-idf-codeowners/wifi
|
||||
/docs/en/api-guides/jtag-debugging/ @esp-idf-codeowners/debugging
|
||||
/docs/**/api-reference/bluetooth/ @esp-idf-codeowners/bluetooth
|
||||
/docs/**/api-reference/network/ @esp-idf-codeowners/network @esp-idf-codeowners/wifi
|
||||
/docs/**/api-reference/peripherals/ @esp-idf-codeowners/peripherals
|
||||
/docs/**/api-reference/peripherals/usb* @esp-idf-codeowners/peripherals @esp-idf-codeowners/peripherals/usb
|
||||
/docs/**/api-reference/peripherals/usb*/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/peripherals/usb
|
||||
/docs/**/api-reference/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
|
||||
/docs/**/api-reference/provisioning/ @esp-idf-codeowners/app-utilities/provisioning
|
||||
/docs/**/api-reference/storage/ @esp-idf-codeowners/storage
|
||||
/docs/**/api-reference/system/ @esp-idf-codeowners/system
|
||||
/docs/**/security/ @esp-idf-codeowners/security
|
||||
/docs/**/migration-guides/ @esp-idf-codeowners/docs @esp-idf-codeowners/all-maintainers
|
||||
/docs/**/contribute/install-pre-commit-hook.rst @esp-idf-codeowners/ci @esp-idf-codeowners/tools
|
||||
|
||||
/examples/README.md @esp-idf-codeowners/docs @esp-idf-codeowners/ci
|
||||
/examples/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools
|
||||
/examples/bluetooth/ @esp-idf-codeowners/bluetooth
|
||||
/examples/build_system/ @esp-idf-codeowners/build-config
|
||||
/examples/common_components/ @esp-idf-codeowners/system @esp-idf-codeowners/wifi @esp-idf-codeowners/lwip @esp-idf-codeowners/network
|
||||
/examples/custom_bootloader/ @esp-idf-codeowners/system
|
||||
/examples/cxx/ @esp-idf-codeowners/system
|
||||
/examples/ethernet/ @esp-idf-codeowners/network
|
||||
/examples/get-started/ @esp-idf-codeowners/system
|
||||
/examples/ieee802154/ @esp-idf-codeowners/ieee802154
|
||||
/examples/lowpower/ @esp-idf-codeowners/power-management @esp-idf-codeowners/system
|
||||
/examples/mesh/ @esp-idf-codeowners/wifi
|
||||
/examples/network/ @esp-idf-codeowners/network @esp-idf-codeowners/wifi
|
||||
/examples/openthread/ @esp-idf-codeowners/ieee802154
|
||||
/examples/peripherals/ @esp-idf-codeowners/peripherals
|
||||
/examples/peripherals/usb/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/peripherals/usb
|
||||
/examples/phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
|
||||
/examples/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
|
||||
/examples/provisioning/ @esp-idf-codeowners/app-utilities/provisioning
|
||||
/examples/security/ @esp-idf-codeowners/security
|
||||
/examples/storage/ @esp-idf-codeowners/storage
|
||||
/examples/system/ @esp-idf-codeowners/system
|
||||
/examples/system/ota/ @esp-idf-codeowners/app-utilities
|
||||
/examples/wifi/ @esp-idf-codeowners/wifi
|
||||
/examples/zigbee/ @esp-idf-codeowners/ieee802154
|
||||
|
||||
/tools/ @esp-idf-codeowners/tools
|
||||
/tools/ble/ @esp-idf-codeowners/app-utilities
|
||||
/tools/bt/ @esp-idf-codeowners/bluetooth
|
||||
/tools/catch/ @esp-idf-codeowners/ci
|
||||
/tools/ci/ @esp-idf-codeowners/ci
|
||||
/tools/cmake/ @esp-idf-codeowners/build-config
|
||||
/tools/cmake/toolchain-*.cmake @esp-idf-codeowners/toolchain
|
||||
/tools/esp_app_trace/ @esp-idf-codeowners/debugging
|
||||
/tools/esp_prov/ @esp-idf-codeowners/app-utilities
|
||||
/tools/gdb_panic_server.py @esp-idf-codeowners/debugging
|
||||
/tools/kconfig*/ @esp-idf-codeowners/build-config
|
||||
/tools/ldgen/ @esp-idf-codeowners/build-config
|
||||
/tools/mass_mfg/ @esp-idf-codeowners/app-utilities
|
||||
/tools/mocks/ @esp-idf-codeowners/system
|
||||
|
||||
/tools/test_apps/ @esp-idf-codeowners/ci
|
||||
/tools/test_apps/README.md @esp-idf-codeowners/docs @esp-idf-codeowners/ci
|
||||
|
||||
## Note: owners here should be the same as the owners for the same example subdir, above
|
||||
/tools/test_apps/build_system/ @esp-idf-codeowners/build-config
|
||||
/tools/test_apps/configs/ @esp-idf-codeowners/system
|
||||
/tools/test_apps/linux_compatible/ @esp-idf-codeowners/system
|
||||
/tools/test_apps/peripherals/ @esp-idf-codeowners/peripherals
|
||||
/tools/test_apps/phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
|
||||
/tools/test_apps/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
|
||||
/tools/test_apps/security/ @esp-idf-codeowners/security
|
||||
/tools/test_apps/storage/ @esp-idf-codeowners/storage
|
||||
/tools/test_apps/system/ @esp-idf-codeowners/system
|
||||
|
||||
/tools/test_apps/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools
|
||||
|
||||
/tools/test_build_system/ @esp-idf-codeowners/tools @esp-idf-codeowners/build-config
|
||||
|
||||
/tools/tools.json @esp-idf-codeowners/tools @esp-idf-codeowners/toolchain @esp-idf-codeowners/debugging
|
||||
|
||||
/tools/unit-test-app/ @esp-idf-codeowners/system @esp-idf-codeowners/tools
|
||||
|
||||
# sort-order-reset
|
||||
|
||||
/components/**/test_apps/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools
|
||||
|
||||
# ignore lists
|
||||
/tools/ci/check_copyright_config.yaml @esp-idf-codeowners/all-maintainers
|
||||
/tools/ci/check_copyright_ignore.txt @esp-idf-codeowners/all-maintainers
|
||||
/tools/ci/mypy_ignore_list.txt @esp-idf-codeowners/tools
|
||||
* @esp-idf-codeowners/all-maintainers
|
||||
|
@ -40,7 +40,7 @@ variables:
|
||||
GIT_FETCH_EXTRA_FLAGS: "--no-recurse-submodules --prune --prune-tags"
|
||||
# we're using .cache folder for caches
|
||||
GIT_CLEAN_FLAGS: -ffdx -e .cache/
|
||||
LATEST_GIT_TAG: v5.5-dev
|
||||
LATEST_GIT_TAG: v5.5-beta1
|
||||
|
||||
SUBMODULE_FETCH_TOOL: "tools/ci/ci_fetch_submodule.py"
|
||||
# by default we will fetch all submodules
|
||||
@ -56,7 +56,7 @@ variables:
|
||||
|
||||
# Docker images
|
||||
ESP_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-env-v5.5:3"
|
||||
ESP_IDF_DOC_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-doc-env-v5.5:2-1"
|
||||
ESP_IDF_DOC_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-doc-env-v5.5:3-1"
|
||||
TARGET_TEST_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/target-test-env-v5.5:2"
|
||||
SONARQUBE_SCANNER_IMAGE: "${CI_DOCKER_REGISTRY}/sonarqube-scanner:5"
|
||||
PRE_COMMIT_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-pre-commit:1"
|
||||
@ -191,13 +191,21 @@ variables:
|
||||
fi
|
||||
|
||||
# Custom OpenOCD
|
||||
if [[ ! -z "$OOCD_DISTRO_URL" && "$CI_JOB_STAGE" == "target_test" ]]; then
|
||||
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
|
||||
wget $OOCD_DISTRO_URL
|
||||
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
|
||||
tar -x -f $ARCH_NAME
|
||||
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
|
||||
export PATH=$PWD/openocd-esp32/bin:$PATH
|
||||
if [[ "$CI_JOB_STAGE" == "target_test" ]]; then
|
||||
machine="$(uname -m)"
|
||||
if [[ "$machine" == "armv7l" ]] ; then
|
||||
OOCD_DISTRO_URL="$OOCD_DISTRO_URL_ARMHF"
|
||||
elif [[ "$machine" == "aarch64" ]] ; then
|
||||
OOCD_DISTRO_URL="$OOCD_DISTRO_URL_ARM64"
|
||||
fi
|
||||
if [[ ! -z "$OOCD_DISTRO_URL" ]]; then
|
||||
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
|
||||
wget $OOCD_DISTRO_URL
|
||||
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
|
||||
tar -x -f $ARCH_NAME
|
||||
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
|
||||
export PATH=$PWD/openocd-esp32/bin:$PATH
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -n "$CI_PYTHON_TOOL_REPO" ]]; then
|
||||
|
@ -14,6 +14,7 @@ extra_default_build_targets:
|
||||
|
||||
bypass_check_test_targets:
|
||||
- esp32h21
|
||||
- esp32c61
|
||||
- esp32h4
|
||||
- esp32c5
|
||||
|
||||
|
@ -165,6 +165,8 @@ pipeline_variables:
|
||||
if [ -n "$CI_PYTHON_CONSTRAINT_BRANCH" ]; then
|
||||
echo "BUILD_AND_TEST_ALL_APPS=1" >> pipeline.env
|
||||
fi
|
||||
- echo "OOCD_DISTRO_URL_ARMHF=$OOCD_DISTRO_URL_ARMHF" >> pipeline.env
|
||||
- echo "OOCD_DISTRO_URL_ARM64=$OOCD_DISTRO_URL_ARM64" >> pipeline.env
|
||||
- python tools/ci/ci_process_description.py
|
||||
- cat pipeline.env
|
||||
- python tools/ci/artifacts_handler.py upload --type modified_files_and_components_report
|
||||
|
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -54,8 +54,10 @@
|
||||
sbom-supplier = Person: Dave Gamble
|
||||
sbom-url = https://github.com/DaveGamble/cJSON
|
||||
sbom-description = Ultralightweight JSON parser in ANSI C
|
||||
sbom-hash = acc76239bee01d8e9c858ae2cab296704e52d916
|
||||
sbom-hash = 8f2beb57ddad1f94bed899790b00f46df893ccac
|
||||
sbom-cve-exclude-list = CVE-2024-31755 Resolved in v1.7.18
|
||||
sbom-cve-exclude-list = CVE-2023-26819 Resolved in commit a328d65ad490b64da8c87523cbbfe16050ba5bf6
|
||||
sbom-cve-exclude-list = CVE-2023-53154 Resolved in v1.7.18
|
||||
|
||||
[submodule "components/mbedtls/mbedtls"]
|
||||
path = components/mbedtls/mbedtls
|
||||
|
@ -51,7 +51,8 @@ repos:
|
||||
.*.pb-c.c|
|
||||
.*.yuv|
|
||||
.*.rgb|
|
||||
.*COPYING.*
|
||||
.*COPYING.*|
|
||||
docs/sphinx-known-warnings\.txt
|
||||
)$
|
||||
- id: end-of-file-fixer
|
||||
exclude: *whitespace_excludes
|
||||
@ -69,6 +70,7 @@ repos:
|
||||
rev: v2.3.0
|
||||
hooks:
|
||||
- id: codespell
|
||||
exclude: ^docs/sphinx-known-warnings\.txt$
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: check-executables
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
@ -148,6 +148,18 @@ static esp_err_t esp_apptrace_membufs_swap_waitus(esp_apptrace_membufs_proto_dat
|
||||
if (res != ESP_OK) {
|
||||
break;
|
||||
}
|
||||
#if CONFIG_IDF_TARGET_ESP32S3
|
||||
/*
|
||||
* ESP32S3 has a serious data corruption issue with the transferred data to host.
|
||||
* This delay helps reduce the failure rate by temporarily reducing heavy memory writes
|
||||
* from RTOS-level tracing and giving OpenOCD more time to read trace memory before
|
||||
* the current thread continues execution. While this doesn't completely prevent
|
||||
* memory access from other threads/cores/ISRs, it has shown to significantly improve
|
||||
* reliability when combined with CRC checks in OpenOCD. In practice, this reduces the
|
||||
* number of retries needed to read an entire block without corruption.
|
||||
*/
|
||||
esp_rom_delay_us(100);
|
||||
#endif
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@ -339,7 +351,7 @@ uint8_t *esp_apptrace_membufs_up_buffer_get(esp_apptrace_membufs_proto_data_t *p
|
||||
esp_err_t esp_apptrace_membufs_up_buffer_put(esp_apptrace_membufs_proto_data_t *proto, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
|
||||
{
|
||||
esp_apptrace_membufs_pkt_end(ptr);
|
||||
// TODO: mark block as busy in order not to re-use it for other tracing calls until it is completely written
|
||||
// TODO: mark block as busy in order not to reuse it for other tracing calls until it is completely written
|
||||
// TODO: avoid potential situation when all memory is consumed by low prio tasks which can not complete writing due to
|
||||
// higher prio tasks and the latter can not allocate buffers at all
|
||||
// this is abnormal situation can be detected on host which will receive only uncompleted buffers
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
@ -12,7 +12,7 @@
|
||||
// ======================
|
||||
|
||||
// Xtensa has useful feature: TRAX debug module. It allows recording program execution flow at run-time without disturbing CPU.
|
||||
// Exectution flow data are written to configurable Trace RAM block. Besides accessing Trace RAM itself TRAX module also allows to read/write
|
||||
// Execution flow data are written to configurable Trace RAM block. Besides accessing Trace RAM itself TRAX module also allows to read/write
|
||||
// trace memory via its registers by means of JTAG, APB or ERI transactions.
|
||||
// ESP32 has two Xtensa cores with separate TRAX modules on them and provides two special memory regions to be used as trace memory.
|
||||
// Chip allows muxing access to those trace memory blocks in such a way that while one block is accessed by CPUs another one can be accessed by host
|
||||
@ -47,7 +47,7 @@
|
||||
// 2. TRAX Registers layout
|
||||
// ========================
|
||||
|
||||
// This module uses two TRAX HW registers to communicate with host SW (OpenOCD).
|
||||
// This module uses two TRAX HW registers and one Performance Monitor register to communicate with host SW (OpenOCD).
|
||||
// - Control register uses TRAX_DELAYCNT as storage. Only lower 24 bits of TRAX_DELAYCNT are writable. Control register has the following bitfields:
|
||||
// | 31..XXXXXX..24 | 23 .(host_connect). 23| 22..(block_id)..15 | 14..(block_len)..0 |
|
||||
// 14..0 bits - actual length of user data in trace memory block. Target updates it every time it fills memory block and exposes it to host.
|
||||
@ -55,9 +55,15 @@
|
||||
// 21..15 bits - trace memory block transfer ID. Block counter. It can overflow. Updated by target, host should not modify it. Actually can be 2 bits;
|
||||
// 22 bit - 'host data present' flag. If set to one there is data from host, otherwise - no host data;
|
||||
// 23 bit - 'host connected' flag. If zero then host is not connected and tracing module works in post-mortem mode, otherwise in streaming mode;
|
||||
// - Status register uses TRAX_TRIGGERPC as storage. If this register is not zero then current CPU is changing TRAX registers and
|
||||
// this register holds address of the instruction which application will execute when it finishes with those registers modifications.
|
||||
// See 'Targets Connection' setion for details.
|
||||
// - Status register uses TRAX_TRIGGERPC as storage. If this register is not zero then current CPU is changing TRAX registers and
|
||||
// this register holds address of the instruction which application will execute when it finishes with those registers modifications.
|
||||
// See 'Targets Connection' section for details.
|
||||
// - CRC16 register uses ERI_PERFMON_PM1 as storage. This register is used to store CRC16 checksum of the exposed trace memory block.
|
||||
// The register has the following format:
|
||||
// | 31..16 (CRC indicator) | 15..0 (CRC16 value) |
|
||||
// CRC indicator (0xA55A) is used to distinguish valid CRC values from other data that might be in the register.
|
||||
// CRC16 is calculated over the entire exposed block and is updated every time a block is exposed to the host.
|
||||
// This allows the host to verify data integrity of the received trace data.
|
||||
|
||||
// 3. Modes of operation
|
||||
// =====================
|
||||
@ -127,7 +133,7 @@
|
||||
|
||||
// Access to internal module's data is synchronized with custom mutex. Mutex is a wrapper for portMUX_TYPE and uses almost the same sync mechanism as in
|
||||
// vPortCPUAcquireMutex/vPortCPUReleaseMutex. The mechanism uses S32C1I Xtensa instruction to implement exclusive access to module's data from tasks and
|
||||
// ISRs running on both cores. Also custom mutex allows specifying timeout for locking operation. Locking routine checks underlaying mutex in cycle until
|
||||
// ISRs running on both cores. Also custom mutex allows specifying timeout for locking operation. Locking routine checks underlying mutex in cycle until
|
||||
// it gets its ownership or timeout expires. The differences of application tracing module's mutex implementation from vPortCPUAcquireMutex/vPortCPUReleaseMutex are:
|
||||
// - Support for timeouts.
|
||||
// - Local IRQs for CPU which owns the mutex are disabled till the call to unlocking routine. This is made to avoid possible task's prio inversion.
|
||||
@ -142,9 +148,9 @@
|
||||
|
||||
// Timeout mechanism is based on xthal_get_ccount() routine and supports timeout values in microseconds.
|
||||
// There are two situations when task/ISR can be delayed by tracing API call. Timeout mechanism takes into account both conditions:
|
||||
// - Trace data are locked by another task/ISR. When wating on trace data lock.
|
||||
// - Trace data are locked by another task/ISR. When waiting on trace data lock.
|
||||
// - Current TRAX memory input block is full when working in streaming mode (host is connected). When waiting for host to complete previous block reading.
|
||||
// When wating for any of above conditions xthal_get_ccount() is called periodically to calculate time elapsed from trace API routine entry. When elapsed
|
||||
// When waiting for any of above conditions xthal_get_ccount() is called periodically to calculate time elapsed from trace API routine entry. When elapsed
|
||||
// time exceeds specified timeout value operation is canceled and ESP_ERR_TIMEOUT code is returned.
|
||||
#include "sdkconfig.h"
|
||||
#include "soc/soc.h"
|
||||
@ -159,11 +165,15 @@
|
||||
#include "esp_log.h"
|
||||
#include "esp_app_trace_membufs_proto.h"
|
||||
#include "esp_app_trace_port.h"
|
||||
#include "esp_rom_crc.h"
|
||||
|
||||
// TRAX is disabled, so we use its registers for our own purposes
|
||||
// | 31..XXXXXX..24 | 23 .(host_connect). 23 | 22 .(host_data). 22| 21..(block_id)..15 | 14..(block_len)..0 |
|
||||
#define ESP_APPTRACE_TRAX_CTRL_REG ERI_TRAX_DELAYCNT
|
||||
#define ESP_APPTRACE_TRAX_STAT_REG ERI_TRAX_TRIGGERPC
|
||||
#define ESP_APPTRACE_TRAX_CRC16_REG ERI_PERFMON_PM1
|
||||
|
||||
#define ESP_APPTRACE_CRC_INDICATOR (0xA55AU << 16)
|
||||
|
||||
#define ESP_APPTRACE_TRAX_BLOCK_LEN_MSK 0x7FFFUL
|
||||
#define ESP_APPTRACE_TRAX_BLOCK_LEN(_l_) ((_l_) & ESP_APPTRACE_TRAX_BLOCK_LEN_MSK)
|
||||
@ -498,7 +508,8 @@ static esp_err_t esp_apptrace_trax_buffer_swap_start(uint32_t curr_block_id)
|
||||
uint32_t acked_block = ESP_APPTRACE_TRAX_BLOCK_ID_GET(ctrl_reg);
|
||||
uint32_t host_to_read = ESP_APPTRACE_TRAX_BLOCK_LEN_GET(ctrl_reg);
|
||||
if (host_to_read != 0 || acked_block != (curr_block_id & ESP_APPTRACE_TRAX_BLOCK_ID_MSK)) {
|
||||
ESP_APPTRACE_LOGD("HC[%d]: Can not switch %" PRIx32 " %" PRIu32 " %" PRIx32 " %" PRIx32 "/%" PRIx32, esp_cpu_get_core_id(), ctrl_reg, host_to_read, acked_block,
|
||||
ESP_APPTRACE_LOGD("HC[%d]: Can not switch %" PRIx32 " %" PRIu32 " %" PRIx32 " %" PRIx32 "/%" PRIx32,
|
||||
esp_cpu_get_core_id(), ctrl_reg, host_to_read, acked_block,
|
||||
curr_block_id & ESP_APPTRACE_TRAX_BLOCK_ID_MSK, curr_block_id);
|
||||
res = ESP_ERR_NO_MEM;
|
||||
goto _on_err;
|
||||
@ -514,6 +525,14 @@ static esp_err_t esp_apptrace_trax_buffer_swap_end(uint32_t new_block_id, uint32
|
||||
{
|
||||
uint32_t ctrl_reg = eri_read(ESP_APPTRACE_TRAX_CTRL_REG);
|
||||
uint32_t host_connected = ESP_APPTRACE_TRAX_HOST_CONNECT & ctrl_reg;
|
||||
|
||||
/* calculate CRC16 of the already switched block */
|
||||
if (prev_block_len > 0) {
|
||||
const uint8_t *prev_block_start = s_trax_blocks[!((new_block_id % 2))];
|
||||
uint16_t crc16 = esp_rom_crc16_le(0, prev_block_start, prev_block_len);
|
||||
eri_write(ESP_APPTRACE_TRAX_CRC16_REG, crc16 | ESP_APPTRACE_CRC_INDICATOR);
|
||||
ESP_APPTRACE_LOGD("CRC16:%x %d @%x", crc16, prev_block_len, prev_block_start);
|
||||
}
|
||||
eri_write(ESP_APPTRACE_TRAX_CTRL_REG, ESP_APPTRACE_TRAX_BLOCK_ID(new_block_id) |
|
||||
host_connected | ESP_APPTRACE_TRAX_BLOCK_LEN(prev_block_len));
|
||||
esp_apptrace_trax_buffer_swap_unlock();
|
||||
|
@ -108,7 +108,7 @@ static void _cbSendTaskList(void) {
|
||||
* Called from SystemView when asked by the host, returns the
|
||||
* current system time in micro seconds.
|
||||
*/
|
||||
static U64 _cbGetTime(void) {
|
||||
__attribute__((unused)) static U64 _cbGetTime(void) {
|
||||
U64 Time;
|
||||
|
||||
Time = xTaskGetTickCountFromISR();
|
||||
@ -260,7 +260,10 @@ void SYSVIEW_SendTaskInfo(U32 TaskID, const char* sName, unsigned Prio, U32 Stac
|
||||
*/
|
||||
// Callbacks provided to SYSTEMVIEW by FreeRTOS
|
||||
const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI = {
|
||||
_cbGetTime,
|
||||
/* Callback _cbGetTime locks xKernelLock inside xTaskGetTickCountFromISR, this can cause deadlock on multi-core.
|
||||
To prevent deadlock, always lock xKernelLock before s_sys_view_lock. Omitting the callback here results in sending
|
||||
SYSVIEW_EVTID_SYSTIME_CYCLES events instead of SYSVIEW_EVTID_SYSTIME_US */
|
||||
NULL,
|
||||
_cbSendTaskList,
|
||||
};
|
||||
|
||||
|
@ -21,6 +21,7 @@ menu "Settings"
|
||||
config BOOTLOADER_LOG_MODE_BINARY
|
||||
bool "Binary Log Mode"
|
||||
select BOOTLOADER_LOG_MODE_BINARY_EN
|
||||
depends on BOOTLOADER_LOG_VERSION_2
|
||||
help
|
||||
Enables binary logging with host-side format string expansion. In this mode, the
|
||||
format argument of ESP_LOGx, ESP_EARLY_LOG, and ESP_DRAM_LOG macros is stored in a
|
||||
|
@ -136,7 +136,7 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
|
||||
#if ESP_TEE_BUILD
|
||||
#include "esp_fault.h"
|
||||
#include "esp_flash_partitions.h"
|
||||
#include "esp32c6/rom/spi_flash.h"
|
||||
#include "rom/spi_flash.h"
|
||||
|
||||
extern bool esp_tee_flash_check_paddr_in_active_tee_part(size_t paddr);
|
||||
#endif
|
||||
|
@ -55,7 +55,8 @@ void IRAM_ATTR bootloader_init_mspi_clock(void)
|
||||
// SPLL clock on C5 is 480MHz , and mspi_pll needs 80MHz
|
||||
// in this stage, set divider as 6
|
||||
_mspi_timing_ll_set_flash_clk_src(0, FLASH_CLK_SRC_SPLL);
|
||||
mspi_ll_fast_set_hs_divider(6);
|
||||
// MSPI0 and MSPI1 share this core clock register, but only setting to MSPI0 register is valid
|
||||
mspi_timing_ll_set_core_clock(MSPI_TIMING_LL_MSPI_ID_0, MSPI_TIMING_LL_CORE_CLOCK_MHZ_DEFAULT);
|
||||
}
|
||||
|
||||
void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)
|
||||
|
@ -52,7 +52,8 @@ void IRAM_ATTR bootloader_init_mspi_clock(void)
|
||||
// SPLL clock on C61 is 480MHz , and mspi_pll needs 80MHz
|
||||
// in this stage, set divider as 6
|
||||
_mspi_timing_ll_set_flash_clk_src(0, FLASH_CLK_SRC_DEFAULT);
|
||||
mspi_ll_fast_set_hs_divider(6);
|
||||
// MSPI0 and MSPI1 share this core clock register, but only setting to MSPI0 register is valid
|
||||
mspi_timing_ll_set_core_clock(MSPI_TIMING_LL_MSPI_ID_0, MSPI_TIMING_LL_CORE_CLOCK_MHZ_DEFAULT);
|
||||
}
|
||||
|
||||
void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)
|
||||
|
@ -25,12 +25,11 @@ void bootloader_ana_super_wdt_reset_config(bool enable);
|
||||
void bootloader_ana_clock_glitch_reset_config(bool enable);
|
||||
|
||||
/**
|
||||
* @brief Configure analog power glitch reset & glitch reset dref
|
||||
* @brief Configure analog power glitch reset
|
||||
*
|
||||
* @param enable Boolean to enable or disable power glitch reset
|
||||
* @param dref voltage threshold
|
||||
*/
|
||||
void bootloader_power_glitch_reset_config(bool enable, uint8_t dref);
|
||||
void bootloader_power_glitch_reset_config(bool enable);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#define ESP_PARTITION_HASH_LEN 32 /* SHA-256 digest length */
|
||||
#define IS_FIELD_SET(rev_full) (((rev_full) != 65535) && ((rev_full) != 0))
|
||||
#define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1))
|
||||
|
||||
static const char* TAG = "boot_comm";
|
||||
|
||||
@ -264,7 +265,10 @@ rtc_retain_mem_t* bootloader_common_get_rtc_retain_mem(void)
|
||||
#if ESP_ROM_HAS_LP_ROM
|
||||
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_LOW)
|
||||
#else
|
||||
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_HIGH - sizeof(rtc_retain_mem_t))
|
||||
/* Since the structure containing the retain_mem_t is aligned on 8 by the linker, make sure we align this
|
||||
* structure size here too */
|
||||
#define RETAIN_MEM_SIZE ALIGN_UP(sizeof(rtc_retain_mem_t), 8)
|
||||
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_HIGH - RETAIN_MEM_SIZE)
|
||||
#endif //ESP_ROM_HAS_LP_ROM
|
||||
static rtc_retain_mem_t *const s_bootloader_retain_mem = (rtc_retain_mem_t *)RTC_RETAIN_MEM_ADDR;
|
||||
return s_bootloader_retain_mem;
|
||||
|
@ -94,11 +94,7 @@ static inline void bootloader_ana_reset_config(void)
|
||||
{
|
||||
//Enable BOD reset (mode1)
|
||||
brownout_ll_ana_reset_enable(true);
|
||||
if (efuse_hal_chip_revision() == 0) {
|
||||
// decrease power glitch reset voltage to avoid start the glitch reset
|
||||
uint8_t power_glitch_dref = 0;
|
||||
bootloader_power_glitch_reset_config(true, power_glitch_dref);
|
||||
}
|
||||
bootloader_power_glitch_reset_config(true);
|
||||
}
|
||||
|
||||
esp_err_t bootloader_init(void)
|
||||
|
@ -17,18 +17,18 @@ void bootloader_ana_clock_glitch_reset_config(bool enable)
|
||||
(void)enable;
|
||||
}
|
||||
|
||||
void bootloader_power_glitch_reset_config(bool enable, uint8_t dref)
|
||||
void bootloader_power_glitch_reset_config(bool enable)
|
||||
{
|
||||
assert(dref < 8);
|
||||
REG_SET_FIELD(LP_ANA_FIB_ENABLE_REG, LP_ANA_ANA_FIB_PWR_GLITCH_ENA, 0);
|
||||
//only detect VDDPST POWER GLITCH
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PERIF, 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_XTAL, 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PLL, 0);
|
||||
|
||||
REG_SET_FIELD(LP_ANA_FIB_ENABLE_REG, LP_ANA_ANA_FIB_PWR_GLITCH_ENA, 0);//default val for chip from ECO1
|
||||
if (enable) {
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PERIF, dref);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_VDDPST, dref);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_XTAL, dref);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PLL, dref);
|
||||
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_PWR_GLITCH_RESET_ENA, 0xf);
|
||||
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_PWR_GLITCH_RESET_ENA, 0xf);//default val for chip from ECO1
|
||||
} else {
|
||||
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_PWR_GLITCH_RESET_ENA, 0);
|
||||
}
|
||||
|
@ -95,8 +95,7 @@ static inline void bootloader_ana_reset_config(void)
|
||||
{
|
||||
//Enable BOD reset (mode1)
|
||||
brownout_ll_ana_reset_enable(true);
|
||||
uint8_t power_glitch_dref = 0;
|
||||
bootloader_power_glitch_reset_config(true, power_glitch_dref);
|
||||
bootloader_power_glitch_reset_config(true);
|
||||
}
|
||||
|
||||
esp_err_t bootloader_init(void)
|
||||
|
@ -17,18 +17,18 @@ void bootloader_ana_clock_glitch_reset_config(bool enable)
|
||||
(void)enable;
|
||||
}
|
||||
|
||||
void bootloader_power_glitch_reset_config(bool enable, uint8_t dref)
|
||||
void bootloader_power_glitch_reset_config(bool enable)
|
||||
{
|
||||
assert(dref < 8);
|
||||
REG_SET_FIELD(LP_ANA_FIB_ENABLE_REG, LP_ANA_ANA_FIB_PWR_GLITCH_ENA, 0);
|
||||
//only detect VDDPST POWER GLITCH
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PERIF, 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PLLBB, 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PLL, 0);
|
||||
|
||||
REG_SET_FIELD(LP_ANA_FIB_ENABLE_REG, LP_ANA_ANA_FIB_PWR_GLITCH_ENA, 0);//default val for chip from ECO2
|
||||
if (enable) {
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PERIF, dref);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_VDDPST, dref);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PLLBB, dref);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PLL, dref);
|
||||
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_POWER_GLITCH_RESET_ENA, 0xf);
|
||||
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_POWER_GLITCH_RESET_ENA, 0xf);//default val for chip from ECO2
|
||||
} else {
|
||||
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_POWER_GLITCH_RESET_ENA, 0);
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <strings.h>
|
||||
#include "hal/ecdsa_ll.h"
|
||||
#include "esp_flash_encrypt.h"
|
||||
#include "esp_secure_boot.h"
|
||||
#include "esp_efuse.h"
|
||||
@ -36,6 +37,12 @@ esp_err_t esp_secure_boot_enable_secure_features(void)
|
||||
ESP_LOGW(TAG, "UART ROM Download mode kept enabled - SECURITY COMPROMISED");
|
||||
#endif
|
||||
|
||||
#ifdef SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
|
||||
if (ecdsa_ll_is_configurable_curve_supported()) {
|
||||
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG
|
||||
ESP_LOGI(TAG, "Disable hardware & software JTAG...");
|
||||
esp_efuse_write_field_bit(ESP_EFUSE_DIS_PAD_JTAG);
|
||||
|
@ -796,20 +796,27 @@ static esp_err_t verify_segment_header(int index, const esp_image_segment_header
|
||||
bool map_segment = should_map(load_addr);
|
||||
|
||||
#if SOC_MMU_PAGE_SIZE_CONFIGURABLE
|
||||
esp_err_t err = ESP_FAIL;
|
||||
|
||||
/* ESP APP descriptor is present in the DROM segment #0 */
|
||||
if (index == 0 && !is_bootloader(metadata->start_addr)) {
|
||||
const esp_app_desc_t *app_desc = (const esp_app_desc_t *)bootloader_mmap(segment_data_offs, sizeof(esp_app_desc_t));
|
||||
if (!app_desc || app_desc->magic_word != ESP_APP_DESC_MAGIC_WORD) {
|
||||
uint32_t mmu_page_size = 0, magic_word = 0;
|
||||
const uint32_t mmu_page_size_offset = segment_data_offs + offsetof(esp_app_desc_t, mmu_page_size);
|
||||
CHECK_ERR(bootloader_flash_read(segment_data_offs, &magic_word, sizeof(uint32_t), true));
|
||||
CHECK_ERR(bootloader_flash_read(mmu_page_size_offset, &mmu_page_size, sizeof(uint32_t), true));
|
||||
// Extract only the lowest byte from mmu_page_size (as per image format)
|
||||
mmu_page_size &= 0xFF;
|
||||
|
||||
if (magic_word != ESP_APP_DESC_MAGIC_WORD) {
|
||||
ESP_LOGE(TAG, "Failed to fetch app description header!");
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
// Convert from log base 2 number to actual size while handling legacy image case (value 0)
|
||||
metadata->mmu_page_size = (app_desc->mmu_page_size > 0) ? (1UL << app_desc->mmu_page_size) : SPI_FLASH_MMU_PAGE_SIZE;
|
||||
metadata->mmu_page_size = (mmu_page_size > 0) ? (1UL << mmu_page_size) : SPI_FLASH_MMU_PAGE_SIZE;
|
||||
if (metadata->mmu_page_size != SPI_FLASH_MMU_PAGE_SIZE) {
|
||||
ESP_LOGI(TAG, "MMU page size mismatch, configured: 0x%x, found: 0x%"PRIx32, SPI_FLASH_MMU_PAGE_SIZE, metadata->mmu_page_size);
|
||||
}
|
||||
bootloader_munmap(app_desc);
|
||||
} else if (index == 0 && is_bootloader(metadata->start_addr)) {
|
||||
// Bootloader always uses the default MMU page size
|
||||
metadata->mmu_page_size = SPI_FLASH_MMU_PAGE_SIZE;
|
||||
@ -836,6 +843,10 @@ static esp_err_t verify_segment_header(int index, const esp_image_segment_header
|
||||
}
|
||||
|
||||
return ESP_OK;
|
||||
#if SOC_MMU_PAGE_SIZE_CONFIGURABLE
|
||||
err:
|
||||
return err;
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool should_map(uint32_t load_addr)
|
||||
|
@ -12,6 +12,10 @@
|
||||
#include "esp_secure_boot.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
|
||||
#ifdef SOC_ECDSA_SUPPORTED
|
||||
#include "hal/ecdsa_ll.h"
|
||||
#endif
|
||||
|
||||
#ifndef BOOTLOADER_BUILD
|
||||
static __attribute__((unused)) const char *TAG = "secure_boot";
|
||||
|
||||
@ -341,15 +345,17 @@ bool esp_secure_boot_cfg_verify_release_mode(void)
|
||||
}
|
||||
|
||||
#ifdef SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
|
||||
if (!secure) {
|
||||
uint8_t current_curve;
|
||||
esp_err_t err = esp_efuse_read_field_blob(ESP_EFUSE_ECDSA_CURVE_MODE, ¤t_curve, ESP_EFUSE_ECDSA_CURVE_MODE[0]->bit_count);
|
||||
if (err == ESP_OK) {
|
||||
if (current_curve != ESP_EFUSE_ECDSA_CURVE_MODE_ALLOW_ONLY_P256_BIT_LOCKED) {
|
||||
// If not P256 mode
|
||||
result &= secure;
|
||||
ESP_LOGW(TAG, "Not write disabled ECDSA curve mode (set WR_DIS_ECDSA_CURVE_MODE->1)");
|
||||
if (ecdsa_ll_is_configurable_curve_supported()) {
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
|
||||
if (!secure) {
|
||||
uint8_t current_curve;
|
||||
esp_err_t err = esp_efuse_read_field_blob(ESP_EFUSE_ECDSA_CURVE_MODE, ¤t_curve, ESP_EFUSE_ECDSA_CURVE_MODE[0]->bit_count);
|
||||
if (err == ESP_OK) {
|
||||
if (current_curve != ESP_EFUSE_ECDSA_CURVE_MODE_ALLOW_ONLY_P256_BIT_LOCKED) {
|
||||
// If not P256 mode
|
||||
result &= secure;
|
||||
ESP_LOGW(TAG, "Not write disabled ECDSA curve mode (set WR_DIS_ECDSA_CURVE_MODE->1)");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ config BT_BLE_LOG_SPI_OUT_LL_TASK_BUF_SIZE
|
||||
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
|
||||
default 1024
|
||||
help
|
||||
SPI transaction buffer size for upper layer task logs.
|
||||
SPI transaction buffer size for lower layer task logs.
|
||||
There will be 2 SPI DMA buffers with the same size.
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_LL_ISR_BUF_SIZE
|
||||
@ -56,9 +56,17 @@ config BT_BLE_LOG_SPI_OUT_LL_ISR_BUF_SIZE
|
||||
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
|
||||
default 512
|
||||
help
|
||||
SPI transaction buffer size for upper layer ISR logs.
|
||||
SPI transaction buffer size for lower layer ISR logs.
|
||||
There will be 2 SPI DMA buffers with the same size.
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_LL_HCI_BUF_SIZE
|
||||
int "SPI transaction buffer size for lower layer HCI logs"
|
||||
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
|
||||
default 512
|
||||
help
|
||||
SPI transaction buffer size for upper layer HCI logs.
|
||||
There will be 2 SPI DMA buffers with the same size
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_MOSI_IO_NUM
|
||||
int "GPIO number of SPI MOSI"
|
||||
depends on BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
@ -94,6 +102,13 @@ config BT_BLE_LOG_SPI_OUT_SYNC_IO_NUM
|
||||
help
|
||||
GPIO number of SYNC IO
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_TS_SYNC_SLEEP_SUPPORT
|
||||
bool "Enable ble log & logic analyzer log time sync sleep support"
|
||||
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
|
||||
default n
|
||||
help
|
||||
Enable ble log & logic analyzer log time sync sleep support
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_FLUSH_TIMER_ENABLED
|
||||
bool "Enable periodic buffer flush out"
|
||||
depends on BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
@ -108,3 +123,18 @@ config BT_BLE_LOG_SPI_OUT_FLUSH_TIMEOUT
|
||||
default 1000
|
||||
help
|
||||
Buffer flush out period in unit of ms
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_LE_AUDIO_ENABLED
|
||||
bool "Enable LE Audio log output to SPI"
|
||||
depends on BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
default n
|
||||
help
|
||||
Enable LE Audio log output to SPI
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_LE_AUDIO_BUF_SIZE
|
||||
int "SPI transaction buffer size for LE Audio logs"
|
||||
depends on BT_BLE_LOG_SPI_OUT_LE_AUDIO_ENABLED
|
||||
default 1024
|
||||
help
|
||||
SPI transaction buffer size for LE Audio logs.
|
||||
There will be 2 SPI DMA buffers with the same size.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -14,27 +14,33 @@
|
||||
#include "esp_log.h"
|
||||
#include "freertos/semphr.h"
|
||||
|
||||
// Public typedefs
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_ESP 0
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY 1
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_BLUEDROID 2
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_NIMBLE 3
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_HCI_UPSTREAM 4
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_HCI_DOWNSTREAM 5
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_ESP_ISR 6
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY_ISR 7
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_USER 0x10
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_SYNC 0xFE
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_LOSS 0xFF
|
||||
// Public enums
|
||||
enum {
|
||||
BLE_LOG_SPI_OUT_SOURCE_ESP = 0,
|
||||
BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY,
|
||||
BLE_LOG_SPI_OUT_SOURCE_BLUEDROID,
|
||||
BLE_LOG_SPI_OUT_SOURCE_NIMBLE,
|
||||
BLE_LOG_SPI_OUT_SOURCE_HCI_UPSTREAM,
|
||||
BLE_LOG_SPI_OUT_SOURCE_HCI_DOWNSTREAM,
|
||||
BLE_LOG_SPI_OUT_SOURCE_ESP_ISR,
|
||||
BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY_ISR,
|
||||
BLE_LOG_SPI_OUT_SOURCE_LL_HCI,
|
||||
BLE_LOG_SPI_OUT_SOURCE_LE_AUDIO,
|
||||
BLE_LOG_SPI_OUT_SOURCE_USER = 0x10,
|
||||
BLE_LOG_SPI_OUT_SOURCE_SSC = 0xFD,
|
||||
BLE_LOG_SPI_OUT_SOURCE_SYNC,
|
||||
BLE_LOG_SPI_OUT_SOURCE_LOSS,
|
||||
};
|
||||
|
||||
// SPI Log Level Definitions
|
||||
#define BLE_LOG_SPI_OUT_LEVEL_NONE 0 /*!< No log output */
|
||||
#define BLE_LOG_SPI_OUT_LEVEL_ERROR 1 /*!< Critical errors that SPI driver cannot recover from */
|
||||
#define BLE_LOG_SPI_OUT_LEVEL_WARN 2 /*!< Recoverable error conditions in SPI communication */
|
||||
#define BLE_LOG_SPI_OUT_LEVEL_INFO 3 /*!< Informational messages about SPI transactions */
|
||||
#define BLE_LOG_SPI_OUT_LEVEL_DEBUG 4 /*!< Detailed debug information, such as SPI register values */
|
||||
#define BLE_LOG_SPI_OUT_LEVEL_VERBOSE 5 /*!< Very detailed debugging logs, potentially flooding output */
|
||||
#define BLE_LOG_SPI_OUT_LEVEL_MAX 6 /*!< Number of SPI log levels supported */
|
||||
enum {
|
||||
BLE_LOG_SPI_OUT_LEVEL_NONE = 0,
|
||||
BLE_LOG_SPI_OUT_LEVEL_ERROR,
|
||||
BLE_LOG_SPI_OUT_LEVEL_WARN,
|
||||
BLE_LOG_SPI_OUT_LEVEL_INFO,
|
||||
BLE_LOG_SPI_OUT_LEVEL_DEBUG,
|
||||
BLE_LOG_SPI_OUT_LEVEL_VERBOSE,
|
||||
BLE_LOG_SPI_OUT_LEVEL_MAX,
|
||||
};
|
||||
|
||||
// Public functions
|
||||
int ble_log_spi_out_init(void);
|
||||
@ -50,5 +56,8 @@ int ble_log_spi_out_printf(uint8_t source, const char *format, ...);
|
||||
int ble_log_spi_out_printf_enh(uint8_t source, uint8_t level, const char *tag, const char *format, ...);
|
||||
int ble_log_spi_out_write_with_ts(uint8_t source, const uint8_t *addr, uint16_t len);
|
||||
void ble_log_spi_out_dump_all(void);
|
||||
void ble_log_spi_out_enable(bool enable);
|
||||
void ble_log_spi_out_flush(void);
|
||||
void ble_log_spi_out_le_audio_write(const uint8_t *addr, uint16_t len);
|
||||
|
||||
#endif // __BT_SPI_OUT_H__
|
||||
|
@ -965,7 +965,7 @@ static void btdm_sleep_enter_phase1_wrapper(uint32_t lpcycles)
|
||||
assert(us_to_sleep > BTDM_MIN_TIMER_UNCERTAINTY_US);
|
||||
// allow a maximum time uncertainty to be about 488ppm(1/2048) at least as clock drift
|
||||
// and set the timer in advance
|
||||
uint32_t uncertainty = (us_to_sleep >> 11);
|
||||
uint32_t uncertainty = (us_to_sleep / 1000);
|
||||
if (uncertainty < BTDM_MIN_TIMER_UNCERTAINTY_US) {
|
||||
uncertainty = BTDM_MIN_TIMER_UNCERTAINTY_US;
|
||||
}
|
||||
@ -1701,6 +1701,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
if (ble_log_spi_out_init() != 0) {
|
||||
ESP_LOGE(BTDM_LOG_TAG, "BLE Log SPI output init failed");
|
||||
err = ESP_ERR_NO_MEM;
|
||||
goto error;
|
||||
}
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
@ -584,7 +584,7 @@ config BT_LE_CCA_RSSI_THRESH
|
||||
int "CCA RSSI threshold value"
|
||||
depends on BT_LE_TX_CCA_ENABLED
|
||||
range 20 100
|
||||
default 20
|
||||
default 65
|
||||
help
|
||||
Power threshold of CCA in unit of -1 dBm.
|
||||
|
||||
|
@ -119,6 +119,11 @@ struct ext_funcs_t {
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
|
||||
|
||||
enum {
|
||||
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
|
||||
BLE_LOG_INTERFACE_FLAG_END,
|
||||
};
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
/* External functions or variables
|
||||
@ -411,20 +416,22 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
|
||||
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
|
||||
{
|
||||
bool end = flag ? true : false;
|
||||
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_controller_log_storage(len, addr, end);
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
if (len && addr) {
|
||||
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
|
||||
}
|
||||
if (len_append && addr_append) {
|
||||
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
|
||||
}
|
||||
if (end) { esp_rom_printf("\n"); }
|
||||
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
|
||||
|
||||
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
|
||||
bool "BLE adv report flow control supported"
|
||||
depends on (!BT_CTRL_RUN_IN_FLASH_ONLY) || (BT_CTRL_RUN_IN_FLASH_ONLY && BT_CTRL_BLE_SCAN)
|
||||
depends on BT_CTRL_BLE_SCAN
|
||||
default y
|
||||
help
|
||||
The function is mainly used to enable flow control for advertising reports. When it is enabled,
|
||||
@ -530,30 +530,31 @@ config BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
impact on Bluetooth performance.
|
||||
|
||||
config BT_CTRL_DTM_ENABLE
|
||||
depends on BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
bool "Enable direct test mode feature"
|
||||
default n
|
||||
|
||||
config BT_CTRL_BLE_MASTER
|
||||
depends on BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
bool "Enable BLE master role feature"
|
||||
default y
|
||||
|
||||
config BT_CTRL_BLE_MASTER
|
||||
bool "Enable BLE connection feature"
|
||||
default y
|
||||
help
|
||||
If this option is disabled, it is not recommended to use connectable ADV.
|
||||
|
||||
config BT_CTRL_BLE_TEST
|
||||
depends on BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
bool "Enable BLE QA test feature"
|
||||
bool "Enable BLE QA test feature (Not Used)"
|
||||
default n
|
||||
|
||||
config BT_CTRL_BLE_SCAN
|
||||
depends on BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
bool "Enable BLE scan feature"
|
||||
default y
|
||||
|
||||
config BT_CTRL_BLE_SECURITY_ENABLE
|
||||
depends on BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
bool "Enable BLE security feature"
|
||||
default y
|
||||
|
||||
config BT_CTRL_BLE_ADV
|
||||
bool "Enable BLE ADV feature"
|
||||
default y
|
||||
|
||||
config BT_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
|
||||
bool "Enable enhanced Access Address check in CONNECT_IND"
|
||||
default n
|
||||
|
@ -312,6 +312,17 @@ extern void advFilter_stack_enableDupExcListVsCmd(bool en);
|
||||
extern void chanSel_stack_enableSetCsaVsCmd(bool en);
|
||||
#endif // (CONFIG_BT_BLUEDROID_ENABLED || CONFIG_BT_NIMBLE_ENABLED)
|
||||
|
||||
extern void ble_dtm_funcs_reset(void);
|
||||
extern void ble_scan_funcs_reset(void);
|
||||
extern void ble_42_adv_funcs_reset(void);
|
||||
extern void ble_init_funcs_reset(void);
|
||||
extern void ble_con_funcs_reset(void);
|
||||
extern void ble_cca_funcs_reset(void);
|
||||
extern void ble_ext_adv_funcs_reset(void);
|
||||
extern void ble_ext_scan_funcs_reset(void);
|
||||
extern void ble_base_funcs_reset(void);
|
||||
extern void ble_enc_funcs_reset(void);
|
||||
|
||||
extern uint32_t _bt_bss_start;
|
||||
extern uint32_t _bt_bss_end;
|
||||
extern uint32_t _bt_controller_bss_start;
|
||||
@ -1265,6 +1276,46 @@ static void btdm_funcs_table_ready_wrapper(void)
|
||||
#if BLE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED
|
||||
btdm_aa_check_enhance_enable();
|
||||
#endif
|
||||
#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
// do nothing
|
||||
#else
|
||||
ESP_LOGI(BT_LOG_TAG, "Feature Config, ADV:%d, BLE_50:%d, DTM:%d, SCAN:%d, CCA:%d, SMP:%d, CONNECT:%d",
|
||||
BT_CTRL_BLE_ADV, BT_CTRL_50_FEATURE_SUPPORT, BT_CTRL_DTM_ENABLE, BT_CTRL_BLE_SCAN,
|
||||
BT_BLE_CCA_MODE, BLE_SECURITY_ENABLE, BT_CTRL_BLE_MASTER);
|
||||
|
||||
ble_base_funcs_reset();
|
||||
#if CONFIG_BT_CTRL_BLE_ADV
|
||||
ble_42_adv_funcs_reset();
|
||||
#if (BT_CTRL_50_FEATURE_SUPPORT == 1)
|
||||
ble_ext_adv_funcs_reset();
|
||||
#endif //
|
||||
#endif // CONFIG_BT_CTRL_BLE_ADV
|
||||
|
||||
#if CONFIG_BT_CTRL_DTM_ENABLE
|
||||
ble_dtm_funcs_reset();
|
||||
#endif // CONFIG_BT_CTRL_DTM_ENABLE
|
||||
|
||||
#if CONFIG_BT_CTRL_BLE_SCAN
|
||||
ble_scan_funcs_reset();
|
||||
#if (BT_CTRL_50_FEATURE_SUPPORT == 1)
|
||||
ble_ext_scan_funcs_reset();
|
||||
#endif // (BT_CTRL_50_FEATURE_SUPPORT == 1)
|
||||
#endif // CONFIG_BT_CTRL_BLE_SCAN
|
||||
|
||||
#if (BT_BLE_CCA_MODE != 0)
|
||||
ble_cca_funcs_reset();
|
||||
#endif // (BT_BLE_CCA_MODE != 0)
|
||||
|
||||
#if CONFIG_BT_CTRL_BLE_SECURITY_ENABLE
|
||||
ble_enc_funcs_reset();
|
||||
#endif // CONFIG_BT_CTRL_BLE_SECURITY_ENABLE
|
||||
|
||||
#if CONFIG_BT_CTRL_BLE_MASTER
|
||||
ble_init_funcs_reset();
|
||||
ble_con_funcs_reset();
|
||||
#endif // CONFIG_BT_CTRL_BLE_MASTER
|
||||
|
||||
#endif // CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
}
|
||||
|
||||
bool bt_async_wakeup_request(void)
|
||||
|
@ -681,7 +681,7 @@ config BT_LE_CCA_RSSI_THRESH
|
||||
int "CCA RSSI threshold value"
|
||||
depends on BT_LE_TX_CCA_ENABLED
|
||||
range 20 100
|
||||
default 20
|
||||
default 65
|
||||
help
|
||||
Power threshold of CCA in unit of -1 dBm.
|
||||
|
||||
@ -805,3 +805,10 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
|
||||
config BT_LE_RXBUF_OPT_ENABLED
|
||||
bool "Enable rxbuf optimization feature"
|
||||
default y
|
||||
|
||||
config BT_LE_CTRL_FAST_CONN_DATA_TX_EN
|
||||
bool "Enable fast sending of connection data"
|
||||
default y
|
||||
help
|
||||
If this option is enabled, The Controller will continue to
|
||||
Send an empty PDU after sending valid connection data within an interval.
|
||||
|
@ -67,7 +67,7 @@
|
||||
#define OSI_COEX_VERSION 0x00010006
|
||||
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
|
||||
|
||||
#define EXT_FUNC_VERSION 0x20240422
|
||||
#define EXT_FUNC_VERSION 0x20250415
|
||||
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
|
||||
|
||||
#define BT_ASSERT_PRINT ets_printf
|
||||
@ -98,14 +98,17 @@ struct ext_funcs_t {
|
||||
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
|
||||
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y,
|
||||
const uint8_t *local_priv_key, uint8_t *dhkey);
|
||||
void (* _esp_reset_rpa_moudle)(void);
|
||||
uint32_t magic;
|
||||
};
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
enum {
|
||||
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
|
||||
BLE_LOG_INTERFACE_FLAG_END,
|
||||
};
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
/* External functions or variables
|
||||
************************************************************************
|
||||
*/
|
||||
@ -182,7 +185,6 @@ static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
|
||||
static int esp_intr_free_wrapper(void **ret_handle);
|
||||
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
|
||||
static uint32_t osi_random_wrapper(void);
|
||||
static void esp_reset_rpa_moudle(void);
|
||||
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
|
||||
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
|
||||
const uint8_t *our_priv_key, uint8_t *out_dhkey);
|
||||
@ -459,15 +461,9 @@ struct ext_funcs_t ext_funcs_ro = {
|
||||
._os_random = osi_random_wrapper,
|
||||
._ecc_gen_key_pair = esp_ecc_gen_key_pair,
|
||||
._ecc_gen_dh_key = esp_ecc_gen_dh_key,
|
||||
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
|
||||
.magic = EXT_FUNC_MAGIC_VALUE,
|
||||
};
|
||||
|
||||
static void IRAM_ATTR esp_reset_rpa_moudle(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
|
||||
uint32_t param1, uint32_t param2)
|
||||
{
|
||||
@ -1419,20 +1415,22 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
|
||||
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
|
||||
{
|
||||
bool end = flag ? true : false;
|
||||
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_controller_log_storage(len, addr, end);
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
if (len && addr) {
|
||||
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
|
||||
}
|
||||
if (len_append && addr_append) {
|
||||
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
|
||||
}
|
||||
if (end) { esp_rom_printf("\n"); }
|
||||
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
}
|
||||
@ -1675,7 +1673,7 @@ int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv)
|
||||
#endif // CONFIG_BT_LE_DEBUG_REMAIN_SCENE_ENABLED
|
||||
|
||||
int IRAM_ATTR
|
||||
ble_capture_info_user_handler(uint8_t type, uint32_t reason)
|
||||
ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, uint32_t param2)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -192,6 +192,12 @@ extern "C" {
|
||||
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
|
||||
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
|
||||
#else
|
||||
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#else
|
||||
|
@ -721,7 +721,7 @@ config BT_LE_CCA_RSSI_THRESH
|
||||
int "CCA RSSI threshold value"
|
||||
depends on BT_LE_TX_CCA_ENABLED
|
||||
range 20 100
|
||||
default 20
|
||||
default 65
|
||||
help
|
||||
Power threshold of CCA in unit of -1 dBm.
|
||||
|
||||
@ -839,3 +839,10 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
|
||||
config BT_LE_RXBUF_OPT_ENABLED
|
||||
bool "Enable rxbuf optimization feature"
|
||||
default y
|
||||
|
||||
config BT_LE_CTRL_FAST_CONN_DATA_TX_EN
|
||||
bool "Enable fast sending of connection data"
|
||||
default y
|
||||
help
|
||||
If this option is enabled, The Controller will continue to
|
||||
Send an empty PDU after sending valid connection data within an interval.
|
||||
|
@ -58,6 +58,7 @@
|
||||
|
||||
#include "hal/efuse_hal.h"
|
||||
#include "soc/rtc.h"
|
||||
#include "modem/modem_syscon_struct.h"
|
||||
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
#include "ble_log/ble_log_spi_out.h"
|
||||
@ -70,7 +71,7 @@
|
||||
#define OSI_COEX_VERSION 0x00010006
|
||||
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
|
||||
|
||||
#define EXT_FUNC_VERSION 0x20240422
|
||||
#define EXT_FUNC_VERSION 0x20250415
|
||||
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
|
||||
|
||||
#define BT_ASSERT_PRINT ets_printf
|
||||
@ -101,17 +102,29 @@ struct ext_funcs_t {
|
||||
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
|
||||
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y,
|
||||
const uint8_t *local_priv_key, uint8_t *dhkey);
|
||||
void (* _esp_reset_rpa_moudle)(void);
|
||||
#if CONFIG_IDF_TARGET_ESP32C6
|
||||
void (* _esp_reset_modem)(uint8_t mdl_opts, uint8_t start);
|
||||
#endif // CONFIG_IDF_TARGET_ESP32C6
|
||||
uint32_t magic;
|
||||
};
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
|
||||
|
||||
enum {
|
||||
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
|
||||
BLE_LOG_INTERFACE_FLAG_END,
|
||||
};
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
/* External functions or variables
|
||||
************************************************************************
|
||||
*/
|
||||
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
|
||||
extern void coex_hw_timer_set(uint8_t idx,uint8_t src, uint8_t pti,uint32_t latency, uint32_t perioidc);
|
||||
extern void coex_hw_timer_enable(uint8_t idx);
|
||||
extern void coex_hw_timer_disable(uint8_t idx);
|
||||
#endif // CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
|
||||
extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
|
||||
extern int r_ble_controller_init(esp_bt_controller_config_t *cfg);
|
||||
extern void esp_ble_controller_info_capture(uint32_t cycle_times);
|
||||
@ -185,7 +198,9 @@ static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
|
||||
static int esp_intr_free_wrapper(void **ret_handle);
|
||||
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
|
||||
static uint32_t osi_random_wrapper(void);
|
||||
static void esp_reset_rpa_moudle(void);
|
||||
#if CONFIG_IDF_TARGET_ESP32C6
|
||||
static void esp_reset_modem(uint8_t mdl_opts,uint8_t start);
|
||||
#endif // CONFIG_IDF_TARGET_ESP32C6
|
||||
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
|
||||
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
|
||||
const uint8_t *our_priv_key, uint8_t *out_dhkey);
|
||||
@ -463,15 +478,34 @@ struct ext_funcs_t ext_funcs_ro = {
|
||||
._os_random = osi_random_wrapper,
|
||||
._ecc_gen_key_pair = esp_ecc_gen_key_pair,
|
||||
._ecc_gen_dh_key = esp_ecc_gen_dh_key,
|
||||
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
|
||||
#if CONFIG_IDF_TARGET_ESP32C6
|
||||
._esp_reset_modem = esp_reset_modem,
|
||||
#endif // CONFIG_IDF_TARGET_ESP32C6
|
||||
.magic = EXT_FUNC_MAGIC_VALUE,
|
||||
};
|
||||
|
||||
static void IRAM_ATTR esp_reset_rpa_moudle(void)
|
||||
#if CONFIG_IDF_TARGET_ESP32C6
|
||||
static void IRAM_ATTR esp_reset_modem(uint8_t mdl_opts,uint8_t start)
|
||||
{
|
||||
if (mdl_opts == 0x05) {
|
||||
if (start) {
|
||||
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
|
||||
coex_hw_timer_set(0x04, 0x02, 15, 0, 5000);
|
||||
coex_hw_timer_enable(0x04);
|
||||
#endif // CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
|
||||
MODEM_SYSCON.modem_rst_conf.val |= (BIT(16) | BIT(18));
|
||||
MODEM_SYSCON.modem_rst_conf.val &= ~(BIT(16) | BIT(18));
|
||||
} else {
|
||||
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
|
||||
coex_hw_timer_disable(0x04);
|
||||
#endif // CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // CONFIG_IDF_TARGET_ESP32C6
|
||||
|
||||
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
|
||||
uint32_t param1, uint32_t param2)
|
||||
{
|
||||
@ -1452,20 +1486,22 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
|
||||
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
|
||||
{
|
||||
bool end = flag ? true : false;
|
||||
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_controller_log_storage(len, addr, end);
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
if (len && addr) {
|
||||
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
|
||||
}
|
||||
if (len_append && addr_append) {
|
||||
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
|
||||
}
|
||||
if (end) { esp_rom_printf("\n"); }
|
||||
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
}
|
||||
@ -1708,7 +1744,7 @@ int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv)
|
||||
#endif // CONFIG_BT_LE_DEBUG_REMAIN_SCENE_ENABLED
|
||||
|
||||
int IRAM_ATTR
|
||||
ble_capture_info_user_handler(uint8_t type, uint32_t reason)
|
||||
ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, uint32_t param2)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -195,6 +195,12 @@ extern "C" {
|
||||
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
|
||||
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
|
||||
#else
|
||||
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#else
|
||||
|
@ -716,7 +716,7 @@ config BT_LE_CCA_RSSI_THRESH
|
||||
int "CCA RSSI threshold value"
|
||||
depends on BT_LE_TX_CCA_ENABLED
|
||||
range 20 100
|
||||
default 20
|
||||
default 65
|
||||
help
|
||||
Power threshold of CCA in unit of -1 dBm.
|
||||
|
||||
@ -843,3 +843,10 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
|
||||
config BT_LE_RXBUF_OPT_ENABLED
|
||||
bool "Enable rxbuf optimization feature"
|
||||
default y
|
||||
|
||||
config BT_LE_CTRL_FAST_CONN_DATA_TX_EN
|
||||
bool "Enable fast sending of connection data"
|
||||
default y
|
||||
help
|
||||
If this option is enabled, The Controller will continue to
|
||||
Send an empty PDU after sending valid connection data within an interval.
|
||||
|
@ -66,7 +66,7 @@
|
||||
#define OSI_COEX_VERSION 0x00010006
|
||||
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
|
||||
|
||||
#define EXT_FUNC_VERSION 0x20240422
|
||||
#define EXT_FUNC_VERSION 0x20250415
|
||||
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
|
||||
|
||||
#define BT_ASSERT_PRINT ets_printf
|
||||
@ -97,12 +97,16 @@ struct ext_funcs_t {
|
||||
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
|
||||
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y,
|
||||
const uint8_t *local_priv_key, uint8_t *dhkey);
|
||||
void (* _esp_reset_rpa_moudle)(void);
|
||||
uint32_t magic;
|
||||
};
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
|
||||
|
||||
enum {
|
||||
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
|
||||
BLE_LOG_INTERFACE_FLAG_END,
|
||||
};
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
/* External functions or variables
|
||||
************************************************************************
|
||||
@ -183,7 +187,6 @@ static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
|
||||
static int esp_intr_free_wrapper(void **ret_handle);
|
||||
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
|
||||
static uint32_t osi_random_wrapper(void);
|
||||
static void esp_reset_rpa_moudle(void);
|
||||
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
|
||||
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
|
||||
const uint8_t *our_priv_key, uint8_t *out_dhkey);
|
||||
@ -460,15 +463,9 @@ struct ext_funcs_t ext_funcs_ro = {
|
||||
._os_random = osi_random_wrapper,
|
||||
._ecc_gen_key_pair = esp_ecc_gen_key_pair,
|
||||
._ecc_gen_dh_key = esp_ecc_gen_dh_key,
|
||||
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
|
||||
.magic = EXT_FUNC_MAGIC_VALUE,
|
||||
};
|
||||
|
||||
static void IRAM_ATTR esp_reset_rpa_moudle(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
|
||||
uint32_t param1, uint32_t param2)
|
||||
{
|
||||
@ -1412,20 +1409,22 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
|
||||
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
|
||||
{
|
||||
bool end = flag ? true : false;
|
||||
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_controller_log_storage(len, addr, end);
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
if (len && addr) {
|
||||
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
|
||||
}
|
||||
if (len_append && addr_append) {
|
||||
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
|
||||
}
|
||||
if (end) { esp_rom_printf("\n"); }
|
||||
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
}
|
||||
@ -1667,7 +1666,7 @@ int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv)
|
||||
#endif // CONFIG_BT_LE_DEBUG_REMAIN_SCENE_ENABLED
|
||||
|
||||
int IRAM_ATTR
|
||||
ble_capture_info_user_handler(uint8_t type, uint32_t reason)
|
||||
ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, uint32_t param2)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -192,6 +192,12 @@ extern "C" {
|
||||
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
|
||||
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
|
||||
#else
|
||||
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#else
|
||||
|
Submodule components/bt/controller/lib_esp32c2/esp32c2-bt-lib updated: d6c94459f3...3ad0070589
Submodule components/bt/controller/lib_esp32c3_family updated: b09bf658a7...3ff529142f
Submodule components/bt/controller/lib_esp32c5/esp32c5-bt-lib updated: 48ff59a739...40a1921b1f
Submodule components/bt/controller/lib_esp32c6/esp32c6-bt-lib updated: 233738dc87...250e75199e
Submodule components/bt/controller/lib_esp32h2/esp32h2-bt-lib updated: efd8a69553...82cbc1dd93
@ -25,7 +25,6 @@ if BLE_MESH
|
||||
menuconfig BLE_MESH_USE_BLE_50
|
||||
bool "Support using BLE 5.0 APIs for BLE Mesh"
|
||||
depends on BLE_MESH_EXPERIMENTAL
|
||||
depends on IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
|
||||
select BT_NIMBLE_50_FEATURE_SUPPORT if BT_NIMBLE_ENABLED
|
||||
select BT_NIMBLE_EXT_ADV if BT_NIMBLE_ENABLED
|
||||
select BT_BLE_50_FEATURES_SUPPORTED if BT_BLUEDROID_ENABLED
|
||||
@ -477,7 +476,7 @@ if BLE_MESH
|
||||
int "Maximum capacity of solicitation replay protection list"
|
||||
depends on BLE_MESH_PROXY_SOLIC_PDU_RX
|
||||
default 2
|
||||
range 1 255
|
||||
range 1 65536
|
||||
help
|
||||
This option specifies the maximum capacity of the solicitation replay
|
||||
protection list. The solicitation replay protection list is used to
|
||||
|
@ -94,17 +94,16 @@ static inline int adv_send(struct net_buf *buf)
|
||||
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
|
||||
if (BLE_MESH_ADV(buf)->type == BLE_MESH_ADV_PROXY_SOLIC) {
|
||||
bt_mesh_adv_buf_ref_debug(__func__, buf, 3U, BLE_MESH_BUF_REF_SMALL);
|
||||
struct bt_mesh_adv_data solic_ad[3] = {
|
||||
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_FLAGS, (BLE_MESH_AD_GENERAL | BLE_MESH_AD_NO_BREDR)),
|
||||
struct bt_mesh_adv_data solic_ad[2] = {
|
||||
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_UUID16_ALL, 0x59, 0x18),
|
||||
BLE_MESH_ADV_DATA(BLE_MESH_DATA_SVC_DATA16, buf->data, buf->len),
|
||||
};
|
||||
#if CONFIG_BLE_MESH_USE_BLE_50
|
||||
param.primary_phy = BLE_MESH_ADV_PHY_1M;
|
||||
param.secondary_phy = BLE_MESH_ADV_PHY_1M;
|
||||
err = bt_le_ext_adv_start(CONFIG_BLE_MESH_ADV_INST_ID, ¶m, &ad, 3, NULL, 0);
|
||||
err = bt_le_ext_adv_start(CONFIG_BLE_MESH_ADV_INST_ID, ¶m, solic_ad, ARRAY_SIZE(solic_ad), NULL, 0);
|
||||
#else /* CONFIG_BLE_MESH_USE_BLE_50 */
|
||||
err = bt_le_adv_start(¶m, &ad, 3, NULL, 0);
|
||||
err = bt_le_adv_start(¶m, solic_ad, ARRAY_SIZE(solic_ad), NULL, 0);
|
||||
#endif /* CONFIG_BLE_MESH_USE_BLE_50 */
|
||||
} else
|
||||
#endif
|
||||
|
@ -625,6 +625,9 @@ void bt_mesh_adv_common_init(void)
|
||||
bt_mesh_adv_type_init(BLE_MESH_ADV_DATA, &adv_queue, &adv_buf_pool, adv_alloc);
|
||||
bt_mesh_adv_type_init(BLE_MESH_ADV_BEACON, &adv_queue, &adv_buf_pool, adv_alloc);
|
||||
bt_mesh_adv_type_init(BLE_MESH_ADV_URI, &adv_queue, &adv_buf_pool, adv_alloc);
|
||||
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
|
||||
bt_mesh_adv_type_init(BLE_MESH_ADV_PROXY_SOLIC, &adv_queue, &adv_buf_pool, adv_alloc);
|
||||
#endif
|
||||
|
||||
#if CONFIG_BLE_MESH_USE_BLE_50
|
||||
bt_mesh_adv_inst_init(BLE_MESH_ADV_INS, CONFIG_BLE_MESH_ADV_INST_ID);
|
||||
|
@ -140,6 +140,9 @@ enum bt_mesh_adv_type {
|
||||
#endif
|
||||
BLE_MESH_ADV_BEACON,
|
||||
BLE_MESH_ADV_URI,
|
||||
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
|
||||
BLE_MESH_ADV_PROXY_SOLIC,
|
||||
#endif
|
||||
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV
|
||||
BLE_MESH_ADV_BLE,
|
||||
#endif
|
||||
|
@ -667,7 +667,7 @@ int bt_le_ext_adv_start(const uint8_t inst_id,
|
||||
interval >>= 1;
|
||||
interval += (bt_mesh_get_rand() % (interval + 1));
|
||||
|
||||
BT_INFO("%u->%u", param->interval_min, interval);
|
||||
BT_DBG("%u->%u", param->interval_min, interval);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -2153,8 +2153,10 @@ static void bt_mesh_bta_gattc_cb(tBTA_GATTC_EVT event, tBTA_GATTC *p_data)
|
||||
for (i = 0; i < ARRAY_SIZE(bt_mesh_gattc_info); i++) {
|
||||
if (bt_mesh_gattc_info[i].conn.handle == handle) {
|
||||
if (bt_mesh_gattc_info[i].wr_desc_done == false) {
|
||||
BT_DBG("Receive notification before finishing to write ccc");
|
||||
BT_WARN("Receive notification before finishing to write ccc");
|
||||
#if !CONFIG_BLE_MESH_BQB_TEST
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
conn = &bt_mesh_gattc_info[i].conn;
|
||||
|
@ -70,6 +70,9 @@ static inline int adv_send(struct bt_mesh_adv_inst *inst, uint16_t *adv_duration
|
||||
#endif
|
||||
#if CONFIG_BLE_MESH_RELAY_ADV_BUF
|
||||
case BLE_MESH_ADV_RELAY_DATA:
|
||||
#endif
|
||||
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
|
||||
case BLE_MESH_ADV_PROXY_SOLIC:
|
||||
#endif
|
||||
case BLE_MESH_ADV_BEACON:
|
||||
case BLE_MESH_ADV_URI: {
|
||||
@ -96,9 +99,20 @@ static inline int adv_send(struct bt_mesh_adv_inst *inst, uint16_t *adv_duration
|
||||
param.primary_phy = BLE_MESH_ADV_PHY_1M;
|
||||
param.secondary_phy = BLE_MESH_ADV_PHY_1M;
|
||||
|
||||
bt_mesh_adv_buf_ref_debug(__func__, buf, 4U, BLE_MESH_BUF_REF_SMALL);
|
||||
|
||||
err = bt_le_ext_adv_start(inst->id, ¶m, &ad, 1, NULL, 0);
|
||||
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
|
||||
if (BLE_MESH_ADV(buf)->type == BLE_MESH_ADV_PROXY_SOLIC) {
|
||||
bt_mesh_adv_buf_ref_debug(__func__, buf, 3U, BLE_MESH_BUF_REF_SMALL);
|
||||
struct bt_mesh_adv_data solic_ad[2] = {
|
||||
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_UUID16_ALL, 0x59, 0x18),
|
||||
BLE_MESH_ADV_DATA(BLE_MESH_DATA_SVC_DATA16, buf->data, buf->len),
|
||||
};
|
||||
err = bt_le_ext_adv_start(CONFIG_BLE_MESH_ADV_INST_ID, ¶m, solic_ad, ARRAY_SIZE(solic_ad), NULL, 0);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
bt_mesh_adv_buf_ref_debug(__func__, buf, 4U, BLE_MESH_BUF_REF_SMALL);
|
||||
err = bt_le_ext_adv_start(inst->id, ¶m, &ad, 1, NULL, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV
|
||||
@ -303,6 +317,7 @@ static uint32_t received_adv_evts_handle(uint32_t recv_evts)
|
||||
CONFIG_BLE_MESH_GATT_PROXY_SERVER
|
||||
if (unlikely(i == BLE_MESH_ADV_PROXY_INS)) {
|
||||
BT_DBG("Mesh Proxy Advertising auto stop");
|
||||
bt_mesh_proxy_server_adv_flag_set(false);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
@ -366,7 +381,7 @@ void bt_mesh_adv_update(void)
|
||||
{
|
||||
#if (CONFIG_BLE_MESH_NODE && CONFIG_BLE_MESH_PB_GATT) || \
|
||||
CONFIG_BLE_MESH_GATT_PROXY_SERVER
|
||||
BT_WARN("Mesh Proxy Advertising stopped manually");
|
||||
BT_DBG("Mesh Proxy Advertising stopped manually");
|
||||
bt_mesh_proxy_server_adv_stop();
|
||||
if (adv_insts[BLE_MESH_ADV_PROXY_INS].busy) {
|
||||
ble_mesh_adv_task_wakeup(ADV_TASK_PROXY_ADV_UPD_EVT);
|
||||
|
@ -1223,7 +1223,7 @@ int bt_le_ext_adv_start(const uint8_t inst_id,
|
||||
interval >>= 1;
|
||||
interval += (bt_mesh_get_rand() % (interval + 1));
|
||||
|
||||
BT_INFO("%u->%u", param->interval_min, interval);
|
||||
BT_DBG("%u->%u", param->interval_min, interval);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2017-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -31,7 +31,7 @@
|
||||
|
||||
static struct bt_mesh_proxy_server {
|
||||
struct bt_mesh_conn *conn;
|
||||
|
||||
bt_mesh_addr_t addr;
|
||||
enum __attribute__((packed)) {
|
||||
CLI_NONE,
|
||||
CLI_PROV,
|
||||
@ -465,6 +465,7 @@ static void proxy_connected(bt_mesh_addr_t *addr, struct bt_mesh_conn *conn, int
|
||||
|
||||
server->conn = bt_mesh_conn_ref(conn);
|
||||
server->conn_type = CLI_NONE;
|
||||
memcpy(&server->addr, addr, sizeof(bt_mesh_addr_t));
|
||||
net_buf_simple_reset(&server->buf);
|
||||
|
||||
#if CONFIG_BLE_MESH_RPR_SRV && CONFIG_BLE_MESH_PB_GATT
|
||||
@ -629,6 +630,12 @@ static ssize_t proxy_write_ccc(bt_mesh_addr_t *addr, struct bt_mesh_conn *conn)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if CONFIG_BLE_MESH_BQB_TEST
|
||||
/* notify maybe received first */
|
||||
if (server->conn_type == CLI_PROXY) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -641,6 +648,16 @@ static ssize_t proxy_recv_ntf(struct bt_mesh_conn *conn, uint8_t *data, uint16_t
|
||||
return -ENOTCONN;
|
||||
}
|
||||
|
||||
#if CONFIG_BLE_MESH_BQB_TEST
|
||||
/* update conn type if notify received before write ccc */
|
||||
if (server->conn_type == CLI_NONE) {
|
||||
server->conn_type = CLI_PROXY;
|
||||
if (proxy_client_connect_cb) {
|
||||
proxy_client_connect_cb(&server->addr, server - servers, server->net_idx);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (server->conn_type == CLI_PROXY) {
|
||||
return proxy_recv(conn, NULL, data, len, 0, 0);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017 Intel Corporation
|
||||
* SPDX-FileContributor: 2018-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2018-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -170,6 +170,11 @@ static void proxy_sar_timeout(struct k_work *work)
|
||||
bt_mesh_gatts_disconnect(client->conn, 0x13);
|
||||
}
|
||||
|
||||
void bt_mesh_proxy_server_adv_flag_set(bool enable)
|
||||
{
|
||||
proxy_adv_enabled = enable;
|
||||
}
|
||||
|
||||
#if CONFIG_BLE_MESH_GATT_PROXY_SERVER
|
||||
/**
|
||||
* The following callbacks are used to notify proper information
|
||||
@ -853,7 +858,9 @@ static void proxy_connected(struct bt_mesh_conn *conn, uint8_t err)
|
||||
conn_count++;
|
||||
|
||||
/* Since we use ADV_OPT_ONE_TIME */
|
||||
proxy_adv_enabled = false;
|
||||
#if !CONFIG_BLE_MESH_USE_BLE_50
|
||||
bt_mesh_proxy_server_adv_flag_set(false);
|
||||
#endif
|
||||
|
||||
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_RX
|
||||
/* Before re-enabling advertising, stop advertising
|
||||
@ -1356,7 +1363,7 @@ int bt_mesh_proxy_server_segment_send(struct bt_mesh_conn *conn, uint8_t type,
|
||||
net_buf_simple_pull(msg, mtu);
|
||||
|
||||
while (msg->len) {
|
||||
if (msg->len + 1 < mtu) {
|
||||
if (msg->len + 1 <= mtu) {
|
||||
net_buf_simple_push_u8(msg, BLE_MESH_PROXY_PDU_HDR(BLE_MESH_PROXY_SAR_LAST, type));
|
||||
proxy_send(conn, msg->data, msg->len);
|
||||
break;
|
||||
@ -1498,7 +1505,7 @@ static int node_id_adv(struct bt_mesh_subnet *sub)
|
||||
return err;
|
||||
}
|
||||
|
||||
proxy_adv_enabled = true;
|
||||
bt_mesh_proxy_server_adv_flag_set(true);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1529,7 +1536,7 @@ static int net_id_adv(struct bt_mesh_subnet *sub)
|
||||
return err;
|
||||
}
|
||||
|
||||
proxy_adv_enabled = true;
|
||||
bt_mesh_proxy_server_adv_flag_set(true);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1592,7 +1599,7 @@ static int private_node_id_adv(struct bt_mesh_subnet *sub)
|
||||
return err;
|
||||
}
|
||||
|
||||
proxy_adv_enabled = true;
|
||||
bt_mesh_proxy_server_adv_flag_set(true);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1636,7 +1643,7 @@ static int private_net_id_adv(struct bt_mesh_subnet *sub)
|
||||
return err;
|
||||
}
|
||||
|
||||
proxy_adv_enabled = true;
|
||||
bt_mesh_proxy_server_adv_flag_set(true);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1902,7 +1909,7 @@ int32_t bt_mesh_proxy_server_adv_start(void)
|
||||
prov_sd, prov_sd_len) == 0) {
|
||||
#endif /* CONFIG_BLE_MESH_USE_BLE_50 */
|
||||
|
||||
proxy_adv_enabled = true;
|
||||
bt_mesh_proxy_server_adv_flag_set(true);
|
||||
|
||||
/* Advertise 60 seconds using fast interval */
|
||||
if (prov_fast_adv) {
|
||||
@ -1959,7 +1966,7 @@ int bt_mesh_proxy_server_adv_stop(void)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
proxy_adv_enabled = false;
|
||||
bt_mesh_proxy_server_adv_flag_set(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2022,7 +2029,7 @@ int bt_mesh_proxy_server_deinit(void)
|
||||
proxy_adv_inst = BLE_MESH_ADV_INS_UNUSED;
|
||||
#endif
|
||||
|
||||
proxy_adv_enabled = false;
|
||||
bt_mesh_proxy_server_adv_flag_set(false);
|
||||
gatt_svc = MESH_GATT_NONE;
|
||||
|
||||
#if CONFIG_BLE_MESH_GATT_PROXY_SERVER
|
||||
|
@ -118,6 +118,7 @@ void bt_mesh_proxy_server_identity_stop(struct bt_mesh_subnet *sub);
|
||||
|
||||
bool bt_mesh_proxy_server_relay(struct net_buf_simple *buf, uint16_t dst);
|
||||
void bt_mesh_proxy_server_addr_add(struct net_buf_simple *buf, uint16_t addr);
|
||||
void bt_mesh_proxy_server_adv_flag_set(bool enable);
|
||||
|
||||
int bt_mesh_proxy_server_init(void);
|
||||
int bt_mesh_proxy_server_deinit(void);
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017 Intel Corporation
|
||||
* SPDX-FileContributor: 2020-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2020-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -102,13 +102,14 @@ int bt_mesh_unprov_dev_info_query(uint8_t uuid[16], uint8_t addr[6],
|
||||
{
|
||||
uint8_t idx = 0;
|
||||
uint8_t cnt = 0;
|
||||
uint8_t pair_num = unprov_dev_info_fifo.pair_num;
|
||||
|
||||
if (uuid == NULL || addr == NULL) {
|
||||
if (uuid == NULL && addr == NULL) {
|
||||
BT_WARN("No available information to query");
|
||||
return -1;
|
||||
}
|
||||
|
||||
while (cnt < unprov_dev_info_fifo.pair_num) {
|
||||
while (cnt < pair_num) {
|
||||
idx = (cnt + unprov_dev_info_fifo.start_idx) % BLE_MESH_STORE_UNPROV_INFO_MAX_NUM;
|
||||
if (query_type & BLE_MESH_STORE_UNPROV_INFO_QUERY_TYPE_UUID) {
|
||||
if (!memcmp(unprov_dev_info_fifo.info[idx].addr, addr, 6)) {
|
||||
@ -134,7 +135,7 @@ int bt_mesh_unprov_dev_info_query(uint8_t uuid[16], uint8_t addr[6],
|
||||
cnt++;
|
||||
}
|
||||
|
||||
if (cnt == unprov_dev_info_fifo.pair_num) {
|
||||
if (cnt == pair_num) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -92,6 +92,9 @@ uint8_t __meshlib_var_BLE_MESH_ADV_RELAY_DATA = BLE_MESH_ADV_RELAY_DATA;
|
||||
#endif
|
||||
uint8_t __meshlib_var_BLE_MESH_ADV_BEACON = BLE_MESH_ADV_BEACON;
|
||||
uint8_t __meshlib_var_BLE_MESH_ADV_URI = BLE_MESH_ADV_URI;
|
||||
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
|
||||
uint8_t __meshlib_var_BLE_MESH_ADV_PROXY_SOLIC = BLE_MESH_ADV_PROXY_SOLIC;
|
||||
#endif
|
||||
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV
|
||||
uint8_t __meshlib_var_BLE_MESH_ADV_BLE = BLE_MESH_ADV_BLE;
|
||||
#endif
|
||||
@ -1175,17 +1178,17 @@ uint8_t *bt_mesh_ext_net_get_dev_key_ca(void)
|
||||
return bt_mesh.dev_key_ca;
|
||||
}
|
||||
|
||||
uint8_t bt_mesh_ext_net_get_rpl_count(void)
|
||||
uint16_t bt_mesh_ext_net_get_rpl_count(void)
|
||||
{
|
||||
return ARRAY_SIZE(bt_mesh.rpl);
|
||||
}
|
||||
|
||||
uint16_t bt_mesh_ext_net_get_rpl_src(uint8_t index)
|
||||
uint16_t bt_mesh_ext_net_get_rpl_src(uint16_t index)
|
||||
{
|
||||
return bt_mesh.rpl[index].src;
|
||||
}
|
||||
|
||||
void bt_mesh_ext_net_reset_rpl(uint8_t index)
|
||||
void bt_mesh_ext_net_reset_rpl(uint16_t index)
|
||||
{
|
||||
memset(&bt_mesh.rpl[index], 0, sizeof(bt_mesh.rpl[index]));
|
||||
}
|
||||
@ -3813,7 +3816,7 @@ void *bt_mesh_ext_brc_srv_get_bridge_table_entry(void *srv, uint8_t index)
|
||||
#endif /* CONFIG_BLE_MESH_BRC_SRV */
|
||||
}
|
||||
|
||||
void *bt_mesh_ext_brc_srv_get_bridge_rpl(uint8_t index)
|
||||
void *bt_mesh_ext_brc_srv_get_bridge_rpl(uint16_t index)
|
||||
{
|
||||
#if CONFIG_BLE_MESH_BRC_SRV
|
||||
return &bridge_rpl[index];
|
||||
@ -4584,7 +4587,7 @@ typedef struct {
|
||||
uint16_t (*_bt_mesh_ext_sub_get_sbr_net_idx)(void *sub);
|
||||
void (*_bt_mesh_ext_sub_set_sbr_net_idx)(void *sub, uint16_t sbr_net_idx);
|
||||
void *(*_bt_mesh_ext_brc_srv_get_bridge_table_entry)(void *srv, uint8_t index);
|
||||
void *(*_bt_mesh_ext_brc_srv_get_bridge_rpl)(uint8_t index);
|
||||
void *(*_bt_mesh_ext_brc_srv_get_bridge_rpl)(uint16_t index);
|
||||
/* CONFIG_BLE_MESH_BRC_SRV */
|
||||
|
||||
/* CONFIG_BLE_MESH_AGG_CLI */
|
||||
|
Submodule components/bt/esp_ble_mesh/lib/lib updated: 480089db59...d9fe7de9a9
@ -1493,6 +1493,13 @@ config BT_BLE_FEAT_CONN_SUBRATING
|
||||
help
|
||||
Enable BLE connection subrating feature
|
||||
|
||||
config BT_BLE_VENDOR_HCI_EN
|
||||
bool "Enable BLE Vendor HCI command and event"
|
||||
depends on BT_BLE_ENABLED
|
||||
default y
|
||||
help
|
||||
This enables BLE vendor HCI command and event
|
||||
|
||||
config BT_BLE_HIGH_DUTY_ADV_INTERVAL
|
||||
bool "Enable BLE high duty advertising interval feature"
|
||||
depends on BT_BLE_ENABLED
|
||||
|
@ -131,19 +131,6 @@ esp_err_t esp_ble_gap_stop_advertising(void)
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_clear_advertising(void)
|
||||
{
|
||||
btc_msg_t msg;
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_ACT_CLEAR_ADV;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
@ -300,83 +287,17 @@ esp_err_t esp_ble_gap_config_local_privacy (bool privacy_enable)
|
||||
|
||||
esp_err_t esp_ble_gap_config_local_icon (uint16_t icon)
|
||||
{
|
||||
esp_err_t ret;
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_gap_args_t arg;
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
switch (icon) {
|
||||
case ESP_BLE_APPEARANCE_GENERIC_PHONE:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_COMPUTER:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_REMOTE:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_THERMOMETER:
|
||||
case ESP_BLE_APPEARANCE_THERMOMETER_EAR:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_HEART_RATE:
|
||||
case ESP_BLE_APPEARANCE_HEART_RATE_BELT:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE:
|
||||
case ESP_BLE_APPEARANCE_BLOOD_PRESSURE_ARM:
|
||||
case ESP_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER:
|
||||
case ESP_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP:
|
||||
case ESP_BLE_APPEARANCE_PULSE_OXIMETER_WRIST:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_GLUCOSE:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_WEIGHT:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_WALKING:
|
||||
case ESP_BLE_APPEARANCE_WALKING_IN_SHOE:
|
||||
case ESP_BLE_APPEARANCE_WALKING_ON_SHOE:
|
||||
case ESP_BLE_APPEARANCE_WALKING_ON_HIP:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_WATCH:
|
||||
case ESP_BLE_APPEARANCE_SPORTS_WATCH:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_EYEGLASSES:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_DISPLAY:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER:
|
||||
case ESP_BLE_APPEARANCE_HID_BARCODE_SCANNER:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_HID:
|
||||
case ESP_BLE_APPEARANCE_HID_KEYBOARD:
|
||||
case ESP_BLE_APPEARANCE_HID_MOUSE:
|
||||
case ESP_BLE_APPEARANCE_HID_JOYSTICK:
|
||||
case ESP_BLE_APPEARANCE_HID_GAMEPAD:
|
||||
case ESP_BLE_APPEARANCE_HID_DIGITIZER_TABLET:
|
||||
case ESP_BLE_APPEARANCE_HID_CARD_READER:
|
||||
case ESP_BLE_APPEARANCE_HID_DIGITAL_PEN:
|
||||
case ESP_BLE_APPEARANCE_UNKNOWN:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_CLOCK:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_TAG:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_KEYRING:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_CYCLING:
|
||||
case ESP_BLE_APPEARANCE_CYCLING_COMPUTER:
|
||||
case ESP_BLE_APPEARANCE_CYCLING_SPEED:
|
||||
case ESP_BLE_APPEARANCE_CYCLING_CADENCE:
|
||||
case ESP_BLE_APPEARANCE_CYCLING_POWER:
|
||||
case ESP_BLE_APPEARANCE_CYCLING_SPEED_CADENCE:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE:
|
||||
case ESP_BLE_APPEARANCE_POWERED_WHEELCHAIR:
|
||||
case ESP_BLE_APPEARANCE_MOBILITY_SCOOTER:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_INSULIN_PUMP:
|
||||
case ESP_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP:
|
||||
case ESP_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP:
|
||||
case ESP_BLE_APPEARANCE_INSULIN_PEN:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS:
|
||||
case ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION:
|
||||
case ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV:
|
||||
case ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD:
|
||||
case ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV:
|
||||
case ESP_BLE_APPEARANCE_STANDALONE_SPEAKER:
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_ACT_CONFIG_LOCAL_ICON;
|
||||
arg.cfg_local_icon.icon = icon;
|
||||
ret = (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
break;
|
||||
default:
|
||||
ret = ESP_ERR_INVALID_ARG;
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_ACT_CONFIG_LOCAL_ICON;
|
||||
arg.cfg_local_icon.icon = icon;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_update_whitelist(bool add_remove, esp_bd_addr_t remote_bda, esp_ble_wl_addr_type_t wl_addr_type)
|
||||
@ -1079,23 +1000,6 @@ esp_err_t esp_ble_gap_set_privacy_mode(esp_ble_addr_type_t addr_type, esp_bd_add
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_set_csa_support(uint8_t csa_select)
|
||||
{
|
||||
btc_msg_t msg;
|
||||
btc_ble_gap_args_t arg;
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_SET_CSA_SUPPORT;
|
||||
|
||||
arg.set_csa_support.csa_select = csa_select;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
esp_err_t esp_ble_gap_read_phy(esp_bd_addr_t bd_addr)
|
||||
@ -1779,6 +1683,7 @@ esp_err_t esp_ble_gap_set_periodic_adv_sync_trans_params(esp_bd_addr_t addr, con
|
||||
}
|
||||
#endif //#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
esp_err_t esp_ble_gap_vendor_command_send(esp_ble_vendor_cmd_params_t *vendor_cmd_param)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
@ -1807,7 +1712,7 @@ esp_err_t esp_ble_gap_vendor_command_send(esp_ble_vendor_cmd_params_t *vendor_cm
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_set_vendor_event_mask(uint32_t event_mask)
|
||||
esp_err_t esp_ble_gap_set_vendor_event_mask(esp_ble_vendor_evt_mask_t event_mask)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_gap_args_t arg;
|
||||
@ -1825,6 +1730,37 @@ esp_err_t esp_ble_gap_set_vendor_event_mask(uint32_t event_mask)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_clear_advertising(void)
|
||||
{
|
||||
btc_msg_t msg;
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_ACT_CLEAR_ADV;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_set_csa_support(uint8_t csa_select)
|
||||
{
|
||||
btc_msg_t msg;
|
||||
btc_ble_gap_args_t arg;
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_SET_CSA_SUPPORT;
|
||||
|
||||
arg.set_csa_support.csa_select = csa_select;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif // (BLE_VENDOR_HCI_EN == TRUE)
|
||||
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
esp_err_t esp_ble_gap_enhanced_read_transmit_power_level(uint16_t conn_handle, esp_ble_tx_power_phy_t phy)
|
||||
{
|
||||
|
@ -260,6 +260,11 @@ esp_err_t esp_ble_gatts_stop_service(uint16_t service_handle)
|
||||
esp_err_t esp_ble_gatts_send_indicate(esp_gatt_if_t gatts_if, uint16_t conn_id, uint16_t attr_handle,
|
||||
uint16_t value_len, uint8_t *value, bool need_confirm)
|
||||
{
|
||||
if (value_len > ESP_GATT_MAX_ATTR_LEN) {
|
||||
LOG_ERROR("%s, value_len > ESP_GATT_MAX_ATTR_LEN.", __func__);
|
||||
return ESP_ERR_INVALID_SIZE;
|
||||
}
|
||||
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_gatts_args_t arg;
|
||||
|
||||
@ -272,7 +277,7 @@ esp_err_t esp_ble_gatts_send_indicate(esp_gatt_if_t gatts_if, uint16_t conn_id,
|
||||
}
|
||||
|
||||
if (L2CA_CheckIsCongest(L2CAP_ATT_CID, p_tcb->peer_bda)) {
|
||||
LOG_DEBUG("%s, the l2cap chanel is congest.", __func__);
|
||||
LOG_DEBUG("%s, the l2cap channel is congest.", __func__);
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
|
@ -145,6 +145,7 @@ typedef enum {
|
||||
ESP_AVRC_CT_SET_ABSOLUTE_VOLUME_RSP_EVT = 7, /*!< set absolute volume response event */
|
||||
ESP_AVRC_CT_COVER_ART_STATE_EVT = 8, /*!< cover art client connection state changed event */
|
||||
ESP_AVRC_CT_COVER_ART_DATA_EVT = 9, /*!< cover art client data event */
|
||||
ESP_AVRC_CT_PROF_STATE_EVT = 10, /*!< Indicate AVRCP controller init or deinit complete */
|
||||
} esp_avrc_ct_cb_event_t;
|
||||
|
||||
/// AVRC Target callback events
|
||||
@ -155,6 +156,7 @@ typedef enum {
|
||||
ESP_AVRC_TG_SET_ABSOLUTE_VOLUME_CMD_EVT = 3, /*!< set absolute volume command from remote device */
|
||||
ESP_AVRC_TG_REGISTER_NOTIFICATION_EVT = 4, /*!< register notification event */
|
||||
ESP_AVRC_TG_SET_PLAYER_APP_VALUE_EVT = 5, /*!< set application attribute value, attribute refer to esp_avrc_ps_attr_ids_t */
|
||||
ESP_AVRC_TG_PROF_STATE_EVT = 6, /*!< Indicate AVRCP target init or deinit complete */
|
||||
} esp_avrc_tg_cb_event_t;
|
||||
|
||||
/// AVRC metadata attribute mask
|
||||
@ -303,6 +305,18 @@ typedef struct {
|
||||
uint8_t ct_cover_art_conn_num; /*!< Number of cover art client connections */
|
||||
} esp_avrc_profile_status_t;
|
||||
|
||||
/**
|
||||
* @brief Bluetooth AVRCP Initiation states
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_AVRC_INIT_SUCCESS = 0, /*!< Indicate init successful */
|
||||
ESP_AVRC_INIT_ALREADY, /*!< Indicate init repeated */
|
||||
ESP_AVRC_INIT_FAIL, /*!< Indicate init fail */
|
||||
ESP_AVRC_DEINIT_SUCCESS, /*!< Indicate deinit successful */
|
||||
ESP_AVRC_DEINIT_ALREADY, /*!< Indicate deinit repeated */
|
||||
ESP_AVRC_DEINIT_FAIL, /*!< Indicate deinit fail */
|
||||
} esp_avrc_init_state_t;
|
||||
|
||||
/// AVRC controller callback parameters
|
||||
typedef union {
|
||||
/**
|
||||
@ -390,6 +404,14 @@ typedef union {
|
||||
uint16_t data_len; /*!< the data length of this data event, in bytes */
|
||||
uint8_t *p_data; /*!< pointer to data, should copy to other buff before event callback return */
|
||||
} cover_art_data; /*!< AVRC Cover Art data event */
|
||||
|
||||
/**
|
||||
* @brief ESP_AVRC_CT_PROF_STATE_EVT
|
||||
*/
|
||||
struct avrc_ct_init_stat_param {
|
||||
esp_avrc_init_state_t state; /*!< avrc ct initialization param */
|
||||
} avrc_ct_init_stat; /*!< status to indicate avrcp ct init or deinit */
|
||||
|
||||
} esp_avrc_ct_cb_param_t;
|
||||
|
||||
/// AVRC target callback parameters
|
||||
@ -442,6 +464,13 @@ typedef union {
|
||||
esp_avrc_set_app_value_param_t *p_vals; /*!< point to the id and value of player application attribute */
|
||||
} set_app_value; /*!< set player application value */
|
||||
|
||||
/**
|
||||
* @brief ESP_AVRC_TG_PROF_STATE_EVT
|
||||
*/
|
||||
struct avrc_tg_init_stat_param {
|
||||
esp_avrc_init_state_t state; /*!< avrc tg initialization param */
|
||||
} avrc_tg_init_stat; /*!< status to indicate avrcp tg init or deinit */
|
||||
|
||||
} esp_avrc_tg_cb_param_t;
|
||||
|
||||
/**
|
||||
@ -482,6 +511,7 @@ esp_err_t esp_avrc_ct_register_callback(esp_avrc_ct_cb_t callback);
|
||||
* @brief Initialize the bluetooth AVRCP controller module, This function should be called
|
||||
* after esp_bluedroid_enable() completes successfully. Note: AVRC cannot work independently,
|
||||
* AVRC should be used along with A2DP and AVRC should be initialized before A2DP.
|
||||
* ESP_AVRC_CT_PROF_STATE_EVT with ESP_AVRC_INIT_SUCCESS will reported to the APP layer.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
@ -496,6 +526,7 @@ esp_err_t esp_avrc_ct_init(void);
|
||||
* @brief De-initialize AVRCP controller module. This function should be called after
|
||||
* after esp_bluedroid_enable() completes successfully. Note: AVRC cannot work independently,
|
||||
* AVRC should be used along with A2DP and AVRC should be deinitialized before A2DP.
|
||||
* ESP_AVRC_CT_PROF_STATE_EVT with ESP_AVRC_DEINIT_SUCCESS will reported to the APP layer.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
@ -636,6 +667,7 @@ esp_err_t esp_avrc_tg_register_callback(esp_avrc_tg_cb_t callback);
|
||||
* @brief Initialize the bluetooth AVRCP target module, This function should be called
|
||||
* after esp_bluedroid_enable() completes successfully. Note: AVRC cannot work independently,
|
||||
* AVRC should be used along with A2DP and AVRC should be initialized before A2DP.
|
||||
* ESP_AVRC_TG_PROF_STATE_EVT with ESP_AVRC_INIT_SUCCESS will reported to the APP layer.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
@ -650,6 +682,7 @@ esp_err_t esp_avrc_tg_init(void);
|
||||
* @brief De-initialize AVRCP target module. This function should be called after
|
||||
* after esp_bluedroid_enable() completes successfully. Note: AVRC cannot work independently,
|
||||
* AVRC should be used along with A2DP and AVRC should be deinitialized before A2DP.
|
||||
* ESP_AVRC_TG_PROF_STATE_EVT with ESP_AVRC_DEINIT_SUCCESS will reported to the APP layer.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
|
@ -282,8 +282,11 @@ typedef enum {
|
||||
|
||||
/// white list address type
|
||||
typedef enum {
|
||||
BLE_WL_ADDR_TYPE_PUBLIC = 0x00,
|
||||
BLE_WL_ADDR_TYPE_RANDOM = 0x01,
|
||||
BLE_WL_ADDR_TYPE_PUBLIC = 0x00, /*!< Public Device Address */
|
||||
BLE_WL_ADDR_TYPE_RANDOM = 0x01, /*!< Random Device Address */
|
||||
#if (CONFIG_BT_BLE_50_FEATURES_SUPPORTED)
|
||||
BLE_WL_ADDR_TYPE_ANONYMOUS = 0xFF, /*!< Devices sending anonymous advertisements, use to enable anonymous advertising report for scanning */
|
||||
#endif // (CONFIG_BT_BLE_50_FEATURES_SUPPORTED)
|
||||
} esp_ble_wl_addr_type_t;
|
||||
|
||||
/// Used to exchange the encryption key in the init key & response key
|
||||
|
@ -1102,11 +1102,58 @@ typedef struct {
|
||||
} esp_ble_gap_past_params_t;
|
||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
|
||||
typedef enum{
|
||||
typedef enum {
|
||||
ESP_BLE_NETWORK_PRIVACY_MODE = 0X00, /*!< Network Privacy Mode for peer device (default) */
|
||||
ESP_BLE_DEVICE_PRIVACY_MODE = 0X01, /*!< Device Privacy Mode for peer device */
|
||||
} esp_ble_privacy_mode_t;
|
||||
|
||||
#define ESP_BLE_VENDOR_SCAN_REQ_RECV_EVT_MASK BIT(0) /*!< Vendor BLE legacy SCAN_REQ received event mask */
|
||||
#define ESP_BLE_VENDOR_CHMAP_UPDATE_EVT_MASK BIT(1) /*!< Vendor BLE channel map update event mask */
|
||||
#define ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT_MASK BIT(3) /*!< Vendor BLE sleep wakeup event mask */
|
||||
#define ESP_BLE_VENDOR_CONN_REQ_RECV_EVT_MASK BIT(4) /*!< Vendor BLE CONNECT_IND and AUX_CONNECT_REQ received event mask */
|
||||
#define ESP_BLE_VENDOR_CONN_RSP_RECV_EVT_MASK BIT(5) /*!< Vendor BLE AUX_CONNECT_RSP received event mask */
|
||||
typedef uint32_t esp_ble_vendor_evt_mask_t;
|
||||
|
||||
#define ESP_BLE_VENDOR_PDU_RECV_EVT (0) /*!< Vendor BLE specify PDU received event */
|
||||
#define ESP_BLE_VENDOR_CHAN_MAP_UPDATE_EVT (1) /*!< Vendor BLE channel map update complete event */
|
||||
#define ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT (2) /*!< Vendor BLE sleep wakeup event */
|
||||
typedef uint8_t esp_ble_vendor_evt_t;
|
||||
|
||||
typedef enum {
|
||||
ESP_BLE_VENDOR_PDU_SCAN_REQ = 0, /*!< SCAN_REQ PDU type */
|
||||
ESP_BLE_VENDOR_PDU_CONN_REQ, /*!< CONNECT_IND and AUX_CONNECT_REQ PDU type */
|
||||
ESP_BLE_VENDOR_PDU_CONN_RSP, /*!< AUX_CONNECT_RSP PDU type */
|
||||
} esp_ble_vendor_pdu_t;
|
||||
|
||||
/**
|
||||
* @brief BLE vendor event parameters union
|
||||
*/
|
||||
typedef union {
|
||||
/**
|
||||
* @brief ESP_BLE_VENDOR_PDU_RECV_EVT
|
||||
*/
|
||||
struct ble_pdu_recv_evt_param {
|
||||
esp_ble_vendor_pdu_t type; /*!< The type of LE PDU */
|
||||
uint8_t handle; /*!< The handle of advertising set */
|
||||
esp_ble_addr_type_t addr_type; /*!< The address type of peer device */
|
||||
esp_bd_addr_t peer_addr; /*!< The address of peer device */
|
||||
} pdu_recv; /*!< Event parameter of ESP_BLE_VENDOR_PDU_RECV_EVT */
|
||||
/**
|
||||
* @brief ESP_BLE_VENDOR_CHAN_MAP_UPDATE_EVT
|
||||
*/
|
||||
struct ble_chan_map_update_evt_param {
|
||||
uint8_t status; /*!< Indicate the channel map update status (HCI error code) */
|
||||
uint16_t conn_handle; /*!< The connection handle */
|
||||
esp_gap_ble_channels ch_map; /*!< The channel map after updated */
|
||||
} chan_map_update; /*!< Event parameter of ESP_BLE_VENDOR_CHAN_MAP_UPDATE_EVT */
|
||||
/**
|
||||
* @brief ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT
|
||||
*/
|
||||
struct ble_sleep_wakeup_evt_param {
|
||||
// No parameters
|
||||
} sleep_wakeup; /*!< Event parameter of ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT */
|
||||
} esp_ble_vendor_evt_param_t;
|
||||
|
||||
/**
|
||||
* @brief path loss report parameters
|
||||
*/
|
||||
@ -1258,12 +1305,6 @@ typedef union {
|
||||
struct ble_adv_stop_cmpl_evt_param {
|
||||
esp_bt_status_t status; /*!< Indicate adv stop operation success status */
|
||||
} adv_stop_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT */
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT
|
||||
*/
|
||||
struct ble_adv_clear_cmpl_evt_param {
|
||||
esp_bt_status_t status; /*!< Indicate adv clear operation success status */
|
||||
} adv_clear_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT */
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT
|
||||
@ -1665,6 +1706,19 @@ typedef union {
|
||||
esp_ble_dtm_update_evt_t update_evt; /*!< DTM state change event, 0x00: DTM TX start, 0x01: DTM RX start, 0x02:DTM end */
|
||||
uint16_t num_of_pkt; /*!< number of packets received, only valid if update_evt is DTM_TEST_STOP_EVT and shall be reported as 0 for a transmitter */
|
||||
} dtm_state_update; /*!< Event parameter of ESP_GAP_BLE_DTM_TEST_UPDATE_EVT */
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT
|
||||
*/
|
||||
struct ble_set_privacy_mode_cmpl_evt_param {
|
||||
esp_bt_status_t status; /*!< Indicate privacy mode set operation success status */
|
||||
} set_privacy_mode_cmpl; /*!< Event parameter of ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT */
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT
|
||||
*/
|
||||
struct ble_adv_clear_cmpl_evt_param {
|
||||
esp_bt_status_t status; /*!< Indicate adv clear operation success status */
|
||||
} adv_clear_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT */
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_VENDOR_CMD_COMPLETE_EVT
|
||||
*/
|
||||
@ -1673,12 +1727,6 @@ typedef union {
|
||||
uint16_t param_len; /*!< The length of parameter buffer */
|
||||
uint8_t *p_param_buf; /*!< The point of parameter buffer */
|
||||
} vendor_cmd_cmpl; /*!< Event parameter of ESP_GAP_BLE_VENDOR_CMD_COMPLETE_EVT */
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT
|
||||
*/
|
||||
struct ble_set_privacy_mode_cmpl_evt_param {
|
||||
esp_bt_status_t status; /*!< Indicate privacy mode set operation success status */
|
||||
} set_privacy_mode_cmpl; /*!< Event parameter of ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT */
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_SET_CSA_SUPPORT_COMPLETE_EVT
|
||||
*/
|
||||
@ -1695,10 +1743,12 @@ typedef union {
|
||||
* @brief ESP_GAP_BLE_VENDOR_HCI_EVT
|
||||
*/
|
||||
struct ble_vendor_hci_event_evt_param {
|
||||
uint8_t subevt_code; /*!< Subevent code for vendor HCI event, the range is 0xC0 to 0xFF */
|
||||
uint8_t param_len; /*!< The length of the event parameter buffer */
|
||||
uint8_t *param_buf; /*!< The pointer of the event parameter buffer */
|
||||
} vendor_hci_evt; /*!< Event parameter buffer of ESP_GAP_BLE_VENDOR_HCI_EVT */
|
||||
esp_ble_vendor_evt_t subevt_code; /*!< Subevent code for BLE vendor HCI event */
|
||||
esp_ble_vendor_evt_param_t param; /*!< Event parameter of BLE vendor HCI subevent */
|
||||
uint8_t param_len; /*!< The length of the event parameter buffer (for internal use only) */
|
||||
uint8_t *param_buf; /*!< The pointer of the event parameter buffer (for internal use only) */
|
||||
} vendor_hci_evt; /*!< Event parameter of ESP_GAP_BLE_VENDOR_HCI_EVT */
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_ENH_READ_TRANS_PWR_LEVEL_EVT
|
||||
@ -2040,15 +2090,19 @@ esp_err_t esp_ble_gap_clear_rand_addr(void);
|
||||
esp_err_t esp_ble_gap_config_local_privacy (bool privacy_enable);
|
||||
|
||||
/**
|
||||
* @brief set local gap appearance icon
|
||||
* @brief Set the local GAP appearance icon.
|
||||
*
|
||||
* @note This API does not restrict the input icon value.
|
||||
* If an undefined or incorrect icon value is used, the device icon may not display properly.
|
||||
*
|
||||
* @param[in] icon - External appearance value, these values are defined by the Bluetooth SIG, please refer to
|
||||
* For a complete list of valid appearance values, please refer to "2.6.2 Appearance Category ranges" at:
|
||||
* https://www.bluetooth.com/specifications/assigned-numbers/
|
||||
*
|
||||
* @param[in] icon - External appearance value (16-bit), as defined by the Bluetooth SIG.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK : success
|
||||
* - other : failed
|
||||
* - ESP_OK : Success
|
||||
* - ESP_FAIL : Internal failure
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_gap_config_local_icon (uint16_t icon);
|
||||
@ -2726,15 +2780,17 @@ esp_err_t esp_ble_gap_periodic_adv_stop(uint8_t instance);
|
||||
esp_err_t esp_ble_gap_set_ext_scan_params(const esp_ble_ext_scan_params_t *params);
|
||||
|
||||
/**
|
||||
* @brief This function is used to enable scanning.
|
||||
* @brief Enables extended scanning.
|
||||
*
|
||||
* @param[in] duration Scan duration time, where Time = N * 10 ms. Range: 0x0001 to 0xFFFF.
|
||||
* @param[in] period Time interval from when the Controller started its last Scan Duration until it begins the subsequent Scan Duration.
|
||||
* Time = N * 1.28 sec. Range: 0x0001 to 0xFFFF.
|
||||
* @param[in] duration Scan duration in units of 10 ms.
|
||||
* - Range: 0x0001 to 0xFFFF (Time = N * 10 ms).
|
||||
* - 0x0000: Scan continuously until explicitly disabled.
|
||||
*
|
||||
* @param[in] period Time interval between the start of consecutive scan durations, in units of 1.28 seconds.
|
||||
* - Range: 0x0001 to 0xFFFF (Time = N * 1.28 sec).
|
||||
* - 0x0000: Scan continuously.
|
||||
* @return - ESP_OK : success
|
||||
* - other : failed
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_gap_start_ext_scan(uint32_t duration, uint16_t period);
|
||||
|
||||
@ -3026,14 +3082,13 @@ esp_err_t esp_ble_gap_set_csa_support(uint8_t csa_select);
|
||||
/**
|
||||
* @brief This function is used to control which vendor events are generated by the HCI for the Host.
|
||||
*
|
||||
* @param[in] event_mask: Bit0: Legacy scan request received event
|
||||
* Bit1: Vendor channel map update complete event
|
||||
* @param[in] event_mask: The BLE vendor HCI event mask
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK : success
|
||||
* - other : failed
|
||||
*/
|
||||
esp_err_t esp_ble_gap_set_vendor_event_mask(uint32_t event_mask);
|
||||
esp_err_t esp_ble_gap_set_vendor_event_mask(esp_ble_vendor_evt_mask_t event_mask);
|
||||
|
||||
/**
|
||||
* @brief This function is used to read the current and maximum transmit power levels of the local Controller.
|
||||
|
@ -478,7 +478,7 @@ typedef uint8_t esp_gatt_char_prop_t;
|
||||
*
|
||||
* This definition specifies the maximum number of bytes that a GATT attribute can hold.
|
||||
*/
|
||||
#define ESP_GATT_MAX_ATTR_LEN 512 /*!< As same as GATT_MAX_ATTR_LEN. */
|
||||
#define ESP_GATT_MAX_ATTR_LEN 517 /*!< As same as GATT_MAX_ATTR_LEN. */
|
||||
|
||||
/**
|
||||
* @brief Enumerates the possible sources of a GATT service discovery.
|
||||
|
@ -345,6 +345,11 @@ esp_err_t esp_bt_hid_device_unregister_app(void);
|
||||
* called after esp_bt_hid_device_init(). When the operation is complete, the callback function will
|
||||
* be called with ESP_HIDD_OPEN_EVT.
|
||||
*
|
||||
* @note The connection between the HID Host and the HID Device is established as a virtual cable by default.
|
||||
* A new HID Host connection request will only be accepted after the previous HID Host has been
|
||||
* explicitly unplugged. For details on disconnection and virtual cable unplugging, please refer to API
|
||||
* `esp_bt_hid_device_disconnect` and `esp_bt_hid_device_virtual_cable_unplug`.
|
||||
*
|
||||
* @param[in] bd_addr: Remote host bluetooth device address.
|
||||
*
|
||||
* @return
|
||||
|
@ -733,6 +733,7 @@ void bta_dm_cfg_coex_status (tBTA_DM_MSG *p_data)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
void bta_dm_send_vendor_hci(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_VendorSpecificCommand(p_data->vendor_hci_cmd.opcode,
|
||||
@ -741,6 +742,28 @@ void bta_dm_send_vendor_hci(tBTA_DM_MSG *p_data)
|
||||
p_data->vendor_hci_cmd.vendor_hci_cb);
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_clear_adv(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
if (BTM_BleClearAdv(p_data->ble_clear_adv.p_clear_adv_cback) == FALSE) {
|
||||
if (p_data->ble_clear_adv.p_clear_adv_cback) {
|
||||
(*p_data->ble_clear_adv.p_clear_adv_cback)(BTA_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_set_csa_support(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
APPL_TRACE_API("%s, csa_select = %d", __func__, p_data->ble_set_csa_support.csa_select);
|
||||
BTM_BleSetCsaSupport(p_data->ble_set_csa_support.csa_select, p_data->ble_set_csa_support.p_cback);
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_set_vendor_evt_mask(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
APPL_TRACE_API("%s, evt_mask = %d", __func__, p_data->ble_set_vendor_evt_mask.evt_mask);
|
||||
BTM_BleSetVendorEventMask(p_data->ble_set_vendor_evt_mask.evt_mask, p_data->ble_set_vendor_evt_mask.p_cback);
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_set_afh_channels
|
||||
@ -5822,15 +5845,6 @@ void bta_dm_ble_gap_dtm_stop(tBTA_DM_MSG *p_data)
|
||||
}
|
||||
#endif // #if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
|
||||
void bta_dm_ble_gap_clear_adv(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
if (BTM_BleClearAdv(p_data->ble_clear_adv.p_clear_adv_cback) == FALSE) {
|
||||
if (p_data->ble_clear_adv.p_clear_adv_cback) {
|
||||
(*p_data->ble_clear_adv.p_clear_adv_cback)(BTA_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_set_rpa_timeout(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
APPL_TRACE_API("%s, rpa_timeout = %d", __func__, p_data->set_rpa_timeout.rpa_timeout);
|
||||
@ -5853,18 +5867,6 @@ void bta_dm_ble_gap_set_privacy_mode(tBTA_DM_MSG *p_data)
|
||||
p_data->ble_set_privacy_mode.privacy_mode, p_data->ble_set_privacy_mode.p_cback);
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_set_csa_support(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
APPL_TRACE_API("%s, csa_select = %d", __func__, p_data->ble_set_csa_support.csa_select);
|
||||
BTM_BleSetCsaSupport(p_data->ble_set_csa_support.csa_select, p_data->ble_set_csa_support.p_cback);
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_set_vendor_evt_mask(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
APPL_TRACE_API("%s, evt_mask = %d", __func__, p_data->ble_set_vendor_evt_mask.evt_mask);
|
||||
BTM_BleSetVendorEventMask(p_data->ble_set_vendor_evt_mask.evt_mask, p_data->ble_set_vendor_evt_mask.p_cback);
|
||||
}
|
||||
|
||||
void bta_dm_read_ble_channel_map(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
if (p_data && p_data->ch_map.read_ch_map_cb) {
|
||||
|
@ -231,6 +231,7 @@ void BTA_DmCfgCoexStatus(UINT8 op, UINT8 type, UINT8 status)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
void BTA_DmsendVendorHciCmd(UINT16 opcode, UINT8 param_len, UINT8 *p_param_buf, tBTA_SEND_VENDOR_HCI_CMPL_CBACK p_vendor_cmd_complete_cback)
|
||||
{
|
||||
tBTA_DM_API_SEND_VENDOR_HCI_CMD *p_msg;
|
||||
@ -246,6 +247,57 @@ void BTA_DmsendVendorHciCmd(UINT16 opcode, UINT8 param_len, UINT8 *p_param_buf,
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleClearAdv
|
||||
**
|
||||
** Description This function is called to clear Advertising
|
||||
**
|
||||
** Parameters p_adv_data_cback : clear adv complete callback.
|
||||
**
|
||||
** Returns None
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_DmBleClearAdv (tBTA_CLEAR_ADV_CMPL_CBACK *p_clear_adv_cback)
|
||||
{
|
||||
tBTA_DM_API_CLEAR_ADV *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_CLEAR_ADV *)
|
||||
osi_malloc(sizeof(tBTA_DM_API_CLEAR_ADV))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_CLEAR_ADV_EVT;
|
||||
p_msg->p_clear_adv_cback = p_clear_adv_cback;
|
||||
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapSetCsaSupport(uint8_t csa_select, tBTA_SET_CSA_SUPPORT_CMPL_CBACK *p_callback)
|
||||
{
|
||||
tBTA_DM_API_BLE_SET_CSA_SUPPORT *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_BLE_SET_CSA_SUPPORT *)osi_malloc(sizeof(tBTA_DM_API_BLE_SET_CSA_SUPPORT)))
|
||||
!= NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT;
|
||||
p_msg->csa_select = csa_select;
|
||||
p_msg->p_cback = p_callback;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapSetVendorEventMask(uint32_t evt_mask, tBTA_SET_VENDOR_EVT_MASK_CBACK *p_callback)
|
||||
{
|
||||
tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK *)osi_malloc(sizeof(tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK)))
|
||||
!= NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT;
|
||||
p_msg->evt_mask = evt_mask;
|
||||
p_msg->p_cback = p_callback;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
void BTA_DmConfigEir(tBTA_DM_EIR_CONF *eir_config)
|
||||
@ -1896,30 +1948,6 @@ extern void BTA_DmBleBroadcast (BOOLEAN start, tBTA_START_STOP_ADV_CMPL_CBACK *p
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleClearAdv
|
||||
**
|
||||
** Description This function is called to clear Advertising
|
||||
**
|
||||
** Parameters p_adv_data_cback : clear adv complete callback.
|
||||
**
|
||||
** Returns None
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_DmBleClearAdv (tBTA_CLEAR_ADV_CMPL_CBACK *p_clear_adv_cback)
|
||||
{
|
||||
tBTA_DM_API_CLEAR_ADV *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_CLEAR_ADV *)
|
||||
osi_malloc(sizeof(tBTA_DM_API_CLEAR_ADV))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_CLEAR_ADV_EVT;
|
||||
p_msg->p_clear_adv_cback = p_clear_adv_cback;
|
||||
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
#endif
|
||||
@ -3014,32 +3042,6 @@ void BTA_DmClearRandAddress(void)
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapSetCsaSupport(uint8_t csa_select, tBTA_SET_CSA_SUPPORT_CMPL_CBACK *p_callback)
|
||||
{
|
||||
tBTA_DM_API_BLE_SET_CSA_SUPPORT *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_BLE_SET_CSA_SUPPORT *)osi_malloc(sizeof(tBTA_DM_API_BLE_SET_CSA_SUPPORT)))
|
||||
!= NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT;
|
||||
p_msg->csa_select = csa_select;
|
||||
p_msg->p_cback = p_callback;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapSetVendorEventMask(uint32_t evt_mask, tBTA_SET_VENDOR_EVT_MASK_CBACK *p_callback)
|
||||
{
|
||||
tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK *)osi_malloc(sizeof(tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK)))
|
||||
!= NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT;
|
||||
p_msg->evt_mask = evt_mask;
|
||||
p_msg->p_cback = p_callback;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
void BTA_DmBleGapEnhReadTransPwrLevel(uint16_t conn_handle, uint8_t phy)
|
||||
{
|
||||
|
@ -67,7 +67,12 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
#if (ESP_COEX_VSC_INCLUDED == TRUE)
|
||||
bta_dm_cfg_coex_status, /* BTA_DM_API_CFG_COEX_ST_EVT */
|
||||
#endif
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
bta_dm_send_vendor_hci, /* BTA_DM_API_SEND_VENDOR_HCI_CMD_EVT */
|
||||
bta_dm_ble_gap_clear_adv, /* BTA_DM_API_BLE_CLEAR_ADV_EVT */
|
||||
bta_dm_ble_gap_set_csa_support, /* BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT */
|
||||
bta_dm_ble_gap_set_vendor_evt_mask, /* BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT */
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
bta_dm_config_eir, /* BTA_DM_API_CONFIG_EIR_EVT */
|
||||
bta_dm_set_page_timeout, /* BTA_DM_API_PAGE_TO_SET_EVT */
|
||||
@ -278,14 +283,9 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
#if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
bta_dm_ble_gap_dtm_stop, /* BTA_DM_API_DTM_STOP_EVT */
|
||||
#endif // #if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
bta_dm_ble_gap_clear_adv, /* BTA_DM_API_BLE_CLEAR_ADV_EVT */
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
bta_dm_ble_gap_set_rpa_timeout, /* BTA_DM_API_SET_RPA_TIMEOUT_EVT */
|
||||
bta_dm_ble_gap_add_dev_to_resolving_list, /* BTA_DM_API_ADD_DEV_TO_RESOLVING_LIST_EVT */
|
||||
bta_dm_ble_gap_set_privacy_mode, /* BTA_DM_API_SET_PRIVACY_MODE_EVT */
|
||||
bta_dm_ble_gap_set_csa_support, /* BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT */
|
||||
bta_dm_ble_gap_set_vendor_evt_mask, /* BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT */
|
||||
bta_dm_read_ble_channel_map, /* BTA_DM_API_BLE_READ_CH_MAP_EVT */
|
||||
#endif
|
||||
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||
|
@ -57,7 +57,12 @@ enum {
|
||||
#if (ESP_COEX_VSC_INCLUDED == TRUE)
|
||||
BTA_DM_API_CFG_COEX_ST_EVT,
|
||||
#endif
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
BTA_DM_API_SEND_VENDOR_HCI_CMD_EVT,
|
||||
BTA_DM_API_BLE_CLEAR_ADV_EVT,
|
||||
BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT,
|
||||
BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT,
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
BTA_DM_API_CONFIG_EIR_EVT,
|
||||
BTA_DM_API_PAGE_TO_SET_EVT,
|
||||
@ -269,14 +274,9 @@ enum {
|
||||
#if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
BTA_DM_API_DTM_STOP_EVT,
|
||||
#endif // #if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
BTA_DM_API_BLE_CLEAR_ADV_EVT,
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
BTA_DM_API_SET_RPA_TIMEOUT_EVT,
|
||||
BTA_DM_API_ADD_DEV_TO_RESOLVING_LIST_EVT,
|
||||
BTA_DM_API_SET_PRIVACY_MODE_EVT,
|
||||
BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT,
|
||||
BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT,
|
||||
BTA_DM_API_BLE_READ_CH_MAP_EVT,
|
||||
#endif
|
||||
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||
|
@ -166,9 +166,9 @@ uint32_t btc_get_ble_status(void)
|
||||
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
// Number of recorded devices
|
||||
extern uint8_t btm_ble_sec_dev_active_count(void);
|
||||
if (btm_ble_sec_dev_active_count()) {
|
||||
status |= BIT(BTC_BLE_STATUS_KEYS);
|
||||
extern uint8_t btm_ble_sec_dev_record_count(void);
|
||||
if (btm_ble_sec_dev_record_count()) {
|
||||
status |= BIT(BTC_BLE_STATUS_DEVICE_REC);
|
||||
}
|
||||
|
||||
// Number of saved bonded devices
|
||||
@ -216,5 +216,12 @@ uint32_t btc_get_ble_status(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SMP_INCLUDED == TRUE
|
||||
extern uint8_t smp_get_state(void);
|
||||
if (smp_get_state()) {
|
||||
status |= BIT(BTC_BLE_STATUS_SMP_STATE);
|
||||
}
|
||||
#endif
|
||||
|
||||
return status;
|
||||
}
|
||||
|
@ -34,13 +34,14 @@ typedef enum {
|
||||
BTC_BLE_STATUS_EXT_ADV, // Extended advertising exist
|
||||
BTC_BLE_STATUS_SCAN, // Scanning exist
|
||||
BTC_BLE_STATUS_CONN, // Connection exist
|
||||
BTC_BLE_STATUS_KEYS, // Device keys record exist
|
||||
BTC_BLE_STATUS_DEVICE_REC, // Device record exist
|
||||
BTC_BLE_STATUS_BOND, // Bond info exist
|
||||
BTC_BLE_STATUS_GATTC_CACHE, // GATTC cache exist
|
||||
BTC_BLE_STATUS_GATTC_APP, // GATTC application exist
|
||||
BTC_BLE_STATUS_GATTS_SRVC, // GATTS service exist
|
||||
BTC_BLE_STATUS_PRIVACY, // Privacy enabled
|
||||
BTC_BLE_STATUS_ADDR_RESOLVE_DISABLE,// Address resolution disable status
|
||||
BTC_BLE_STATUS_SMP_STATE, // SMP state machine
|
||||
} tBTC_BLE_STATUS;
|
||||
|
||||
future_t **btc_main_get_future_p(btc_main_future_type_t type);
|
||||
|
@ -303,10 +303,6 @@ static bool btc_avrc_tg_set_rn_supported_evt(uint16_t evt_set)
|
||||
|
||||
static inline void btc_avrc_ct_cb_to_app(esp_avrc_ct_cb_event_t event, esp_avrc_ct_cb_param_t *param)
|
||||
{
|
||||
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
|
||||
return;
|
||||
}
|
||||
|
||||
esp_avrc_ct_cb_t btc_avrc_ct_cb = (esp_avrc_ct_cb_t)btc_profile_cb_get(BTC_PID_AVRC_CT);
|
||||
if (btc_avrc_ct_cb) {
|
||||
btc_avrc_ct_cb(event, param);
|
||||
@ -315,10 +311,6 @@ static inline void btc_avrc_ct_cb_to_app(esp_avrc_ct_cb_event_t event, esp_avrc_
|
||||
|
||||
static inline void btc_avrc_tg_cb_to_app(esp_avrc_tg_cb_event_t event, esp_avrc_tg_cb_param_t *param)
|
||||
{
|
||||
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
|
||||
return;
|
||||
}
|
||||
|
||||
esp_avrc_tg_cb_t btc_avrc_tg_cb = (esp_avrc_tg_cb_t)btc_profile_cb_get(BTC_PID_AVRC_TG);
|
||||
if (btc_avrc_tg_cb) {
|
||||
btc_avrc_tg_cb(event, param);
|
||||
@ -1108,27 +1100,39 @@ BOOLEAN btc_rc_get_connected_peer(BD_ADDR peer_addr)
|
||||
*******************************************************************************/
|
||||
static void btc_avrc_ct_init(void)
|
||||
{
|
||||
esp_avrc_init_state_t state = ESP_AVRC_INIT_SUCCESS;
|
||||
|
||||
BTC_TRACE_DEBUG("## %s ##", __FUNCTION__);
|
||||
if (s_rc_ct_init == BTC_RC_CT_INIT_MAGIC) {
|
||||
BTC_TRACE_WARNING("%s already initialized", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
/// initialize CT-specific resources
|
||||
s_rc_ct_init = BTC_RC_CT_INIT_MAGIC;
|
||||
do {
|
||||
|
||||
/// initialize CT-TG shared resources
|
||||
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
|
||||
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb_t));
|
||||
|
||||
if (!g_av_with_rc) {
|
||||
g_av_with_rc = true;
|
||||
if (s_rc_ct_init == BTC_RC_CT_INIT_MAGIC) {
|
||||
BTC_TRACE_WARNING("%s already initialized", __FUNCTION__);
|
||||
state = ESP_AVRC_INIT_ALREADY;
|
||||
break;
|
||||
}
|
||||
|
||||
if (g_a2dp_on_init) {
|
||||
BTC_TRACE_WARNING("AVRC Controller is expected to be initialized in advance of A2DP !!!");
|
||||
/// initialize CT-TG shared resources
|
||||
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
|
||||
if (g_a2dp_on_init) {
|
||||
BTC_TRACE_WARNING("AVRC Controller is expected to be initialized in advance of A2DP !!!");
|
||||
state = ESP_AVRC_INIT_FAIL;
|
||||
break;
|
||||
}
|
||||
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb_t));
|
||||
|
||||
if (!g_av_with_rc) {
|
||||
g_av_with_rc = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// initialize CT-specific resources
|
||||
s_rc_ct_init = BTC_RC_CT_INIT_MAGIC;
|
||||
} while (0);
|
||||
|
||||
esp_avrc_ct_cb_param_t param = {0};
|
||||
param.avrc_ct_init_stat.state = state;
|
||||
btc_avrc_ct_cb_to_app(ESP_AVRC_CT_PROF_STATE_EVT, ¶m);
|
||||
}
|
||||
|
||||
|
||||
@ -1143,29 +1147,37 @@ static void btc_avrc_ct_init(void)
|
||||
***************************************************************************/
|
||||
static void btc_avrc_ct_deinit(void)
|
||||
{
|
||||
esp_avrc_init_state_t state = ESP_AVRC_DEINIT_SUCCESS;
|
||||
|
||||
BTC_TRACE_API("## %s ##", __FUNCTION__);
|
||||
|
||||
if (g_a2dp_on_deinit) {
|
||||
BTC_TRACE_WARNING("A2DP already deinit, AVRC CT should deinit in advance of A2DP !!!");
|
||||
}
|
||||
|
||||
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
|
||||
BTC_TRACE_WARNING("%s not initialized", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
/// deinit CT-specific resources
|
||||
s_rc_ct_init = 0;
|
||||
|
||||
/// deinit CT-TG shared resources
|
||||
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
|
||||
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb_t));
|
||||
if (g_av_with_rc) {
|
||||
g_av_with_rc = false;
|
||||
do {
|
||||
if (g_a2dp_on_deinit) {
|
||||
BTC_TRACE_WARNING("A2DP already deinit, AVRC CT should deinit in advance of A2DP !!!");
|
||||
}
|
||||
}
|
||||
|
||||
BTC_TRACE_API("## %s ## completed", __FUNCTION__);
|
||||
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
|
||||
BTC_TRACE_WARNING("%s not initialized", __FUNCTION__);
|
||||
state = ESP_AVRC_DEINIT_ALREADY;
|
||||
break;
|
||||
}
|
||||
|
||||
/// deinit CT-specific resources
|
||||
s_rc_ct_init = 0;
|
||||
|
||||
/// deinit CT-TG shared resources
|
||||
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
|
||||
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb_t));
|
||||
if (g_av_with_rc) {
|
||||
g_av_with_rc = false;
|
||||
}
|
||||
}
|
||||
BTC_TRACE_API("## %s ## completed", __FUNCTION__);
|
||||
} while (0);
|
||||
|
||||
esp_avrc_ct_cb_param_t param = {0};
|
||||
param.avrc_ct_init_stat.state = state;
|
||||
btc_avrc_ct_cb_to_app(ESP_AVRC_CT_PROF_STATE_EVT, ¶m);
|
||||
}
|
||||
|
||||
static bt_status_t btc_avrc_ct_send_set_player_value_cmd(uint8_t tl, uint8_t attr_id, uint8_t value_id)
|
||||
@ -1474,30 +1486,42 @@ static void btc_avrc_ct_cover_art_get_linked_thumbnail(UINT8 *image_handle)
|
||||
*******************************************************************************/
|
||||
static void btc_avrc_tg_init(void)
|
||||
{
|
||||
esp_avrc_init_state_t state = ESP_AVRC_INIT_SUCCESS;
|
||||
|
||||
BTC_TRACE_DEBUG("## %s ##", __FUNCTION__);
|
||||
if (s_rc_tg_init == BTC_RC_TG_INIT_MAGIC) {
|
||||
BTC_TRACE_WARNING("%s already initialized", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
/// initialize TG-specific resources
|
||||
memcpy(s_psth_supported_cmd, cs_psth_dft_supported_cmd, sizeof(s_psth_supported_cmd));
|
||||
s_rn_supported_evt = cs_rn_dft_supported_evt;
|
||||
|
||||
/// initialize CT-TG shared resources
|
||||
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
|
||||
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb));
|
||||
|
||||
if (!g_av_with_rc) {
|
||||
g_av_with_rc = true;
|
||||
do {
|
||||
if (s_rc_tg_init == BTC_RC_TG_INIT_MAGIC) {
|
||||
BTC_TRACE_WARNING("%s already initialized", __FUNCTION__);
|
||||
state = ESP_AVRC_INIT_ALREADY;
|
||||
break;
|
||||
}
|
||||
|
||||
if (g_a2dp_on_init) {
|
||||
BTC_TRACE_WARNING("AVRC Target is expected to be initialized in advance of A2DP !!!");
|
||||
}
|
||||
}
|
||||
/// initialize CT-TG shared resources
|
||||
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
|
||||
if (g_a2dp_on_init) {
|
||||
BTC_TRACE_WARNING("AVRC Target is expected to be initialized in advance of A2DP !!!");
|
||||
state = ESP_AVRC_INIT_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
s_rc_tg_init = BTC_RC_TG_INIT_MAGIC;
|
||||
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb));
|
||||
|
||||
if (!g_av_with_rc) {
|
||||
g_av_with_rc = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// initialize TG-specific resources
|
||||
memcpy(s_psth_supported_cmd, cs_psth_dft_supported_cmd, sizeof(s_psth_supported_cmd));
|
||||
s_rn_supported_evt = cs_rn_dft_supported_evt;
|
||||
|
||||
s_rc_tg_init = BTC_RC_TG_INIT_MAGIC;
|
||||
} while (0);
|
||||
|
||||
esp_avrc_tg_cb_param_t param = {0};
|
||||
param.avrc_tg_init_stat.state = state;
|
||||
btc_avrc_tg_cb_to_app(ESP_AVRC_TG_PROF_STATE_EVT, ¶m);
|
||||
}
|
||||
|
||||
|
||||
@ -1512,31 +1536,40 @@ static void btc_avrc_tg_init(void)
|
||||
***************************************************************************/
|
||||
static void btc_avrc_tg_deinit(void)
|
||||
{
|
||||
esp_avrc_init_state_t state = ESP_AVRC_DEINIT_SUCCESS;
|
||||
|
||||
BTC_TRACE_API("## %s ##", __FUNCTION__);
|
||||
|
||||
if (g_a2dp_on_deinit) {
|
||||
BTC_TRACE_WARNING("A2DP already deinit, AVRC TG should deinit in advance of A2DP !!!");
|
||||
}
|
||||
|
||||
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
|
||||
BTC_TRACE_WARNING("%s not initialized", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
/// deinit TG-specific resources
|
||||
memset(s_psth_supported_cmd, 0, sizeof(s_psth_supported_cmd));
|
||||
s_rn_supported_evt = 0;
|
||||
s_rc_tg_init = 0;
|
||||
|
||||
/// deinit CT-TG shared resources
|
||||
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
|
||||
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb));
|
||||
if (g_av_with_rc) {
|
||||
g_av_with_rc = false;
|
||||
do {
|
||||
if (g_a2dp_on_deinit) {
|
||||
BTC_TRACE_WARNING("A2DP already deinit, AVRC TG should deinit in advance of A2DP !!!");
|
||||
}
|
||||
}
|
||||
|
||||
BTC_TRACE_API("## %s ## completed", __FUNCTION__);
|
||||
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
|
||||
BTC_TRACE_WARNING("%s not initialized", __FUNCTION__);
|
||||
state = ESP_AVRC_DEINIT_ALREADY;
|
||||
break;
|
||||
}
|
||||
|
||||
/// deinit TG-specific resources
|
||||
memset(s_psth_supported_cmd, 0, sizeof(s_psth_supported_cmd));
|
||||
s_rn_supported_evt = 0;
|
||||
s_rc_tg_init = 0;
|
||||
|
||||
/// deinit CT-TG shared resources
|
||||
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
|
||||
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb));
|
||||
if (g_av_with_rc) {
|
||||
g_av_with_rc = false;
|
||||
}
|
||||
}
|
||||
|
||||
BTC_TRACE_API("## %s ## completed", __FUNCTION__);
|
||||
} while (0);
|
||||
|
||||
esp_avrc_tg_cb_param_t param = {0};
|
||||
param.avrc_tg_init_stat.state = state;
|
||||
btc_avrc_tg_cb_to_app(ESP_AVRC_TG_PROF_STATE_EVT, ¶m);
|
||||
}
|
||||
|
||||
static void btc_avrc_tg_send_rn_rsp(esp_avrc_rn_event_ids_t event_id, esp_avrc_rn_rsp_t rsp, const esp_avrc_rn_param_t *param)
|
||||
|
@ -467,25 +467,6 @@ static void btc_stop_adv_callback(uint8_t status)
|
||||
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_clear_adv_callback(uint8_t status)
|
||||
{
|
||||
esp_ble_gap_cb_param_t param;
|
||||
bt_status_t ret;
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT;
|
||||
param.adv_clear_cmpl.status = btc_hci_to_esp_status(status);
|
||||
|
||||
ret = btc_transfer_context(&msg, ¶m,
|
||||
sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
|
||||
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
void btc_update_duplicate_exceptional_list_callback(tBTA_STATUS status, uint8_t subcode, uint32_t length, uint8_t *device_info)
|
||||
@ -1406,6 +1387,45 @@ void btc_dtm_stop_callback(void *p1)
|
||||
}
|
||||
#endif // #if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
|
||||
static void btc_ble_set_privacy_mode_callback(UINT8 status)
|
||||
{
|
||||
esp_ble_gap_cb_param_t param;
|
||||
bt_status_t ret;
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT;
|
||||
|
||||
param.set_privacy_mode_cmpl.status = btc_btm_status_to_esp_status(status);
|
||||
|
||||
ret = btc_transfer_context(&msg, ¶m, sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
|
||||
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
static void btc_clear_adv_callback(uint8_t status)
|
||||
{
|
||||
esp_ble_gap_cb_param_t param;
|
||||
bt_status_t ret;
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT;
|
||||
param.adv_clear_cmpl.status = btc_hci_to_esp_status(status);
|
||||
|
||||
ret = btc_transfer_context(&msg, ¶m,
|
||||
sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
|
||||
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_ble_vendor_hci_cmd_complete_callback(tBTA_VSC_CMPL *p_param)
|
||||
{
|
||||
bool param_invalid = false;
|
||||
@ -1442,25 +1462,6 @@ static void btc_ble_vendor_hci_cmd_complete_callback(tBTA_VSC_CMPL *p_param)
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_ble_set_privacy_mode_callback(UINT8 status)
|
||||
{
|
||||
esp_ble_gap_cb_param_t param;
|
||||
bt_status_t ret;
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT;
|
||||
|
||||
param.set_privacy_mode_cmpl.status = btc_btm_status_to_esp_status(status);
|
||||
|
||||
ret = btc_transfer_context(&msg, ¶m, sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
|
||||
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_ble_set_csa_support_callback(UINT8 status)
|
||||
{
|
||||
esp_ble_gap_cb_param_t param;
|
||||
@ -1490,7 +1491,7 @@ static void btc_ble_set_vendor_evt_mask_callback(UINT8 status)
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = ESP_GAP_BLE_SET_VENDOR_EVT_MASK_COMPLETE_EVT;
|
||||
|
||||
param.set_csa_support_cmpl.status = btc_btm_status_to_esp_status(status);
|
||||
param.set_vendor_evt_mask_cmpl.status = btc_btm_status_to_esp_status(status);
|
||||
|
||||
ret = btc_transfer_context(&msg, ¶m, sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
|
||||
|
||||
@ -1504,20 +1505,52 @@ static void btc_ble_vendor_hci_event_callback(UINT8 subevt_code, UINT8 param_len
|
||||
esp_ble_gap_cb_param_t param = {0};
|
||||
bt_status_t ret;
|
||||
btc_msg_t msg = {0};
|
||||
esp_ble_vendor_evt_param_t *evt_param = ¶m.vendor_hci_evt.param;
|
||||
bool copy_param = false;
|
||||
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = ESP_GAP_BLE_VENDOR_HCI_EVT;
|
||||
|
||||
param.vendor_hci_evt.subevt_code = subevt_code;
|
||||
param.vendor_hci_evt.param_len = param_len;
|
||||
param.vendor_hci_evt.param_buf = params;
|
||||
ret = btc_transfer_context(&msg, ¶m, sizeof(esp_ble_gap_cb_param_t), btc_gap_ble_cb_deep_copy, btc_gap_ble_cb_deep_free);
|
||||
param.vendor_hci_evt.param_len = 0;
|
||||
param.vendor_hci_evt.param_buf = NULL;
|
||||
switch (subevt_code) {
|
||||
case BLE_VENDOR_PDU_RECV_EVT:
|
||||
param.vendor_hci_evt.subevt_code = ESP_BLE_VENDOR_PDU_RECV_EVT;
|
||||
STREAM_TO_UINT8(evt_param->pdu_recv.type, params);
|
||||
STREAM_TO_UINT8(evt_param->pdu_recv.handle, params);
|
||||
STREAM_TO_UINT8(evt_param->pdu_recv.addr_type, params);
|
||||
STREAM_TO_BDADDR(evt_param->pdu_recv.peer_addr, params);
|
||||
break;
|
||||
case BLE_VENDOR_CHMAP_UPDATE_EVT:
|
||||
param.vendor_hci_evt.subevt_code = ESP_BLE_VENDOR_CHAN_MAP_UPDATE_EVT;
|
||||
STREAM_TO_UINT8(evt_param->chan_map_update.status, params);
|
||||
STREAM_TO_UINT16(evt_param->chan_map_update.conn_handle, params);
|
||||
REVERSE_STREAM_TO_ARRAY(evt_param->chan_map_update.ch_map, params, ESP_GAP_BLE_CHANNELS_LEN);
|
||||
break;
|
||||
case BLE_VENDOR_SLEEP_WAKEUP_EVT:
|
||||
param.vendor_hci_evt.subevt_code = ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT;
|
||||
// No parameters
|
||||
break;
|
||||
default:
|
||||
copy_param = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (copy_param) {
|
||||
param.vendor_hci_evt.param_len = param_len;
|
||||
param.vendor_hci_evt.param_buf = (param_len) ? params : NULL;
|
||||
ret = btc_transfer_context(&msg, ¶m, sizeof(esp_ble_gap_cb_param_t), btc_gap_ble_cb_deep_copy, btc_gap_ble_cb_deep_free);
|
||||
} else {
|
||||
ret = btc_transfer_context(&msg, ¶m, sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
|
||||
}
|
||||
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
|
||||
void btc_get_whitelist_size(uint16_t *length)
|
||||
{
|
||||
@ -1552,11 +1585,6 @@ static void btc_ble_stop_advertising(tBTA_START_STOP_ADV_CMPL_CBACK *stop_adv_cb
|
||||
|
||||
BTA_DmBleBroadcast(stop_adv, stop_adv_cb);
|
||||
}
|
||||
|
||||
static void btc_ble_clear_advertising(tBTA_CLEAR_ADV_CMPL_CBACK *clear_adv_cb)
|
||||
{
|
||||
BTA_DmBleClearAdv(clear_adv_cb);
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
@ -1899,6 +1927,7 @@ void btc_gap_ble_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
case BTC_GAP_BLE_ACT_VENDOR_HCI_CMD_EVT: {
|
||||
btc_ble_gap_args_t *src = (btc_ble_gap_args_t *)p_src;
|
||||
btc_ble_gap_args_t *dst = (btc_ble_gap_args_t *)p_dest;
|
||||
@ -1912,6 +1941,7 @@ void btc_gap_ble_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
case BTC_GAP_BLE_ACT_SET_DEV_NAME:{
|
||||
btc_ble_gap_args_t *src = (btc_ble_gap_args_t *)p_src;
|
||||
btc_ble_gap_args_t *dst = (btc_ble_gap_args_t *)p_dest;
|
||||
@ -2065,6 +2095,7 @@ void btc_gap_ble_arg_deep_free(btc_msg_t *msg)
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
case BTC_GAP_BLE_ACT_VENDOR_HCI_CMD_EVT: {
|
||||
uint8_t *p_param_buf = ((btc_ble_gap_args_t *)msg->arg)->vendor_cmd_send.p_param_buf;
|
||||
if (p_param_buf) {
|
||||
@ -2072,6 +2103,7 @@ void btc_gap_ble_arg_deep_free(btc_msg_t *msg)
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
case BTC_GAP_BLE_ACT_SET_DEV_NAME:{
|
||||
char *p_name = ((btc_ble_gap_args_t *)msg->arg)->set_dev_name.device_name;
|
||||
if (p_name) {
|
||||
@ -2156,9 +2188,6 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
|
||||
case BTC_GAP_BLE_ACT_STOP_ADV:
|
||||
btc_ble_stop_advertising(btc_stop_adv_callback);
|
||||
break;
|
||||
case BTC_GAP_BLE_ACT_CLEAR_ADV:
|
||||
btc_ble_clear_advertising(btc_clear_adv_callback);
|
||||
break;
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
case BTC_GAP_BLE_ACT_UPDATE_CONN_PARAM:
|
||||
@ -2618,22 +2647,27 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
|
||||
btc_ble_dtm_enhance_rx_start(arg_5->dtm_enh_rx_start.rx_channel, arg_5->dtm_enh_rx_start.phy, arg_5->dtm_enh_rx_start.modulation_index, btc_dtm_rx_start_callback);
|
||||
break;
|
||||
#endif // #if (BLE_50_DTM_TEST_EN == TRUE)
|
||||
case BTC_GAP_BLE_SET_PRIVACY_MODE:
|
||||
btc_ble_set_privacy_mode(arg->set_privacy_mode.addr_type, arg->set_privacy_mode.addr,
|
||||
arg->set_privacy_mode.privacy_mode, btc_ble_set_privacy_mode_callback);
|
||||
break;
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
case BTC_GAP_BLE_ACT_CLEAR_ADV:
|
||||
BTA_DmBleClearAdv(btc_clear_adv_callback);
|
||||
break;
|
||||
case BTC_GAP_BLE_ACT_VENDOR_HCI_CMD_EVT:
|
||||
BTA_DmsendVendorHciCmd(arg->vendor_cmd_send.opcode,
|
||||
arg->vendor_cmd_send.param_len,
|
||||
arg->vendor_cmd_send.p_param_buf,
|
||||
btc_ble_vendor_hci_cmd_complete_callback);
|
||||
break;
|
||||
case BTC_GAP_BLE_SET_PRIVACY_MODE:
|
||||
btc_ble_set_privacy_mode(arg->set_privacy_mode.addr_type, arg->set_privacy_mode.addr,
|
||||
arg->set_privacy_mode.privacy_mode, btc_ble_set_privacy_mode_callback);
|
||||
break;
|
||||
case BTC_GAP_BLE_SET_CSA_SUPPORT:
|
||||
BTA_DmBleGapSetCsaSupport(arg->set_csa_support.csa_select, btc_ble_set_csa_support_callback);
|
||||
break;
|
||||
case BTC_GAP_BLE_ACT_SET_VENDOR_EVT_MASK:
|
||||
BTA_DmBleGapSetVendorEventMask(arg->set_vendor_evt_mask.evt_mask, btc_ble_set_vendor_evt_mask_callback);
|
||||
break;
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
case BTC_GAP_BLE_ENH_READ_TRANS_POWER_LEVEL:
|
||||
BTA_DmBleGapEnhReadTransPwrLevel(arg_5->enh_read_trans_pwr_level.conn_handle, arg_5->enh_read_trans_pwr_level.phy);
|
||||
@ -2682,7 +2716,9 @@ void btc_gap_callback_init(void)
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
BTM_BleGapRegisterCallback(btc_ble_5_gap_callback);
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
BTM_BleRegisterVendorHciEventCallback(btc_ble_vendor_hci_event_callback);
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
}
|
||||
|
||||
bool btc_gap_ble_init(void)
|
||||
|
@ -24,6 +24,10 @@ extern tBTA_BLE_ADV_DATA *gl_bta_scan_rsp_data_ptr;
|
||||
|
||||
#define BLE_ISVALID_PARAM(x, min, max) (((x) >= (min) && (x) <= (max)))
|
||||
|
||||
#define BLE_VENDOR_PDU_RECV_EVT (0xC0)
|
||||
#define BLE_VENDOR_CHMAP_UPDATE_EVT (0xC1)
|
||||
#define BLE_VENDOR_SLEEP_WAKEUP_EVT (0xC3)
|
||||
|
||||
typedef enum {
|
||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
BTC_GAP_BLE_ACT_CFG_ADV_DATA = 0,
|
||||
@ -113,15 +117,15 @@ typedef enum {
|
||||
BTC_GAP_BLE_DTM_RX_START,
|
||||
#endif // #if (BLE_42_DTM_TEST_EN == TRUE)
|
||||
BTC_GAP_BLE_DTM_STOP,
|
||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
BTC_GAP_BLE_ACT_CLEAR_ADV,
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
BTC_GAP_BLE_ACT_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT,
|
||||
BTC_GAP_BLE_ACT_ADD_DEVICE_TO_RESOLVING_LIST,
|
||||
BTC_GAP_BLE_ACT_VENDOR_HCI_CMD_EVT,
|
||||
BTC_GAP_BLE_SET_PRIVACY_MODE,
|
||||
BTC_GAP_BLE_SET_CSA_SUPPORT,
|
||||
BTC_GAP_BLE_ACT_SET_VENDOR_EVT_MASK,
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
BTC_GAP_BLE_ACT_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT,
|
||||
BTC_GAP_BLE_ACT_ADD_DEVICE_TO_RESOLVING_LIST,
|
||||
BTC_GAP_BLE_SET_PRIVACY_MODE,
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
BTC_GAP_BLE_ENH_READ_TRANS_POWER_LEVEL,
|
||||
BTC_GAP_BLE_READ_REM_TRANS_POWER_LEVEL,
|
||||
|
@ -364,6 +364,12 @@
|
||||
#define UC_BT_BLE_FEAT_CONN_SUBRATING FALSE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_BLE_VENDOR_HCI_EN
|
||||
#define UC_BT_BLE_VENDOR_HCI_EN CONFIG_BT_BLE_VENDOR_HCI_EN
|
||||
#else
|
||||
#define UC_BT_BLE_VENDOR_HCI_EN FALSE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL
|
||||
#define UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL
|
||||
#else
|
||||
|
@ -415,6 +415,12 @@
|
||||
#define BLE_FEAT_CONN_SUBRATING FALSE
|
||||
#endif
|
||||
|
||||
#if (UC_BT_BLE_VENDOR_HCI_EN == TRUE)
|
||||
#define BLE_VENDOR_HCI_EN TRUE
|
||||
#else
|
||||
#define BLE_VENDOR_HCI_EN FALSE
|
||||
#endif
|
||||
|
||||
#if (UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL == TRUE)
|
||||
#define BLE_HIGH_DUTY_ADV_INTERVAL TRUE
|
||||
#else
|
||||
|
@ -223,12 +223,10 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
#if (BT_BLE_LOG_SPI_OUT_HOST_ENABLED && !CLASSIC_BT_INCLUDED)
|
||||
|
||||
#define BTM_TRACE_ERROR(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_ERROR, "BT_BTM", fmt, ## args); \
|
||||
if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR && BT_LOG_LEVEL_CHECK(BTM, ERROR)) BT_PRINT_E("BT_BTM", fmt, ## args); \
|
||||
}
|
||||
|
||||
#define BTM_TRACE_WARNING(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_WARN, "BT_BTM", fmt, ## args); \
|
||||
if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING && BT_LOG_LEVEL_CHECK(BTM, WARNING)) BT_PRINT_W("BT_BTM", fmt, ## args); \
|
||||
}
|
||||
|
||||
@ -243,7 +241,6 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
}
|
||||
|
||||
#define BTM_TRACE_DEBUG(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_BTM", fmt, ## args); \
|
||||
if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG && BT_LOG_LEVEL_CHECK(BTM, DEBUG)) BT_PRINT_D("BT_BTM", fmt, ## args); \
|
||||
}
|
||||
|
||||
@ -262,12 +259,10 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
#if (BT_BLE_LOG_SPI_OUT_HOST_ENABLED && !CLASSIC_BT_INCLUDED)
|
||||
|
||||
#define L2CAP_TRACE_ERROR(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_ERROR, "BT_L2CAP", fmt, ## args); \
|
||||
if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR && BT_LOG_LEVEL_CHECK(L2CAP, ERROR)) BT_PRINT_E("BT_L2CAP", fmt, ## args); \
|
||||
}
|
||||
|
||||
#define L2CAP_TRACE_WARNING(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_WARN, "BT_L2CAP", fmt, ## args); \
|
||||
if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING && BT_LOG_LEVEL_CHECK(L2CAP, WARNING)) BT_PRINT_W("BT_L2CAP", fmt, ## args); \
|
||||
}
|
||||
|
||||
@ -277,12 +272,10 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
}
|
||||
|
||||
#define L2CAP_TRACE_EVENT(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_L2CAP", fmt, ## args); \
|
||||
if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT && BT_LOG_LEVEL_CHECK(L2CAP, EVENT)) BT_PRINT_D("BT_L2CAP", fmt, ## args); \
|
||||
}
|
||||
|
||||
#define L2CAP_TRACE_DEBUG(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_L2CAP", fmt, ## args); \
|
||||
if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG && BT_LOG_LEVEL_CHECK(L2CAP, DEBUG)) BT_PRINT_D("BT_L2CAP", fmt, ## args); \
|
||||
}
|
||||
|
||||
@ -317,12 +310,10 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
#if (BT_BLE_LOG_SPI_OUT_HOST_ENABLED && !CLASSIC_BT_INCLUDED)
|
||||
|
||||
#define GAP_TRACE_ERROR(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_ERROR, "BT_GAP", fmt, ## args); \
|
||||
if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR && BT_LOG_LEVEL_CHECK(GAP, ERROR)) BT_PRINT_E("BT_GAP", fmt, ## args); \
|
||||
}
|
||||
|
||||
#define GAP_TRACE_WARNING(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_WARN, "BT_GAP", fmt, ## args); \
|
||||
if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING && BT_LOG_LEVEL_CHECK(GAP, WARNING)) BT_PRINT_W("BT_GAP", fmt, ## args); \
|
||||
}
|
||||
|
||||
@ -332,7 +323,6 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
}
|
||||
|
||||
#define GAP_TRACE_EVENT(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_GAP", fmt, ## args); \
|
||||
if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT && BT_LOG_LEVEL_CHECK(GAP, EVENT)) BT_PRINT_D("BT_GAP", fmt, ## args); \
|
||||
}
|
||||
|
||||
@ -450,12 +440,10 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
#if (BT_BLE_LOG_SPI_OUT_HOST_ENABLED && !CLASSIC_BT_INCLUDED)
|
||||
|
||||
#define GATT_TRACE_ERROR(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_ERROR, "BT_GATT", fmt, ## args); \
|
||||
if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR && BT_LOG_LEVEL_CHECK(GATT, ERROR)) BT_PRINT_E("BT_GATT", fmt, ## args); \
|
||||
}
|
||||
|
||||
#define GATT_TRACE_WARNING(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_WARN, "BT_GATT", fmt, ## args); \
|
||||
if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING && BT_LOG_LEVEL_CHECK(GATT, WARNING)) BT_PRINT_W("BT_GATT", fmt, ## args); \
|
||||
}
|
||||
|
||||
@ -465,12 +453,10 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
}
|
||||
|
||||
#define GATT_TRACE_EVENT(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_GATT", fmt, ## args); \
|
||||
if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT && BT_LOG_LEVEL_CHECK(GATT, EVENT)) BT_PRINT_D("BT_GATT", fmt, ## args); \
|
||||
}
|
||||
|
||||
#define GATT_TRACE_DEBUG(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_GATT", fmt, ## args); \
|
||||
if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG && BT_LOG_LEVEL_CHECK(GATT, DEBUG)) BT_PRINT_D("BT_GATT", fmt, ## args); \
|
||||
}
|
||||
|
||||
@ -489,12 +475,10 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
#if (BT_BLE_LOG_SPI_OUT_HOST_ENABLED && !CLASSIC_BT_INCLUDED)
|
||||
|
||||
#define SMP_TRACE_ERROR(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_ERROR, "BT_SMP", fmt, ## args); \
|
||||
if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR && BT_LOG_LEVEL_CHECK(SMP, ERROR)) BT_PRINT_E("BT_SMP", fmt, ## args); \
|
||||
}
|
||||
|
||||
#define SMP_TRACE_WARNING(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_WARN, "BT_SMP", fmt, ## args); \
|
||||
if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING && BT_LOG_LEVEL_CHECK(SMP, WARNING)) BT_PRINT_W("BT_SMP", fmt, ## args); \
|
||||
}
|
||||
|
||||
@ -504,12 +488,10 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
}
|
||||
|
||||
#define SMP_TRACE_EVENT(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_SMP", fmt, ## args); \
|
||||
if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT && BT_LOG_LEVEL_CHECK(SMP, EVENT)) BT_PRINT_D("BT_SMP", fmt, ## args); \
|
||||
}
|
||||
|
||||
#define SMP_TRACE_DEBUG(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_SMP", fmt, ## args); \
|
||||
if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG && BT_LOG_LEVEL_CHECK(SMP, DEBUG)) BT_PRINT_D("BT_SMP", fmt, ## args); \
|
||||
}
|
||||
|
||||
|
@ -2946,7 +2946,7 @@ uint8_t btm_ble_scan_active_count(void)
|
||||
}
|
||||
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
uint8_t btm_ble_sec_dev_active_count(void)
|
||||
uint8_t btm_ble_sec_dev_record_count(void)
|
||||
{
|
||||
tBTM_SEC_DEV_REC *p_dev_rec = NULL;
|
||||
list_node_t *p_node = NULL;
|
||||
@ -2962,6 +2962,12 @@ uint8_t btm_ble_sec_dev_active_count(void)
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
void btm_ble_clear_sec_dev_record(void)
|
||||
{
|
||||
/* only used when connection is closed */
|
||||
if(btm_cb.p_sec_dev_rec_list) list_clear(btm_cb.p_sec_dev_rec_list);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (BLE_PRIVACY_SPT == TRUE)
|
||||
|
@ -613,6 +613,7 @@ tBTM_STATUS BTM_BleStartExtAdvRestart(uint8_t con_handle)
|
||||
}
|
||||
|
||||
if((index >= MAX_BLE_ADV_INSTANCE) || (!adv_record[index].invalid)) {
|
||||
BTM_TRACE_WARNING("%s failed to find extend adv, adv_handle %u con_handle %u", __func__, index, con_handle);
|
||||
return BTM_WRONG_MODE;
|
||||
}
|
||||
|
||||
@ -1254,7 +1255,7 @@ void btm_ble_adv_set_terminated_evt(tBTM_BLE_ADV_TERMINAT *params)
|
||||
}
|
||||
|
||||
// adv terminated due to connection, save the adv handle and connection handle
|
||||
if(params->completed_event == 0x00) {
|
||||
if(params->status == 0x00) {
|
||||
adv_record[params->adv_handle].ter_con_handle = params->conn_handle;
|
||||
} else {
|
||||
adv_record[params->adv_handle].ter_con_handle = INVALID_VALUE;
|
||||
|
@ -201,7 +201,12 @@ BOOLEAN btm_add_dev_to_controller (BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_TY
|
||||
|
||||
/* Controller do not support resolvable address now, only support public address and static random address */
|
||||
BOOLEAN started = FALSE;
|
||||
if(wl_addr_type > BLE_ADDR_RANDOM) {
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
if (wl_addr_type > BLE_ADDR_RANDOM && wl_addr_type != BLE_ADDR_ANONYMOUS)
|
||||
#else
|
||||
if (wl_addr_type > BLE_ADDR_RANDOM)
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
{
|
||||
BTM_TRACE_ERROR("wl_addr_type is error\n");
|
||||
return started;
|
||||
}
|
||||
@ -278,7 +283,12 @@ void btm_enq_wl_dev_operation(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_TYPE ad
|
||||
*******************************************************************************/
|
||||
BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type, tBTM_UPDATE_WHITELIST_CBACK *update_wl_cb)
|
||||
{
|
||||
if(addr_type > BLE_ADDR_RANDOM) {
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
if (addr_type > BLE_ADDR_RANDOM && addr_type != BLE_ADDR_ANONYMOUS)
|
||||
#else
|
||||
if (addr_type > BLE_ADDR_RANDOM)
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
{
|
||||
BTM_TRACE_ERROR("%s address type is error, unable to add device", __func__);
|
||||
if (update_wl_cb){
|
||||
update_wl_cb(HCI_ERR_ILLEGAL_PARAMETER_FMT,to_add);
|
||||
|
@ -72,7 +72,9 @@ static tBTM_BLE_CTRL_FEATURES_CBACK *p_ctrl_le_feature_rd_cmpl_cback = NULL;
|
||||
|
||||
tBTM_CallbackFunc conn_callback_func;
|
||||
// BLE vendor HCI event callback
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
static tBTM_BLE_VENDOR_HCI_EVT_CBACK *ble_vs_evt_callback = NULL;
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
** Local functions
|
||||
*******************************************************************************/
|
||||
@ -353,10 +355,12 @@ void BTM_BleRegiseterPktLengthChangeCallback(tBTM_SET_PKT_DATA_LENGTH_CBACK *ptk
|
||||
conn_callback_func.set_pkt_data_length_cb = ptk_len_chane_cb;
|
||||
}
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
void BTM_BleRegisterVendorHciEventCallback(tBTM_BLE_VENDOR_HCI_EVT_CBACK *vendor_hci_evt_cb)
|
||||
{
|
||||
ble_vs_evt_callback = vendor_hci_evt_cb;
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@ -4548,6 +4552,7 @@ BOOLEAN btm_ble_update_mode_operation(UINT8 link_role, BD_ADDR bd_addr, UINT8 st
|
||||
return bg_con;
|
||||
}
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
static void btm_ble_vs_evt_callback(UINT8 len, UINT8 *p)
|
||||
{
|
||||
UINT8 sub_event;
|
||||
@ -4559,7 +4564,7 @@ static void btm_ble_vs_evt_callback(UINT8 len, UINT8 *p)
|
||||
STREAM_TO_UINT8(sub_event, p);
|
||||
len--;
|
||||
|
||||
if (sub_event < HCI_VSE_LE_LEGACY_SCAN_REQ_RECEIVED_EVT) {
|
||||
if (sub_event < HCI_VSE_LE_SUBEVT_BASE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -4567,6 +4572,7 @@ static void btm_ble_vs_evt_callback(UINT8 len, UINT8 *p)
|
||||
ble_vs_evt_callback(sub_event, len, p);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@ -4626,8 +4632,9 @@ void btm_ble_init (void)
|
||||
btm_ble_adv_filter_init();
|
||||
#endif // #if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
|
||||
#endif
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
BTM_RegisterForVSEvents(btm_ble_vs_evt_callback, TRUE);
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
@ -4754,6 +4761,7 @@ BOOLEAN BTM_Ble_Authorization(BD_ADDR bd_addr, BOOLEAN authorize)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleClearAdv
|
||||
@ -4775,6 +4783,30 @@ BOOLEAN BTM_BleClearAdv(tBTM_CLEAR_ADV_CMPL_CBACK *p_clear_adv_cback)
|
||||
p_cb->inq_var.p_clear_adv_cb = p_clear_adv_cback;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOLEAN BTM_BleSetCsaSupport(UINT8 csa_select, tBTM_SET_CSA_SUPPORT_CMPL_CBACK *p_callback)
|
||||
{
|
||||
if (btsnd_hcic_ble_set_csa_support(csa_select) != TRUE) {
|
||||
BTM_TRACE_ERROR("LE SetCsaSupport csa_select=%d: error", csa_select);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
btm_cb.ble_ctr_cb.set_csa_support_cmpl_cb = p_callback;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOLEAN BTM_BleSetVendorEventMask(UINT32 evt_mask, tBTM_SET_VENDOR_EVT_MASK_CBACK *p_callback)
|
||||
{
|
||||
if (btsnd_hcic_ble_set_vendor_evt_mask(evt_mask) != TRUE) {
|
||||
BTM_TRACE_ERROR("LE SetVendorEventMask evt_mask=%x: error", evt_mask);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
btm_cb.ble_ctr_cb.set_vendor_evt_mask_cmpl_cb = p_callback;
|
||||
return TRUE;
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
|
||||
BOOLEAN BTM_BleSetRpaTimeout(uint16_t rpa_timeout,tBTM_SET_RPA_TIMEOUT_CMPL_CBACK *p_set_rpa_timeout_cback)
|
||||
{
|
||||
if ((btsnd_hcic_ble_set_rand_priv_addr_timeout(rpa_timeout)) != TRUE) {
|
||||
@ -4810,28 +4842,6 @@ BOOLEAN BTM_BleSetPrivacyMode(UINT8 addr_type, BD_ADDR bd_addr, UINT8 privacy_mo
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOLEAN BTM_BleSetCsaSupport(UINT8 csa_select, tBTM_SET_CSA_SUPPORT_CMPL_CBACK *p_callback)
|
||||
{
|
||||
if (btsnd_hcic_ble_set_csa_support(csa_select) != TRUE) {
|
||||
BTM_TRACE_ERROR("LE SetCsaSupport csa_select=%d: error", csa_select);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
btm_cb.ble_ctr_cb.set_csa_support_cmpl_cb = p_callback;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOLEAN BTM_BleSetVendorEventMask(UINT32 evt_mask, tBTM_SET_VENDOR_EVT_MASK_CBACK *p_callback)
|
||||
{
|
||||
if (btsnd_hcic_ble_set_vendor_evt_mask(evt_mask) != TRUE) {
|
||||
BTM_TRACE_ERROR("LE SetVendorEventMask evt_mask=%x: error", evt_mask);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
btm_cb.ble_ctr_cb.set_vendor_evt_mask_cmpl_cb = p_callback;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
bool btm_ble_adv_pkt_ready(void)
|
||||
{
|
||||
|
@ -187,8 +187,10 @@ BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr, tBT_TRANSPORT transport)
|
||||
}
|
||||
|
||||
if ((p_dev_rec = btm_find_dev(bd_addr)) != NULL) {
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/* Tell controller to get rid of the link key, if it has one stored */
|
||||
BTM_DeleteStoredLinkKey (p_dev_rec->bd_addr, NULL);
|
||||
#endif // (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
btm_sec_free_dev(p_dev_rec, transport);
|
||||
}
|
||||
|
@ -1149,6 +1149,7 @@ tBTM_STATUS BTM_EnableTestMode(void)
|
||||
}
|
||||
#endif // #if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_DeleteStoredLinkKey
|
||||
@ -1223,6 +1224,7 @@ void btm_delete_stored_link_key_complete (UINT8 *p)
|
||||
}
|
||||
}
|
||||
|
||||
#endif // (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_report_device_status
|
||||
|
@ -612,12 +612,12 @@ static tBTM_STATUS btm_send_connect_request(UINT16 acl_handle,
|
||||
** If so, we cannot use SCO-only packet types (HFP 1.7)
|
||||
*/
|
||||
if (BTM_BothEndsSupportSecureConnections(p_acl->remote_addr)) {
|
||||
temp_pkt_types &= ~(BTM_SCO_PKT_TYPE_MASK);
|
||||
temp_pkt_types &= ~(BTM_SCO_LINK_ONLY_MASK);
|
||||
BTM_TRACE_DEBUG("%s: SCO Conn: pkt_types after removing SCO (0x%04x)", __FUNCTION__,
|
||||
temp_pkt_types);
|
||||
|
||||
/* Return error if no packet types left */
|
||||
if (temp_pkt_types == 0) {
|
||||
if (temp_pkt_types == BTM_SCO_EXCEPTION_PKTS_MASK) {
|
||||
BTM_TRACE_ERROR("%s: SCO Conn (BR/EDR SC): No packet types available",__FUNCTION__);
|
||||
return (BTM_WRONG_MODE);
|
||||
}
|
||||
|
@ -1001,12 +1001,12 @@ tBTM_STATUS btm_sec_bond_by_transport (BD_ADDR bd_addr, tBT_TRANSPORT transport,
|
||||
return (BTM_SUCCESS);
|
||||
}
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/* Tell controller to get rid of the link key if it has one stored */
|
||||
if ((BTM_DeleteStoredLinkKey (bd_addr, NULL)) != BTM_SUCCESS) {
|
||||
return (BTM_NO_RESOURCES);
|
||||
}
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/* Save the PIN code if we got a valid one */
|
||||
if (p_pin && (pin_len <= PIN_CODE_LEN) && (pin_len != 0)) {
|
||||
btm_cb.pin_code_len = pin_len;
|
||||
|
@ -1088,27 +1088,6 @@ BOOLEAN btsnd_hcic_ble_set_channels (BLE_CHANNELS channels)
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN btsnd_hcic_ble_clear_adv (void)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
if ((p = HCI_GET_CMD_BUF (HCIC_PARAM_SIZE_BLE_CLEAR_ADV)) == NULL) {
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_CLEAR_ADV;
|
||||
p->offset = 0;
|
||||
|
||||
UINT16_TO_STREAM (pp, HCI_VENDOR_BLE_CLEAR_ADV);
|
||||
UINT8_TO_STREAM (pp, HCIC_PARAM_SIZE_BLE_CLEAR_ADV);
|
||||
|
||||
btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#define HCIC_BLE_CMD_CREATED(p, pp, size) do{\
|
||||
if ((p = HCI_GET_CMD_BUF(size)) == NULL) { \
|
||||
return FALSE; \
|
||||
@ -1948,6 +1927,28 @@ BOOLEAN btsnd_hcic_ble_set_privacy_mode(UINT8 addr_type, BD_ADDR addr, UINT8 pri
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
BOOLEAN btsnd_hcic_ble_clear_adv (void)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
if ((p = HCI_GET_CMD_BUF (HCIC_PARAM_SIZE_BLE_CLEAR_ADV)) == NULL) {
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_CLEAR_ADV;
|
||||
p->offset = 0;
|
||||
|
||||
UINT16_TO_STREAM (pp, HCI_VENDOR_BLE_CLEAR_ADV);
|
||||
UINT8_TO_STREAM (pp, HCIC_PARAM_SIZE_BLE_CLEAR_ADV);
|
||||
|
||||
btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOLEAN btsnd_hcic_ble_set_csa_support (UINT8 csa_select)
|
||||
{
|
||||
BT_HDR *p;
|
||||
@ -1991,6 +1992,7 @@ BOOLEAN btsnd_hcic_ble_set_vendor_evt_mask (UINT32 evt_mask)
|
||||
btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return TRUE;
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
#endif
|
||||
|
||||
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||
|
@ -486,6 +486,7 @@ typedef struct {
|
||||
#define BLE_ADDR_RANDOM_ID 0x03
|
||||
#define BLE_ADDR_TYPE_MAX BLE_ADDR_RANDOM_ID
|
||||
#define BLE_ADDR_UNKNOWN_TYPE 0XFF
|
||||
#define BLE_ADDR_ANONYMOUS 0xFF
|
||||
typedef UINT8 tBLE_ADDR_TYPE;
|
||||
#define BLE_ADDR_TYPE_MASK (BLE_ADDR_RANDOM | BLE_ADDR_PUBLIC)
|
||||
|
||||
|
@ -139,7 +139,7 @@ typedef UINT16 tGATT_DISCONN_REASON;
|
||||
/* max length of an attribute value
|
||||
*/
|
||||
#ifndef GATT_MAX_ATTR_LEN
|
||||
#define GATT_MAX_ATTR_LEN 512
|
||||
#define GATT_MAX_ATTR_LEN GATT_MAX_MTU_SIZE
|
||||
#endif
|
||||
|
||||
/* default GATT MTU size over LE link
|
||||
|
@ -927,9 +927,9 @@
|
||||
#define HCI_VENDOR_CH_CLASSIFICATION_EVT_SUBCODE 0x06
|
||||
#define HCI_VENDOR_CH_CLASSIFICATION_REPORTING_MODE_EVT_SUBCODE 0x07
|
||||
|
||||
#define HCI_VSE_LE_LEGACY_SCAN_REQ_RECEIVED_EVT 0xC0
|
||||
#define HCI_VSE_LE_CHAN_MAP_UPDATE_CMPL_EVT 0xC1
|
||||
#define HCI_VSE_LE_EVT_MAX 0xFF
|
||||
#define HCI_VENDOR_SPECIFIC_EVT 0xFF /* Vendor specific events */
|
||||
#define HCI_VSE_LE_SUBEVT_BASE 0xC0 /* BLE vendor event code base */
|
||||
#define HCI_VSE_LE_EVT_MAX 0xFF /* BLE vendor event code max */
|
||||
#define HCI_NAP_TRACE_EVT 0xFF /* was define 0xFE, 0xFD, change to 0xFF
|
||||
because conflict w/ TCI_EVT and per
|
||||
specification compliant */
|
||||
|
@ -480,6 +480,8 @@ BOOLEAN l2c_link_hci_disc_comp (UINT16 handle, UINT8 reason)
|
||||
if (l2cu_create_conn(p_lcb, BT_TRANSPORT_LE)) {
|
||||
btm_acl_removed (p_lcb->remote_bd_addr, BT_TRANSPORT_LE);
|
||||
lcb_is_free = FALSE; /* still using this lcb */
|
||||
} else {
|
||||
L2CAP_TRACE_ERROR("master retry connect failed");
|
||||
}
|
||||
}
|
||||
#endif // (GATTC_CONNECT_RETRY_EN == TRUE)
|
||||
@ -489,7 +491,10 @@ BOOLEAN l2c_link_hci_disc_comp (UINT16 handle, UINT8 reason)
|
||||
if(btm_ble_inter_get() && p_lcb->link_role == HCI_ROLE_SLAVE) {
|
||||
p_lcb->retry_create_con ++;
|
||||
L2CAP_TRACE_DEBUG("slave restart extend adv, retry count %d reason 0x%x\n", p_lcb->retry_create_con, reason);
|
||||
BTM_BleStartExtAdvRestart(handle);
|
||||
tBTM_STATUS start_adv_status = BTM_BleStartExtAdvRestart(handle);
|
||||
if (start_adv_status != BTM_SUCCESS) {
|
||||
L2CAP_TRACE_ERROR("slave restart extend adv failed (err 0x%x)", start_adv_status);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
@ -499,7 +504,10 @@ BOOLEAN l2c_link_hci_disc_comp (UINT16 handle, UINT8 reason)
|
||||
if(!btm_ble_inter_get() && p_lcb->link_role == HCI_ROLE_SLAVE) {
|
||||
p_lcb->retry_create_con ++;
|
||||
L2CAP_TRACE_DEBUG("slave resatrt adv, retry count %d reason 0x%x\n", p_lcb->retry_create_con, reason);
|
||||
btm_ble_start_adv();
|
||||
tBTM_STATUS start_adv_status = btm_ble_start_adv();
|
||||
if (start_adv_status != BTM_SUCCESS) {
|
||||
L2CAP_TRACE_ERROR("slave resatrt adv failed (err 0x%x)", start_adv_status);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
@ -1084,7 +1092,9 @@ void l2c_link_check_send_pkts (tL2C_LCB *p_lcb, tL2C_CCB *p_ccb, BT_HDR *p_buf)
|
||||
p_lcb_cur = list_node(p_node);
|
||||
if (p_lcb_cur == p_lcb) {
|
||||
p_node = list_next(p_node);
|
||||
p_lcb = list_node(p_node);
|
||||
if (p_node) {
|
||||
p_lcb = list_node(p_node);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1553,7 +1553,7 @@ void smp_fast_conn_param(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
|
||||
}
|
||||
/* Disable L2CAP connection parameter updates while bonding since
|
||||
some peripherals are not able to revert to fast connection parameters
|
||||
during the start of service discovery. Connection paramter updates
|
||||
during the start of service discovery. Connection parameter updates
|
||||
get enabled again once service discovery completes. */
|
||||
#if (BT_MULTI_CONNECTION_ENBALE == FALSE)
|
||||
L2CA_EnableUpdateBleConnParams(p_cb->pairing_bda, FALSE);
|
||||
@ -1648,6 +1648,8 @@ void smp_process_local_nonce(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
|
||||
/* slave calculates and sends local commitment */
|
||||
smp_calculate_local_commitment(p_cb);
|
||||
smp_send_commitment(p_cb, NULL);
|
||||
/* Ensure the connection is still active */
|
||||
if (smp_get_state() == SMP_STATE_IDLE) return;
|
||||
/* slave has to wait for peer nonce */
|
||||
smp_set_state(SMP_STATE_WAIT_NONCE);
|
||||
} else { /* i.e. master */
|
||||
@ -1658,6 +1660,8 @@ void smp_process_local_nonce(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
|
||||
p_cb->selected_association_model);
|
||||
p_cb->flags &= ~SMP_PAIR_FLAG_HAVE_PEER_COMM;
|
||||
smp_send_rand(p_cb, NULL);
|
||||
/* Ensure the connection is still active */
|
||||
if (smp_get_state() == SMP_STATE_IDLE) return;
|
||||
smp_set_state(SMP_STATE_WAIT_NONCE);
|
||||
}
|
||||
}
|
||||
@ -1672,6 +1676,8 @@ void smp_process_local_nonce(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
|
||||
if (p_cb->flags & SMP_PAIR_FLAG_HAVE_PEER_COMM) {
|
||||
/* master commitment is already received */
|
||||
smp_send_commitment(p_cb, NULL);
|
||||
/* Ensure the connection is still active */
|
||||
if (smp_get_state() == SMP_STATE_IDLE) return;
|
||||
smp_set_state(SMP_STATE_WAIT_NONCE);
|
||||
}
|
||||
}
|
||||
@ -1679,6 +1685,8 @@ void smp_process_local_nonce(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
|
||||
case SMP_MODEL_SEC_CONN_OOB:
|
||||
if (p_cb->role == HCI_ROLE_MASTER) {
|
||||
smp_send_rand(p_cb, NULL);
|
||||
/* Ensure the connection is still active */
|
||||
if (smp_get_state() == SMP_STATE_IDLE) return;
|
||||
}
|
||||
|
||||
smp_set_state(SMP_STATE_WAIT_NONCE);
|
||||
@ -2002,7 +2010,7 @@ void smp_link_encrypted(BD_ADDR bda, UINT8 encr_enable)
|
||||
SMP_TRACE_DEBUG("%s encr_enable=%d\n", __func__, encr_enable);
|
||||
|
||||
if (memcmp(&smp_cb.pairing_bda[0], bda, BD_ADDR_LEN) == 0) {
|
||||
/* encryption completed with STK, remmeber the key size now, could be overwite
|
||||
/* encryption completed with STK, remember the key size now, could be overwrite
|
||||
* when key exchange happens */
|
||||
if (p_cb->loc_enc_size != 0 && encr_enable) {
|
||||
/* update the link encryption key size if a SMP pairing just performed */
|
||||
|
@ -156,7 +156,7 @@ config BT_NIMBLE_ROLE_BROADCASTER
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
default y
|
||||
help
|
||||
Enables broadcaster role
|
||||
Enables broadcaster role
|
||||
|
||||
config BT_NIMBLE_ROLE_OBSERVER
|
||||
bool "Enable BLE Observer role"
|
||||
@ -165,6 +165,20 @@ config BT_NIMBLE_ROLE_OBSERVER
|
||||
help
|
||||
Enables observer role
|
||||
|
||||
config BT_NIMBLE_GATT_CLIENT
|
||||
bool "Enable BLE GATT Client support"
|
||||
depends on BT_NIMBLE_ROLE_CENTRAL
|
||||
default y
|
||||
help
|
||||
Enables support for GATT Client
|
||||
|
||||
config BT_NIMBLE_GATT_SERVER
|
||||
bool "Enable BLE GATT Server support"
|
||||
depends on BT_NIMBLE_ROLE_PERIPHERAL
|
||||
default y
|
||||
help
|
||||
Enables support for GATT Server
|
||||
|
||||
config BT_NIMBLE_NVS_PERSIST
|
||||
bool "Persist the BLE Bonding keys in NVS"
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
@ -237,6 +251,13 @@ config BT_NIMBLE_SM_SC_ONLY
|
||||
help
|
||||
Enable Secure Connections Only Mode
|
||||
|
||||
config BT_NIMBLE_PRINT_ERR_NAME
|
||||
bool "Enable feature to print Error description"
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
default y
|
||||
help
|
||||
Enable feature to give useful explanation for HCI errors
|
||||
|
||||
config BT_NIMBLE_DEBUG
|
||||
bool "Enable extra runtime asserts and host debugging"
|
||||
default n
|
||||
@ -274,6 +295,13 @@ config BT_NIMBLE_ATT_PREFERRED_MTU
|
||||
This is the default value of ATT MTU indicated by the device during an ATT MTU exchange.
|
||||
This value can be changed using API ble_att_set_preferred_mtu()
|
||||
|
||||
config BT_NIMBLE_ATT_MAX_PREP_ENTRIES
|
||||
int "Max Prepare write entries"
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
default 64
|
||||
help
|
||||
This is the default value of ATT Maximum prepare entries
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEARANCE
|
||||
hex "External appearance of the device"
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
@ -384,7 +412,7 @@ config BT_NIMBLE_GATT_MAX_PROCS
|
||||
|
||||
config BT_NIMBLE_HS_FLOW_CTRL
|
||||
bool "Enable Host Flow control"
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
depends on BT_NIMBLE_ENABLED && !SOC_ESP_NIMBLE_CONTROLLER
|
||||
default y if IDF_TARGET_ESP32
|
||||
default n
|
||||
help
|
||||
@ -600,6 +628,13 @@ if BT_NIMBLE_50_FEATURE_SUPPORT
|
||||
will be supported from BLE 5.0 onwards.
|
||||
|
||||
if BT_NIMBLE_EXT_ADV
|
||||
config BT_NIMBLE_EXT_ADV_V2
|
||||
bool "Enable support for extended adv v2"
|
||||
default n
|
||||
depends on BT_NIMBLE_EXT_ADV
|
||||
help
|
||||
Enable this option to use Extended Adv V2 command instead of V1.
|
||||
|
||||
config BT_NIMBLE_MAX_EXT_ADV_INSTANCES
|
||||
int "Maximum number of extended advertising instances."
|
||||
range 0 4
|
||||
@ -708,6 +743,19 @@ menuconfig BT_NIMBLE_GATT_CACHING
|
||||
select BT_NIMBLE_DYNAMIC_SERVICE
|
||||
help
|
||||
Enable GATT caching
|
||||
config BT_NIMBLE_GATT_CACHING_INCLUDE_SERVICES
|
||||
bool "Include services in GATT caching"
|
||||
depends on BT_NIMBLE_GATT_CACHING
|
||||
default n
|
||||
help
|
||||
Enable this option to include *included services* (e.g., services referenced by other services)
|
||||
in the GATT database cache. Disabling this will skip caching of included service entries.
|
||||
config BT_NIMBLE_INCL_SVC_DISCOVERY
|
||||
bool "Enable Included service discovery"
|
||||
default y if BT_NIMBLE_GATT_CACHING_INCLUDE_SERVICES
|
||||
default n
|
||||
help
|
||||
Enable this option to start discovery for included service.
|
||||
config BT_NIMBLE_GATT_CACHING_MAX_CONNS
|
||||
int "Maximum connections to be cached"
|
||||
depends on BT_NIMBLE_GATT_CACHING
|
||||
@ -720,6 +768,12 @@ config BT_NIMBLE_GATT_CACHING_MAX_SVCS
|
||||
default 64
|
||||
help
|
||||
Set this option to set the upper limit on number of services per connection to be cached.
|
||||
config BT_NIMBLE_GATT_CACHING_MAX_INCL_SVCS
|
||||
int "Maximum number of included services per connection"
|
||||
depends on BT_NIMBLE_GATT_CACHING
|
||||
default 64
|
||||
help
|
||||
Set this option to set the upper limit on number of included services per connection to be cached.
|
||||
config BT_NIMBLE_GATT_CACHING_MAX_CHRS
|
||||
int "Maximum number of characteristics per connection"
|
||||
depends on BT_NIMBLE_GATT_CACHING
|
||||
@ -781,8 +835,172 @@ config BT_NIMBLE_BLE_GATT_BLOB_TRANSFER
|
||||
This option is used when data to be sent is more than 512 bytes. For peripheral role,
|
||||
BT_NIMBLE_MSYS_1_BLOCK_COUNT needs to be increased according to the need.
|
||||
|
||||
menu "GAP Service"
|
||||
menu "BLE Services"
|
||||
depends on BT_NIMBLE_GATT_SERVER
|
||||
|
||||
config BT_NIMBLE_PROX_SERVICE
|
||||
bool "Proximity service"
|
||||
default y
|
||||
help
|
||||
Enable Proximity Service support
|
||||
|
||||
config BT_NIMBLE_ANS_SERVICE
|
||||
bool "Alert Notification service"
|
||||
default y
|
||||
help
|
||||
Enable Alert Notification Service support
|
||||
|
||||
config BT_NIMBLE_CTS_SERVICE
|
||||
bool "Current Time Service"
|
||||
default y
|
||||
help
|
||||
Enable Current Time Service support
|
||||
|
||||
config BT_NIMBLE_HTP_SERVICE
|
||||
bool "Health Thermometer service"
|
||||
default y
|
||||
help
|
||||
Enable Health Thermometer Service support
|
||||
|
||||
config BT_NIMBLE_IPSS_SERVICE
|
||||
bool "Internet Protocol Support service"
|
||||
default y
|
||||
help
|
||||
Enable Internet Protocol Service support
|
||||
|
||||
config BT_NIMBLE_TPS_SERVICE
|
||||
bool "Tx Power service"
|
||||
default y
|
||||
help
|
||||
Enable Tx Power Service support
|
||||
|
||||
config BT_NIMBLE_IAS_SERVICE
|
||||
bool "Immediate Alert service"
|
||||
default y
|
||||
help
|
||||
Enable Immediate Alert Service support
|
||||
|
||||
config BT_NIMBLE_LLS_SERVICE
|
||||
bool "Link Loss service"
|
||||
default y
|
||||
help
|
||||
Enable Link Loss Service support
|
||||
|
||||
config BT_NIMBLE_SPS_SERVICE
|
||||
bool "Serial Port service"
|
||||
default y
|
||||
help
|
||||
Enable Serial Port Service support
|
||||
|
||||
config BT_NIMBLE_HR_SERVICE
|
||||
bool "Heart Rate service"
|
||||
default y
|
||||
help
|
||||
Enable HeartRate Service support
|
||||
|
||||
menuconfig BT_NIMBLE_HID_SERVICE
|
||||
bool "HID service"
|
||||
default n
|
||||
help
|
||||
Enable HID service support
|
||||
|
||||
config BT_NIMBLE_SVC_HID_MAX_INSTANCES
|
||||
depends on BT_NIMBLE_HID_SERVICE
|
||||
int "Maximum HID service instances"
|
||||
default 2
|
||||
help
|
||||
Defines maximum number of HID service instances
|
||||
|
||||
config BT_NIMBLE_SVC_HID_MAX_RPTS
|
||||
depends on BT_NIMBLE_HID_SERVICE
|
||||
int "Maximum HID Report characteristics per service instance"
|
||||
default 3
|
||||
help
|
||||
Defines maximum number of report characteristics per service instance
|
||||
|
||||
menuconfig BT_NIMBLE_BAS_SERVICE
|
||||
bool "Battery service"
|
||||
default y
|
||||
help
|
||||
Enable Battery service support
|
||||
|
||||
config BT_NIMBLE_SVC_BAS_BATTERY_LEVEL_NOTIFY
|
||||
depends on BT_NIMBLE_BAS_SERVICE
|
||||
bool "BAS Battery Level NOTIFY permission"
|
||||
help
|
||||
Enable/Disable notifications on BAS Battery Level Characteristic
|
||||
|
||||
menuconfig BT_NIMBLE_DIS_SERVICE
|
||||
bool "DIS service"
|
||||
default y
|
||||
help
|
||||
Enable DIS service support
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_MANUFACTURER_NAME
|
||||
depends on BT_NIMBLE_DIS_SERVICE
|
||||
bool "Manufacturer Name"
|
||||
default n
|
||||
help
|
||||
Enable the DIS characteristic Manufacturer Name String characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_SERIAL_NUMBER
|
||||
depends on BT_NIMBLE_DIS_SERVICE
|
||||
bool "Serial Number"
|
||||
default n
|
||||
help
|
||||
Enable the DIS Serial Number characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_HARDWARE_REVISION
|
||||
depends on BT_NIMBLE_DIS_SERVICE
|
||||
bool "Hardware Revision"
|
||||
default n
|
||||
help
|
||||
Enable the DIS Hardware Revision characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_FIRMWARE_REVISION
|
||||
depends on BT_NIMBLE_DIS_SERVICE
|
||||
bool "Firmware Revision"
|
||||
default n
|
||||
help
|
||||
Enable the DIS Firmware Revision characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_SOFTWARE_REVISION
|
||||
depends on BT_NIMBLE_DIS_SERVICE
|
||||
bool "Software Revision"
|
||||
default n
|
||||
help
|
||||
Enable the DIS Software Revision characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_SYSTEM_ID
|
||||
depends on BT_NIMBLE_DIS_SERVICE
|
||||
bool "System ID"
|
||||
default n
|
||||
help
|
||||
Enable the DIS System ID characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_PNP_ID
|
||||
depends on BT_NIMBLE_DIS_SERVICE
|
||||
bool "PnP ID"
|
||||
default n
|
||||
help
|
||||
Enable the DIS PnP ID characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_INCLUDED
|
||||
depends on BT_NIMBLE_DIS_SERVICE
|
||||
bool "DIS as an Included Service"
|
||||
default n
|
||||
help
|
||||
Use DIS as an included service
|
||||
|
||||
menuconfig BT_NIMBLE_GAP_SERVICE
|
||||
bool "GAP Service"
|
||||
default y
|
||||
help
|
||||
Enable GAP Service support
|
||||
|
||||
menu "GAP Appearance write permissions"
|
||||
depends on BT_NIMBLE_GAP_SERVICE
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE
|
||||
bool "Write"
|
||||
default n
|
||||
@ -792,14 +1010,12 @@ menu "GAP Service"
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
|
||||
depends on BT_NIMBLE_SVC_GAP_APPEAR_WRITE
|
||||
bool "Write with encryption"
|
||||
default n
|
||||
help
|
||||
Enable write with encryption permission (BLE_GATT_CHR_F_WRITE_ENC)
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
|
||||
depends on BT_NIMBLE_SVC_GAP_APPEAR_WRITE
|
||||
bool "Write with authentication"
|
||||
default n
|
||||
help
|
||||
Enable write with authentication permission (BLE_GATT_CHR_F_WRITE_AUTHEN)
|
||||
|
||||
@ -809,48 +1025,49 @@ menu "GAP Service"
|
||||
default n
|
||||
help
|
||||
Enable write with authorisation permission (BLE_GATT_CHR_F_WRITE_AUTHOR)
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE
|
||||
default 8 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ENC
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
|
||||
default 4096 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHN
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
|
||||
default 8192 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHR
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHOR
|
||||
default 16384 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHOR
|
||||
endmenu
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE
|
||||
default 8 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ENC
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
|
||||
default 4096 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHN
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
|
||||
default 8192 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHR
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHOR
|
||||
default 16384 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHOR
|
||||
|
||||
choice BT_NIMBLE_SVC_GAP_CENT_ADDR_RESOLUTION
|
||||
prompt "GAP Characteristic - Central Address Resolution"
|
||||
depends on BT_NIMBLE_GAP_SERVICE
|
||||
default BT_NIMBLE_SVC_GAP_CAR_CHAR_NOT_SUPP
|
||||
help
|
||||
Weather or not Central Address Resolution characteristic is supported on
|
||||
the device, and if supported, weather or not Central Address Resolution
|
||||
is supported.
|
||||
Weather or not Central Address Resolution characteristic is supported on
|
||||
the device, and if supported, weather or not Central Address Resolution
|
||||
is supported.
|
||||
|
||||
- Central Address Resolution characteristic not supported
|
||||
- Central Address Resolution not supported
|
||||
- Central Address Resolution supported
|
||||
- Central Address Resolution characteristic not supported
|
||||
- Central Address Resolution not supported
|
||||
- Central Address Resolution supported
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_CAR_CHAR_NOT_SUPP
|
||||
bool "Characteristic not supported"
|
||||
config BT_NIMBLE_SVC_GAP_CAR_CHAR_NOT_SUPP
|
||||
bool "Characteristic not supported"
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_CAR_NOT_SUPP
|
||||
bool "Central Address Resolution not supported"
|
||||
config BT_NIMBLE_SVC_GAP_CAR_NOT_SUPP
|
||||
bool "Central Address Resolution not supported"
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_CAR_SUPP
|
||||
bool "Central Address Resolution supported"
|
||||
config BT_NIMBLE_SVC_GAP_CAR_SUPP
|
||||
bool "Central Address Resolution supported"
|
||||
endchoice
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_CENT_ADDR_RESOLUTION
|
||||
@ -859,7 +1076,9 @@ menu "GAP Service"
|
||||
default 0 if BT_NIMBLE_SVC_GAP_CAR_NOT_SUPP
|
||||
default 1 if BT_NIMBLE_SVC_GAP_CAR_SUPP
|
||||
|
||||
|
||||
menu "GAP device name write permissions"
|
||||
depends on BT_NIMBLE_GAP_SERVICE
|
||||
config BT_NIMBLE_SVC_GAP_NAME_WRITE
|
||||
bool "Write"
|
||||
default n
|
||||
@ -888,6 +1107,40 @@ menu "GAP Service"
|
||||
Enable write with authorisation permission (BLE_GATT_CHR_F_WRITE_AUTHOR)
|
||||
endmenu
|
||||
|
||||
menu "PPCP settings"
|
||||
depends on BT_NIMBLE_GAP_SERVICE
|
||||
config BT_NIMBLE_SVC_GAP_PPCP_MAX_CONN_INTERVAL
|
||||
int "PPCP Connection Interval Max (Unit: 1.25 ms)"
|
||||
depends on BT_NIMBLE_ROLE_PERIPHERAL && BT_NIMBLE_GAP_SERVICE
|
||||
default 0
|
||||
help
|
||||
Peripheral Preferred Connection Parameter: Connection Interval maximum value
|
||||
Interval Max = value * 1.25 ms
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_PPCP_MIN_CONN_INTERVAL
|
||||
int "PPCP Connection Interval Min (Unit: 1.25 ms)"
|
||||
depends on BT_NIMBLE_ROLE_PERIPHERAL && BT_NIMBLE_GAP_SERVICE
|
||||
default 0
|
||||
help
|
||||
Peripheral Preferred Connection Parameter: Connection Interval minimum value
|
||||
Interval Min = value * 1.25 ms
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_PPCP_SLAVE_LATENCY
|
||||
int "PPCP Slave Latency"
|
||||
depends on BT_NIMBLE_GAP_SERVICE
|
||||
default 0
|
||||
help
|
||||
Peripheral Preferred Connection Parameter: Slave Latency
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_PPCP_SUPERVISION_TMO
|
||||
int "PPCP Supervision Timeout (Uint: 10 ms)"
|
||||
depends on BT_NIMBLE_GAP_SERVICE
|
||||
default 0
|
||||
help
|
||||
Peripheral Preferred Connection Parameter: Supervision Timeout
|
||||
Timeout = Value * 10 ms
|
||||
endmenu
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_NAME_WRITE
|
||||
@ -908,35 +1161,6 @@ menu "GAP Service"
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_NAME_WRITE_AUTHOR
|
||||
default 16384 if BT_NIMBLE_SVC_GAP_NAME_WRITE_AUTHOR
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_PPCP_MAX_CONN_INTERVAL
|
||||
int "PPCP Connection Interval Max (Unit: 1.25 ms)"
|
||||
depends on BT_NIMBLE_ROLE_PERIPHERAL
|
||||
default 0
|
||||
help
|
||||
Peripheral Preferred Connection Parameter: Connection Interval maximum value
|
||||
Interval Max = value * 1.25 ms
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_PPCP_MIN_CONN_INTERVAL
|
||||
int "PPCP Connection Interval Min (Unit: 1.25 ms)"
|
||||
depends on BT_NIMBLE_ROLE_PERIPHERAL
|
||||
default 0
|
||||
help
|
||||
Peripheral Preferred Connection Parameter: Connection Interval minimum value
|
||||
Interval Min = value * 1.25 ms
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_PPCP_SLAVE_LATENCY
|
||||
int "PPCP Slave Latency"
|
||||
default 0
|
||||
help
|
||||
Peripheral Preferred Connection Parameter: Slave Latency
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_PPCP_SUPERVISION_TMO
|
||||
int "PPCP Supervision Timeout (Uint: 10 ms)"
|
||||
default 0
|
||||
help
|
||||
Peripheral Preferred Connection Parameter: Supervision Timeout
|
||||
Timeout = Value * 10 ms
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_GATT_SECURITY_LEVEL
|
||||
bool "LE GATT Security Level Characteristic"
|
||||
default n
|
||||
@ -951,94 +1175,6 @@ menu "GAP Service"
|
||||
|
||||
endmenu
|
||||
|
||||
menu "BLE Services"
|
||||
menuconfig BT_NIMBLE_HID_SERVICE
|
||||
bool "HID service"
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
default n
|
||||
help
|
||||
Enable HID service support
|
||||
|
||||
config BT_NIMBLE_SVC_HID_MAX_INSTANCES
|
||||
depends on BT_NIMBLE_HID_SERVICE
|
||||
int "Maximum HID service instances"
|
||||
default 2
|
||||
help
|
||||
Defines maximum number of HID service instances
|
||||
|
||||
config BT_NIMBLE_SVC_HID_MAX_RPTS
|
||||
depends on BT_NIMBLE_HID_SERVICE
|
||||
int "Maximum HID Report characteristics per service instance"
|
||||
default 3
|
||||
help
|
||||
Defines maximum number of report characteristics per service instance
|
||||
|
||||
config BT_NIMBLE_SVC_BAS_BATTERY_LEVEL_NOTIFY
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "BAS Battery Level NOTIFY permission"
|
||||
default n
|
||||
help
|
||||
Enable/Disable notifications on BAS Battery Level Characteristic
|
||||
|
||||
menu "Device Information Service"
|
||||
config BT_NIMBLE_SVC_DIS_MANUFACTURER_NAME
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "Manufacturer Name"
|
||||
default n
|
||||
help
|
||||
Enable the DIS characteristic Manufacturer Name String characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_SERIAL_NUMBER
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "Serial Number"
|
||||
default n
|
||||
help
|
||||
Enable the DIS Serial Number characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_HARDWARE_REVISION
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "Hardware Revision"
|
||||
default n
|
||||
help
|
||||
Enable the DIS Hardware Revision characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_FIRMWARE_REVISION
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "Firmware Revision"
|
||||
default n
|
||||
help
|
||||
Enable the DIS Firmware Revision characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_SOFTWARE_REVISION
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "Software Revision"
|
||||
default n
|
||||
help
|
||||
Enable the DIS Software Revision characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_SYSTEM_ID
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "System ID"
|
||||
default n
|
||||
help
|
||||
Enable the DIS System ID characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_PNP_ID
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "PnP ID"
|
||||
default n
|
||||
help
|
||||
Enable the DIS PnP ID characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_INCLUDED
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "DIS as an Included Service"
|
||||
default n
|
||||
help
|
||||
Use DIS as an included service
|
||||
endmenu
|
||||
endmenu
|
||||
|
||||
config BT_NIMBLE_VS_SUPPORT
|
||||
bool "Enable support for VSC and VSE"
|
||||
help
|
||||
@ -1075,8 +1211,7 @@ config BT_NIMBLE_HIGH_DUTY_ADV_ITVL
|
||||
|
||||
config BT_NIMBLE_HOST_ALLOW_CONNECT_WITH_SCAN
|
||||
bool "Allow Connections with scanning in progress"
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
depends on (!SOC_ESP_NIMBLE_CONTROLLER || IDF_TARGET_ESP32C6 || IDF_TARGET_ESP32H2)
|
||||
depends on BT_NIMBLE_ENABLED && !(IDF_TARGET_ESP32C2)
|
||||
help
|
||||
This enables support for user to initiate a new connection with scan in progress
|
||||
|
||||
|
Submodule components/bt/host/nimble/nimble updated: 7c18dde8d7...cc3ac5416b
@ -98,6 +98,14 @@
|
||||
#define MYNEWT_VAL_BLE_EXT_ADV (CONFIG_BT_NIMBLE_EXT_ADV)
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_EXT_ADV_V2
|
||||
#ifdef CONFIG_BT_NIMBLE_EXT_ADV_V2
|
||||
#define MYNEWT_VAL_BLE_EXT_ADV_V2 (CONFIG_BT_NIMBLE_EXT_ADV_V2)
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_EXT_ADV_V2 (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_BT_NIMBLE_EXT_ADV_MAX_SIZE
|
||||
#define MYNEWT_VAL_BLE_EXT_ADV_MAX_SIZE (31)
|
||||
#else
|
||||
@ -129,11 +137,27 @@
|
||||
#define MYNEWT_VAL_BLE_MAX_PERIODIC_ADVERTISER_LIST (CONFIG_BT_NIMBLE_MAX_PERIODIC_ADVERTISER_LIST)
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_INCL_SVC_DISCOVERY
|
||||
#ifdef CONFIG_BT_NIMBLE_INCL_SVC_DISCOVERY
|
||||
#define MYNEWT_VAL_BLE_INCL_SVC_DISCOVERY (CONFIG_BT_NIMBLE_INCL_SVC_DISCOVERY)
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_INCL_SVC_DISCOVERY (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_BT_NIMBLE_GATT_CACHING
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING (0)
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING (CONFIG_BT_NIMBLE_GATT_CACHING)
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_GATT_CACHING_INCLUDE_SERVICES
|
||||
#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_INCLUDE_SERVICES
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING_INCLUDE_SERVICES (CONFIG_BT_NIMBLE_GATT_CACHING_INCLUDE_SERVICES)
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING_INCLUDE_SERVICES (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CONNS
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_CONNS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CONNS)
|
||||
#else
|
||||
@ -146,6 +170,14 @@
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_SVCS (0)
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_GATT_CACHING_MAX_INCL_SVCS
|
||||
#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_MAX_INCL_SVCS
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_INCL_SVCS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_INCL_SVCS)
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_INCL_SVCS (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CHRS
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_CHRS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CHRS)
|
||||
#else
|
||||
@ -212,6 +244,18 @@
|
||||
#define MYNEWT_VAL_BLE_ROLE_PERIPHERAL (CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_BT_NIMBLE_GATT_CLIENT
|
||||
#define MYNEWT_VAL_BLE_GATTC (0)
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_GATTC (CONFIG_BT_NIMBLE_GATT_CLIENT)
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_BT_NIMBLE_GATT_SERVER
|
||||
#define MYNEWT_VAL_BLE_GATTS (0)
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_GATTS (CONFIG_BT_NIMBLE_GATT_SERVER)
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_WHITELIST
|
||||
#define MYNEWT_VAL_BLE_WHITELIST (1)
|
||||
#endif
|
||||
@ -552,7 +596,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_ATT_SVR_MAX_PREP_ENTRIES
|
||||
#define MYNEWT_VAL_BLE_ATT_SVR_MAX_PREP_ENTRIES (64)
|
||||
#define MYNEWT_VAL_BLE_ATT_SVR_MAX_PREP_ENTRIES CONFIG_BT_NIMBLE_ATT_MAX_PREP_ENTRIES
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_ATT_SVR_NOTIFY
|
||||
@ -2032,4 +2076,16 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_ERR_CHECK
|
||||
#ifdef CONFIG_BT_NIMBLE_PRINT_ERR_NAME
|
||||
#define MYNEWT_VAL_BLE_ERR_CHECK CONFIG_BT_NIMBLE_PRINT_ERR_NAME
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_ERR_CHECK (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_USED_IN_IDF
|
||||
#define MYNEWT_VAL_BLE_USED_IN_IDF (1)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -30,7 +30,7 @@ extern "C" {
|
||||
*
|
||||
* @note Please do not modify this value
|
||||
*/
|
||||
#define ESP_BT_CTRL_CONFIG_VERSION 0x02502230
|
||||
#define ESP_BT_CTRL_CONFIG_VERSION 0x02505080
|
||||
|
||||
/**
|
||||
* @brief Internal use only
|
||||
@ -268,7 +268,7 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
|
||||
#define BT_CTRL_RUN_IN_FLASH_ONLY (0)
|
||||
#endif
|
||||
|
||||
#if (BT_CTRL_RUN_IN_FLASH_ONLY == 1)
|
||||
|
||||
|
||||
#if defined(CONFIG_BT_CTRL_DTM_ENABLE)
|
||||
#define BT_CTRL_DTM_ENABLE CONFIG_BT_CTRL_DTM_ENABLE
|
||||
@ -288,20 +288,11 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
|
||||
#define BT_CTRL_BLE_TEST (0)
|
||||
#endif
|
||||
|
||||
#if defined (CONFIG_BT_NIMBLE_SECURITY_ENABLE) || defined (CONFIG_BT_BLE_SMP_ENABLE)
|
||||
#ifdef CONFIG_BT_NIMBLE_SECURITY_ENABLE
|
||||
#define BLE_SECURITY_ENABLE (CONFIG_BT_NIMBLE_SECURITY_ENABLE)
|
||||
#endif //CONFIG_BT_NIMBLE_SECURITY_ENABLE
|
||||
#ifdef CONFIG_BT_BLE_SMP_ENABLE
|
||||
#define BLE_SECURITY_ENABLE (CONFIG_BT_BLE_SMP_ENABLE)
|
||||
#endif //CONFIG_BT_BLE_SMP_ENABLE
|
||||
#else
|
||||
#if defined (CONFIG_BT_CTRL_BLE_SECURITY_ENABLE)
|
||||
#define BLE_SECURITY_ENABLE (CONFIG_BT_CTRL_BLE_SECURITY_ENABLE)
|
||||
#else
|
||||
#define BLE_SECURITY_ENABLE (0)
|
||||
#endif
|
||||
#endif // (CONFIG_BT_NIMBLE_SECURITY_ENABLE) || (CONFIG_BT_BLE_SMP_ENABLE)
|
||||
|
||||
#if defined (CONFIG_BT_CTRL_BLE_SCAN)
|
||||
#define BT_CTRL_BLE_SCAN CONFIG_BT_CTRL_BLE_SCAN
|
||||
@ -309,13 +300,11 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
|
||||
#define BT_CTRL_BLE_SCAN (0)
|
||||
#endif
|
||||
|
||||
#if defined (CONFIG_BT_CTRL_BLE_ADV)
|
||||
#define BT_CTRL_BLE_ADV CONFIG_BT_CTRL_BLE_ADV
|
||||
#else
|
||||
#define BT_CTRL_BLE_MASTER (1)
|
||||
#define BT_CTRL_DTM_ENABLE (1)
|
||||
#define BT_CTRL_BLE_TEST (1)
|
||||
#define BLE_SECURITY_ENABLE (1)
|
||||
#define BT_CTRL_BLE_SCAN (1)
|
||||
#endif // (BT_CTRL_RUN_IN_FLASH_ONLY == 1)
|
||||
#define BT_CTRL_BLE_ADV (0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
|
||||
#define BLE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED CONFIG_BT_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
|
||||
@ -384,11 +373,12 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
|
||||
.dtm_en = BT_CTRL_DTM_ENABLE, \
|
||||
.enc_en = BLE_SECURITY_ENABLE, \
|
||||
.qa_test = BT_CTRL_BLE_TEST, \
|
||||
.master_en = BT_CTRL_BLE_MASTER, \
|
||||
.connect_en = BT_CTRL_BLE_MASTER, \
|
||||
.scan_en = BT_CTRL_BLE_SCAN, \
|
||||
.ble_aa_check = BLE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED, \
|
||||
.ble_log_mode_en = BLE_LOG_MODE_EN, \
|
||||
.ble_log_level = BLE_LOG_LEVEL, \
|
||||
.adv_en = BT_CTRL_BLE_ADV, \
|
||||
}
|
||||
|
||||
#else
|
||||
@ -508,14 +498,15 @@ typedef struct {
|
||||
uint8_t ble_llcp_disc_flag; /*!< Flag indicating whether the Controller disconnects after Instant Passed (0x28) error occurs. Configurable in menuconfig.
|
||||
- The Controller does not disconnect after Instant Passed (0x28) by default. */
|
||||
bool run_in_flash; /*!< True if the Controller code is in flash (flash model); false otherwise (default). Configurable in menuconfig. */
|
||||
bool dtm_en; /*!< In the flash mode, True if the DTM feature is enabled; false otherwise (default). Configurable in menuconfig. */
|
||||
bool enc_en; /*!< In the flash mode, True if the encryption feature is enabled (default); false otherwise. Configurable in menuconfig. */
|
||||
bool qa_test; /*!< In the flash mode, True if the QA test feature is enabled; false otherwise (default). Configurable in menuconfig.*/
|
||||
bool master_en; /*!< In the flash mode, True if the master feature is enabled (default); false otherwise. Configurable in menuconfig.*/
|
||||
bool scan_en; /*!< In the flash mode, True if the scan feature is enabled (default); false otherwise. Configurable in menuconfig.*/
|
||||
bool dtm_en; /*!< True if the DTM feature is enabled; false otherwise (default). Configurable in menuconfig. */
|
||||
bool enc_en; /*!< True if the encryption feature is enabled (default); false otherwise. Configurable in menuconfig. */
|
||||
bool qa_test; /*!< True if the QA test feature is enabled; false otherwise (default). Configurable in menuconfig.*/
|
||||
bool connect_en; /*!< True if the connection feature is enabled (default); false otherwise. Configurable in menuconfig.*/
|
||||
bool scan_en; /*!< True if the scan feature is enabled (default); false otherwise. Configurable in menuconfig.*/
|
||||
bool ble_aa_check; /*!< True if adds a verification step for the Access Address within the CONNECT_IND PDU; false otherwise. Configurable in menuconfig */
|
||||
uint32_t ble_log_mode_en; /*!< BLE log mode enable */
|
||||
uint8_t ble_log_level; /*!< BLE log level */
|
||||
bool adv_en; /*!< True if the ADV feature is enabled (default); false otherwise. Configurable in menuconfig.*/
|
||||
} esp_bt_controller_config_t;
|
||||
|
||||
/**
|
||||
|
@ -159,7 +159,7 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
|
||||
*/
|
||||
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
|
||||
|
||||
#define CONFIG_VERSION 0x20250310
|
||||
#define CONFIG_VERSION 0x20250526
|
||||
#define CONFIG_MAGIC 0x5A5AA5A5
|
||||
|
||||
/**
|
||||
@ -226,6 +226,12 @@ typedef struct {
|
||||
- 1 - Enable */
|
||||
uint8_t vhci_enabled; /*!< VHCI mode is enabled */
|
||||
uint8_t ptr_check_enabled; /*!< Enable boundary check for internal memory. */
|
||||
uint8_t ble_adv_tx_options; /*!< The options for Extended advertising sending. */
|
||||
uint8_t skip_unnecessary_checks_en; /*!< The option to skip non-fatal state checks and perform extra handling for fatal checks. */
|
||||
uint8_t fast_conn_data_tx_en; /*!< The option for fast transmission of connection data
|
||||
- 0 - Disable
|
||||
- 1 - Enable (default) */
|
||||
int8_t ch39_txpwr; /*!< BLE transmit power (in dBm) used for BLE advertising on channel 39. */
|
||||
uint32_t config_magic; /*!< Magic number for configuration validation */
|
||||
} esp_bt_controller_config_t;
|
||||
|
||||
@ -281,6 +287,10 @@ typedef struct {
|
||||
.ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \
|
||||
.vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \
|
||||
.ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \
|
||||
.ble_adv_tx_options = 0, \
|
||||
.skip_unnecessary_checks_en = 0, \
|
||||
.fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \
|
||||
.ch39_txpwr = BLE_LL_TX_PWR_DBM_N, \
|
||||
.config_magic = CONFIG_MAGIC, \
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,7 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
|
||||
*/
|
||||
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
|
||||
|
||||
#define CONFIG_VERSION 0x20250310
|
||||
#define CONFIG_VERSION 0x20250526
|
||||
#define CONFIG_MAGIC 0x5A5AA5A5
|
||||
|
||||
/**
|
||||
@ -226,6 +226,12 @@ typedef struct {
|
||||
- 1 - Enable */
|
||||
uint8_t vhci_enabled; /*!< VHCI mode is enabled */
|
||||
uint8_t ptr_check_enabled; /*!< Enable boundary check for internal memory. */
|
||||
uint8_t ble_adv_tx_options; /*!< The options for Extended advertising sending. */
|
||||
uint8_t skip_unnecessary_checks_en; /*!< The option to skip non-fatal state checks and perform extra handling for fatal checks. */
|
||||
uint8_t fast_conn_data_tx_en; /*!< The option for fast transmission of connection data
|
||||
- 0 - Disable
|
||||
- 1 - Enable (default) */
|
||||
int8_t ch39_txpwr; /*!< BLE transmit power (in dBm) used for BLE advertising on channel 39. */
|
||||
uint32_t config_magic; /*!< Magic number for configuration validation */
|
||||
} esp_bt_controller_config_t;
|
||||
|
||||
@ -284,6 +290,10 @@ typedef struct {
|
||||
.ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \
|
||||
.vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \
|
||||
.ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \
|
||||
.ble_adv_tx_options = 0, \
|
||||
.skip_unnecessary_checks_en = 0, \
|
||||
.fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \
|
||||
.ch39_txpwr = BLE_LL_TX_PWR_DBM_N, \
|
||||
.config_magic = CONFIG_MAGIC, \
|
||||
}
|
||||
#elif CONFIG_IDF_TARGET_ESP32C61
|
||||
@ -339,6 +349,10 @@ typedef struct {
|
||||
.ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \
|
||||
.vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \
|
||||
.ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \
|
||||
.ble_adv_tx_options = 0, \
|
||||
.skip_unnecessary_checks_en = 0, \
|
||||
.fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \
|
||||
.ch39_txpwr = BLE_LL_TX_PWR_DBM_N, \
|
||||
.config_magic = CONFIG_MAGIC, \
|
||||
}
|
||||
#endif
|
||||
|
@ -161,7 +161,7 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
|
||||
*/
|
||||
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
|
||||
|
||||
#define CONFIG_VERSION 0x20250310
|
||||
#define CONFIG_VERSION 0x20250526
|
||||
#define CONFIG_MAGIC 0x5A5AA5A5
|
||||
|
||||
/**
|
||||
@ -226,8 +226,14 @@ typedef struct {
|
||||
uint8_t ble_data_lenth_zero_aux; /*!< Enable / disable auxiliary packets when the extended ADV data length is zero. Configurable in menuconfig.
|
||||
- 0 - Disable (default)
|
||||
- 1 - Enable */
|
||||
uint8_t vhci_enabled; /*!< VHCI is enabled */
|
||||
uint8_t vhci_enabled; /*!< VHCI is enabled */
|
||||
uint8_t ptr_check_enabled; /*!< Enable boundary check for internal memory. */
|
||||
uint8_t ble_adv_tx_options; /*!< The options for Extended advertising sending. */
|
||||
uint8_t skip_unnecessary_checks_en; /*!< The option to skip non-fatal state checks and perform extra handling for fatal checks. */
|
||||
uint8_t fast_conn_data_tx_en; /*!< The option for fast transmission of connection data
|
||||
- 0 - Disable
|
||||
- 1 - Enable (default) */
|
||||
int8_t ch39_txpwr; /*!< BLE transmit power (in dBm) used for BLE advertising on channel 39. */
|
||||
uint32_t config_magic; /*!< Configuration magic value */
|
||||
} esp_bt_controller_config_t;
|
||||
|
||||
@ -284,6 +290,10 @@ typedef struct {
|
||||
.ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \
|
||||
.vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \
|
||||
.ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \
|
||||
.ble_adv_tx_options = 0, \
|
||||
.skip_unnecessary_checks_en = 0, \
|
||||
.fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \
|
||||
.ch39_txpwr = BLE_LL_TX_PWR_DBM_N, \
|
||||
.config_magic = CONFIG_MAGIC, \
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@
|
||||
#define ADC_TEST_LOW_VAL 0
|
||||
#define ADC_TEST_LOW_THRESH 17
|
||||
|
||||
#define ADC_TEST_HIGH_VAL 3430
|
||||
#define ADC_TEST_HIGH_VAL 3375
|
||||
#define ADC_TEST_HIGH_THRESH 200
|
||||
|
||||
#elif CONFIG_IDF_TARGET_ESP32C61
|
||||
|
@ -245,10 +245,13 @@ static void twai_intr_handler_main(void *arg)
|
||||
|
||||
//Handle events that only require alerting (i.e. no handler)
|
||||
if (events & TWAI_HAL_EVENT_BUS_OFF) {
|
||||
twai_ll_set_mode(p_twai_obj->hal->dev, true, false, false); //Freeze TEC/REC by entering LOM
|
||||
p_twai_obj->state = TWAI_STATE_BUS_OFF;
|
||||
twai_alert_handler(p_twai_obj, TWAI_ALERT_BUS_OFF, &alert_req);
|
||||
}
|
||||
if (events & TWAI_HAL_EVENT_BUS_RECOV_CPLT) {
|
||||
//Back to STOPPED state after recovered, for cautious engineering strategy
|
||||
twai_ll_enter_reset_mode(p_twai_obj->hal->dev);
|
||||
p_twai_obj->state = TWAI_STATE_STOPPED;
|
||||
twai_alert_handler(p_twai_obj, TWAI_ALERT_BUS_RECOVERED, &alert_req);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user