forked from espressif/esp-idf
Compare commits
507 Commits
fixes
...
v5.2-beta2
Author | SHA1 | Date | |
---|---|---|---|
b4a612345b | |||
e49823f10c | |||
ff8a6a5bf9 | |||
608d575172 | |||
41ca90905e | |||
4435437501 | |||
8dcf3e5f80 | |||
8ce0b8bf73 | |||
ceb9e42058 | |||
6947dd533a | |||
e6a4ad3d55 | |||
21b06f43bf | |||
911ad39808 | |||
651f60e663 | |||
6a34106488 | |||
ff14e382a4 | |||
499625be33 | |||
ebcb490aa9 | |||
613c17bc2f | |||
a2b96227ac | |||
1ef5c02c37 | |||
aefe0722a0 | |||
96ba61f89f | |||
985cc9318a | |||
8f79c54242 | |||
6949092234 | |||
ad25a90d6a | |||
d5dc04693d | |||
aca0d3ad17 | |||
a36d8bc742 | |||
3fdbfb2069 | |||
87cc516338 | |||
c26660e504 | |||
da169340f9 | |||
0fe3ec63a0 | |||
7778ab2759 | |||
fdf04b3198 | |||
debcb50fd2 | |||
7b3c08e37a | |||
db15c0e183 | |||
a5dc34f416 | |||
d9d388dae7 | |||
97594d2076 | |||
0a1e5846c7 | |||
a6cbcb91d2 | |||
3c8cccc73b | |||
a7e2ea76d8 | |||
8005821b09 | |||
1f2d548fbb | |||
841339c012 | |||
1fb97c1718 | |||
39a383981d | |||
61bd19b446 | |||
4e5757f1ab | |||
0d4d3c103f | |||
f8736aed36 | |||
37bf8dff6b | |||
90d69b38b2 | |||
f32321e6a5 | |||
968b15d380 | |||
fdd8d4284f | |||
191466d824 | |||
56563f7092 | |||
572a66b62e | |||
a4bfa19ebd | |||
a3cee541d3 | |||
bdb0756cdb | |||
66759438a9 | |||
56a6cad52c | |||
be27966ce9 | |||
e2b18f2c2c | |||
e19be79e4f | |||
a5b9169a7e | |||
2d8fb1604f | |||
d07bd19ba6 | |||
6139b362a0 | |||
6a08a13e70 | |||
70c7f3725f | |||
b586575970 | |||
7c3a604e27 | |||
bc2ef597a4 | |||
4cf3acb594 | |||
af4991fb39 | |||
e9c617fa19 | |||
a168fde297 | |||
8558aa4414 | |||
72176eee5d | |||
3da789bae6 | |||
34795220d2 | |||
357e0e144b | |||
58f1bde9ef | |||
f9c8db8f94 | |||
6a92a3582e | |||
609d25482b | |||
36cbbdcf65 | |||
a75cf3effd | |||
b85e6d3dd8 | |||
555bd367e1 | |||
c2e134b775 | |||
7cdddd47aa | |||
ffd3a58ff9 | |||
bf816394d4 | |||
52eab870e5 | |||
ffbbf0cebf | |||
a635d11b4a | |||
df43d670a1 | |||
7a3efab6a7 | |||
6388f3f13c | |||
eb848eaa6b | |||
c7b527bd27 | |||
aba5fdcdcd | |||
fc95a892ab | |||
4c1c9373e9 | |||
3081c8b5ea | |||
afbbaaf417 | |||
913550f62c | |||
ee0ee4887f | |||
63fee6c23a | |||
633dd89d4a | |||
c9f1d3e8be | |||
e3653aaa98 | |||
0818b1fca1 | |||
44f266693a | |||
35844b3d09 | |||
ca3bcb18b0 | |||
8c86ccc2c6 | |||
7ee2470603 | |||
821d82f04e | |||
4e0459f112 | |||
3c43fb0707 | |||
fb4e56e9a3 | |||
60e439db60 | |||
b94656115e | |||
068a364a6b | |||
134fd6b8d8 | |||
d3a78fef1b | |||
3ca40da386 | |||
b05cfb4eb1 | |||
2110f6b037 | |||
1ef33e12a4 | |||
720985250b | |||
dc835a0918 | |||
264284e0de | |||
2482c4a025 | |||
0d0265f6f3 | |||
eba1baa63d | |||
4f33ef4e11 | |||
0d55c89950 | |||
ba7b323c3e | |||
e58ed21fbf | |||
026fb6e292 | |||
587b4b32f8 | |||
d28751ee7f | |||
7a335421e1 | |||
9f65fa31e2 | |||
dd295049a9 | |||
b807b6ebf3 | |||
e4ecfc2133 | |||
99a923fa0f | |||
40d48108b1 | |||
55ed548cc6 | |||
3d2daa08cc | |||
804f939ed0 | |||
d465ed93f6 | |||
c90d14c979 | |||
afab071f51 | |||
d680a3949b | |||
faf6bc933e | |||
6fcfe379bc | |||
e089cb3d4d | |||
2555d5cb12 | |||
c1779ff8b7 | |||
1437d00487 | |||
1a9f3b22f4 | |||
567bc462f0 | |||
a9b1a27c9a | |||
09a3d068d9 | |||
70e83a5871 | |||
e849809f4b | |||
bc38841c11 | |||
f40318c6c7 | |||
4122499997 | |||
ef5acffcbb | |||
1f79b5045d | |||
74c0234f72 | |||
330f3edf11 | |||
63ea519cbe | |||
c71ee4f78a | |||
5c74467a5d | |||
8150abfb67 | |||
4bedb8372b | |||
170055603e | |||
634ce1e425 | |||
b74bdaceee | |||
b780287e3b | |||
8a64c4c404 | |||
c6c42d0b5c | |||
9ead485ffd | |||
6abe369115 | |||
be96274ea3 | |||
a9f7ea3566 | |||
f0e1a1f35f | |||
c77b2fcd5d | |||
8cc8a1108d | |||
541b665b9f | |||
ee65ea9fb7 | |||
7add372f37 | |||
263d186a5f | |||
b7ac980fbc | |||
80f3916f0f | |||
7faa087670 | |||
d0dab67955 | |||
004e93764f | |||
f41d1b09f8 | |||
83d9e81789 | |||
e202aa3b9f | |||
c23973dfa7 | |||
8495745471 | |||
323f128228 | |||
6ffc6a40a7 | |||
c7a270f83d | |||
93b2c4640b | |||
ecd894a4bd | |||
45d801d815 | |||
15b27b1749 | |||
26aa680b5b | |||
b7b042f45d | |||
8f44bee739 | |||
e785f453f4 | |||
533b82aae1 | |||
17c72d85e4 | |||
564e5c9429 | |||
fb6ba3f337 | |||
f04854bb4a | |||
d7ae1665f1 | |||
ba8afdbf81 | |||
feda32be06 | |||
df7ba090f3 | |||
c73141a9c2 | |||
98261d38cc | |||
b1bba5fdd3 | |||
bb29c6e55d | |||
aaf398617c | |||
782eaa3c7e | |||
d4b4fe85af | |||
40093b34eb | |||
78a3ecb7ff | |||
135987b339 | |||
e67e9cca57 | |||
ea21b8b700 | |||
600c7c8828 | |||
8abcc07d1f | |||
bad8adfd59 | |||
f207ce15df | |||
2882b6f68b | |||
f434d21f4a | |||
d3b4acf7a0 | |||
35013d90a3 | |||
57bbfd423a | |||
3d591c57c0 | |||
9d694e40ed | |||
1cdca25776 | |||
0e61201243 | |||
7f0f299e66 | |||
fc11d2ae72 | |||
7f8fe9569c | |||
bf8a6ef490 | |||
f8ee9b334c | |||
47ddba60d7 | |||
2fa1e2b23a | |||
f0869bb354 | |||
89c3bebad4 | |||
600986cf49 | |||
4379d26f65 | |||
30ecc4ce72 | |||
9bf48e77f0 | |||
b7f1aa5292 | |||
d65f8a5fc6 | |||
34d964bf38 | |||
48b4693eae | |||
9ecfa6af81 | |||
43f2476aac | |||
476f83c602 | |||
ab93a6bd5b | |||
79dd7a350e | |||
adc8351458 | |||
681439b85a | |||
8baaeb2fa3 | |||
eb51374615 | |||
00484dc8a7 | |||
539c4d8cd0 | |||
f5b7b148f1 | |||
b62d63b767 | |||
de36cb7904 | |||
07245bf43a | |||
2b6feac67c | |||
6cabcc8206 | |||
6bf448ddc8 | |||
868d52dcd1 | |||
22c5a4befc | |||
d8b2b9e77f | |||
7b27e4e66a | |||
4175c60a21 | |||
592b1660a0 | |||
5740323822 | |||
4824325fe4 | |||
c570105f36 | |||
841d75b3a3 | |||
2d07e3a6dc | |||
d0aa950fa6 | |||
7bbe4eae46 | |||
2f694bee0a | |||
293f5631bb | |||
7391b59f54 | |||
e5155c2a54 | |||
2c0cea641a | |||
b4f6edecbc | |||
ab3bb3d414 | |||
e1b6713f8f | |||
1efaf83ef4 | |||
8fe15a26d5 | |||
11a92e3dbd | |||
42aaf57419 | |||
05a4a77b52 | |||
9583c45947 | |||
4d0d0f5d10 | |||
5e65545320 | |||
0b0d474cab | |||
78784a60c0 | |||
3ab9a2fd71 | |||
6e187ee0af | |||
94c27b976d | |||
8da85639a2 | |||
621acc4d75 | |||
99f06b7c56 | |||
fe3d0955af | |||
c56f226e51 | |||
9036037a36 | |||
fbf4b7f705 | |||
89b27577d6 | |||
498e41d93e | |||
340195ba79 | |||
db5e8805ed | |||
9b5be39b0f | |||
9cd791b6ca | |||
4331ae783a | |||
e0286e24c8 | |||
441b0f1ea0 | |||
be39a0d2aa | |||
82052a0fc4 | |||
41be2013fd | |||
1ae8347bf4 | |||
0402fdeba1 | |||
2a968da432 | |||
a442a6b65c | |||
1d9a155fd7 | |||
02cacc6e05 | |||
f8268a2848 | |||
2e8cc61af7 | |||
9d3d9d16f0 | |||
83aeb7bbb2 | |||
614aed7409 | |||
477e19f71c | |||
7c33c24fe4 | |||
d9876ffd53 | |||
f57acc21d6 | |||
48960337b8 | |||
28a8e77021 | |||
66992aca7a | |||
f01a40afe2 | |||
03e31dd0ba | |||
42db3c8660 | |||
1f9d4c5c5c | |||
a2b9004203 | |||
1b07551997 | |||
02045155ae | |||
86a62e1de9 | |||
d709fdfd12 | |||
90f7b0d321 | |||
8c7ee8482e | |||
793de30863 | |||
ff4c82a32d | |||
172b7e45b8 | |||
6e2c0de765 | |||
7f3221aa09 | |||
e9df6d89af | |||
29cfa2d472 | |||
ce5cd8bf75 | |||
5a43831006 | |||
5bf1070143 | |||
a25673efb2 | |||
04ead4c281 | |||
bfa65bfd0d | |||
1ae6dad0d8 | |||
cd33e77e0f | |||
5171308939 | |||
bcf2ef7ddd | |||
3c67e1ba01 | |||
4400846c61 | |||
3207599b6d | |||
6077c3f70c | |||
3d37631967 | |||
8a12837745 | |||
b6ad8703ce | |||
8ab97bb37d | |||
83f4025a92 | |||
e3c2ee1ba9 | |||
85ba4189f8 | |||
93efb9e351 | |||
89dcaf4ae5 | |||
1dd7ece5d3 | |||
7a701fbc85 | |||
e8d43b03a1 | |||
8f8f7ddb45 | |||
deceda36ac | |||
33e0f11ef4 | |||
7c93afb8bd | |||
1a3a74c26c | |||
0582b4a25f | |||
57e59a47c1 | |||
23c0565a95 | |||
462d57e18f | |||
94c38470ac | |||
b05df37981 | |||
8b8c3d6204 | |||
22108bbeb4 | |||
8dda17e3a3 | |||
59e504ef27 | |||
b9ed6f722b | |||
f03448ca94 | |||
ba274216b9 | |||
e758c819d9 | |||
5fb2277aaa | |||
3b7e220519 | |||
e3d72eada7 | |||
20ca1c0dfa | |||
caaf3fbe69 | |||
113c22c1fc | |||
0de2c5092b | |||
1ea656f3d9 | |||
a2e4a3581b | |||
b68c026adb | |||
855f95e588 | |||
1276247696 | |||
cb1765de81 | |||
7385079984 | |||
868737e022 | |||
80997d5860 | |||
2b0d48f84d | |||
1fa85abf46 | |||
dec0bc482c | |||
c5ae121bac | |||
1d5dbb8170 | |||
010a65d84e | |||
eceefa878f | |||
2aa59af5f0 | |||
a8e3122866 | |||
a82b6f5c0b | |||
4f24d3a39c | |||
811a790aaf | |||
4ea0538a88 | |||
e15de479ce | |||
04dba7a80d | |||
7559a1eccf | |||
228c40c2ac | |||
3888ffdda6 | |||
d78d00855d | |||
9f6bf3b029 | |||
d63f83d279 | |||
360f7b1e14 | |||
bb329accd7 | |||
d20654e7ed | |||
340fda1cd6 | |||
a304cc230e | |||
0f84e7d8c6 | |||
91eada4acc | |||
375907299e | |||
e32bdb66e3 | |||
263e39c32b | |||
81665b27c3 | |||
aaa438a3a2 | |||
d6a79b5108 | |||
20b6d92b91 | |||
fec9a11f4a | |||
717aa73886 | |||
cde207e996 | |||
687c5cc8d5 | |||
e6fde2e13e | |||
6e92fc0416 | |||
c9f85d8d1b | |||
8d639492f2 | |||
7532df427a | |||
3589478a9e | |||
7e8181b976 | |||
8315221523 | |||
9804a8b0f9 | |||
8c52b0845d | |||
d98e77a4a7 | |||
2da0b61374 | |||
27681a5073 | |||
eb37150780 | |||
e151184da7 | |||
9b8aa6a792 | |||
4f4f32ecf2 | |||
8aba6a53e4 | |||
071d1cf865 | |||
1f80a9bb0f |
@ -3,8 +3,8 @@ workflow:
|
||||
# Disable those non-protected push triggered pipelines
|
||||
- if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_COMMIT_TAG !~ /^qa-test/ && $CI_PIPELINE_SOURCE == "push"'
|
||||
when: never
|
||||
# when running merged result pipelines, it would create a temp commit id. use $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA instead of $CI_COMMIT_SHA.
|
||||
# Please use PIPELINE_COMMIT_SHA at all places that require a commit sha
|
||||
# when running merged result pipelines, CI_COMMIT_SHA represents the temp commit it created.
|
||||
# Please use PIPELINE_COMMIT_SHA at all places that require a commit sha of the original commit.
|
||||
- if: $CI_OPEN_MERGE_REQUESTS != null
|
||||
variables:
|
||||
PIPELINE_COMMIT_SHA: $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
|
||||
|
@ -2,228 +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
|
||||
/.github/dangerjs/ @esp-idf-codeowners/ci @esp-idf-codeowners/tools
|
||||
/.github/dependabot.yml @esp-idf-codeowners/ci
|
||||
/.github/workflows/ @esp-idf-codeowners/ci
|
||||
/.gitlab-ci.yml @esp-idf-codeowners/ci
|
||||
/.gitlab/ci/ @esp-idf-codeowners/ci
|
||||
/.gitlab/dangerjs/ @esp-idf-codeowners/ci @esp-idf-codeowners/tools
|
||||
/.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
|
||||
/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
|
||||
/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_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_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 @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_system/ @esp-idf-codeowners/system
|
||||
/components/esp_timer/ @esp-idf-codeowners/system
|
||||
/components/esp-tls/ @esp-idf-codeowners/app-utilities
|
||||
/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/fatfs/**/*.py @esp-idf-codeowners/tools
|
||||
/components/freertos/ @esp-idf-codeowners/system
|
||||
/components/hal/ @esp-idf-codeowners/peripherals
|
||||
/components/heap/ @esp-idf-codeowners/system
|
||||
/components/http_parser/ @esp-idf-codeowners/app-utilities
|
||||
/components/idf_test/ @esp-idf-codeowners/ci
|
||||
/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/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/ci
|
||||
/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/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/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
|
||||
|
||||
/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/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/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/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/linux_compatible/ @esp-idf-codeowners/system
|
||||
/tools/test_apps/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
|
||||
/tools/test_apps/security/ @esp-idf-codeowners/security
|
||||
/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
|
||||
|
@ -59,7 +59,7 @@
|
||||
- `example_test[_esp32/esp32s2/...]`
|
||||
- `fuzzer_test`
|
||||
- `host_test`
|
||||
- `integration_test[_wifi/ble]`
|
||||
- `integration_test`
|
||||
- `iperf_stress_test`
|
||||
- `macos`
|
||||
- `macos_test`
|
||||
|
@ -21,8 +21,7 @@
|
||||
needs:
|
||||
- job: fast_template_app
|
||||
artifacts: false
|
||||
- job: mr_variables
|
||||
optional: true # only MR pipelines would have this
|
||||
- pipeline_variables
|
||||
artifacts:
|
||||
paths:
|
||||
# The other artifacts patterns are defined under tools/ci/artifacts_handler.py
|
||||
@ -46,9 +45,10 @@
|
||||
examples/bluetooth/esp_ble_mesh/ble_mesh_console
|
||||
examples/bluetooth/hci/controller_hci_uart_esp32
|
||||
examples/wifi/iperf
|
||||
--modified-components ${MR_MODIFIED_COMPONENTS}
|
||||
--modified-files ${MR_MODIFIED_FILES}
|
||||
- upload_artifacts_to_s3
|
||||
--modified-components ${MODIFIED_COMPONENTS}
|
||||
--modified-files ${MODIFIED_FILES}
|
||||
# for detailed documents, please refer to .gitlab/ci/README.md#uploaddownload-artifacts-to-internal-minio-server
|
||||
- python tools/ci/artifacts_handler.py upload
|
||||
|
||||
.build_cmake_clang_template:
|
||||
extends:
|
||||
@ -64,10 +64,10 @@
|
||||
--copy-sdkconfig
|
||||
--parallel-count ${CI_NODE_TOTAL:-1}
|
||||
--parallel-index ${CI_NODE_INDEX:-1}
|
||||
--modified-components ${MR_MODIFIED_COMPONENTS}
|
||||
--modified-files ${MR_MODIFIED_FILES}
|
||||
--modified-components ${MODIFIED_COMPONENTS}
|
||||
--modified-files ${MODIFIED_FILES}
|
||||
$TEST_BUILD_OPTS_EXTRA
|
||||
- upload_artifacts_to_s3
|
||||
- python tools/ci/artifacts_handler.py upload
|
||||
|
||||
.build_pytest_template:
|
||||
extends:
|
||||
@ -81,9 +81,9 @@
|
||||
--parallel-count ${CI_NODE_TOTAL:-1}
|
||||
--parallel-index ${CI_NODE_INDEX:-1}
|
||||
--collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
|
||||
--modified-components ${MR_MODIFIED_COMPONENTS}
|
||||
--modified-files ${MR_MODIFIED_FILES}
|
||||
- upload_artifacts_to_s3
|
||||
--modified-components ${MODIFIED_COMPONENTS}
|
||||
--modified-files ${MODIFIED_FILES}
|
||||
- python tools/ci/artifacts_handler.py upload
|
||||
|
||||
.build_pytest_no_jtag_template:
|
||||
extends:
|
||||
@ -97,9 +97,9 @@
|
||||
--parallel-count ${CI_NODE_TOTAL:-1}
|
||||
--parallel-index ${CI_NODE_INDEX:-1}
|
||||
--collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
|
||||
--modified-components ${MR_MODIFIED_COMPONENTS}
|
||||
--modified-files ${MR_MODIFIED_FILES}
|
||||
- upload_artifacts_to_s3
|
||||
--modified-components ${MODIFIED_COMPONENTS}
|
||||
--modified-files ${MODIFIED_FILES}
|
||||
- python tools/ci/artifacts_handler.py upload
|
||||
|
||||
.build_pytest_jtag_template:
|
||||
extends:
|
||||
@ -113,9 +113,9 @@
|
||||
--parallel-count ${CI_NODE_TOTAL:-1}
|
||||
--parallel-index ${CI_NODE_INDEX:-1}
|
||||
--collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
|
||||
--modified-components ${MR_MODIFIED_COMPONENTS}
|
||||
--modified-files ${MR_MODIFIED_FILES}
|
||||
- upload_artifacts_to_s3
|
||||
--modified-components ${MODIFIED_COMPONENTS}
|
||||
--modified-files ${MODIFIED_FILES}
|
||||
- python tools/ci/artifacts_handler.py upload
|
||||
|
||||
build_pytest_examples_esp32:
|
||||
extends:
|
||||
@ -263,9 +263,9 @@ build_only_components_apps:
|
||||
-t all
|
||||
--parallel-count ${CI_NODE_TOTAL:-1}
|
||||
--parallel-index ${CI_NODE_INDEX:-1}
|
||||
--modified-components ${MR_MODIFIED_COMPONENTS}
|
||||
--modified-files ${MR_MODIFIED_FILES}
|
||||
- upload_artifacts_to_s3
|
||||
--modified-components ${MODIFIED_COMPONENTS}
|
||||
--modified-files ${MODIFIED_FILES}
|
||||
- python tools/ci/artifacts_handler.py upload
|
||||
|
||||
build_pytest_test_apps_esp32:
|
||||
extends:
|
||||
@ -335,9 +335,9 @@ build_only_tools_test_apps:
|
||||
-t all
|
||||
--parallel-count ${CI_NODE_TOTAL:-1}
|
||||
--parallel-index ${CI_NODE_INDEX:-1}
|
||||
--modified-components ${MR_MODIFIED_COMPONENTS}
|
||||
--modified-files ${MR_MODIFIED_FILES}
|
||||
- upload_artifacts_to_s3
|
||||
--modified-components ${MODIFIED_COMPONENTS}
|
||||
--modified-files ${MODIFIED_FILES}
|
||||
- python tools/ci/artifacts_handler.py upload
|
||||
|
||||
.build_template_app_template:
|
||||
extends:
|
||||
@ -516,8 +516,10 @@ build_clang_test_apps_esp32c6:
|
||||
script:
|
||||
- ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
|
||||
- cd ${IDF_PATH}/tools/test_build_system
|
||||
- retry_failed git clone $KNOWN_FAILURE_CASES_REPO known_failure_cases
|
||||
- pytest --parallel-count ${CI_NODE_TOTAL:-1} --parallel-index ${CI_NODE_INDEX:-1}
|
||||
--work-dir ${CI_PROJECT_DIR}/test_build_system --junitxml=${CI_PROJECT_DIR}/XUNIT_RESULT.xml
|
||||
--ignore-result-files known_failure_cases/known_failure_cases.txt
|
||||
|
||||
pytest_build_system:
|
||||
extends: .test_build_system_template
|
||||
|
@ -6,9 +6,9 @@ stages:
|
||||
- pre_check
|
||||
- build
|
||||
- assign_test
|
||||
- build_doc
|
||||
- target_test
|
||||
- host_test
|
||||
- build_doc
|
||||
- test_deploy
|
||||
- deploy
|
||||
- post_deploy
|
||||
@ -21,15 +21,20 @@ variables:
|
||||
|
||||
# GitLab-CI environment
|
||||
|
||||
# XXX_ATTEMPTS variables (https://docs.gitlab.com/ee/ci/runners/configure_runners.html#job-stages-attempts) are not defined here.
|
||||
# Use values from "CI / CD Settings" - "Variables".
|
||||
|
||||
# GIT_STRATEGY is not defined here.
|
||||
# Use an option from "CI / CD Settings" - "General pipelines".
|
||||
|
||||
# now we have pack-objects cache, so clone strategy is faster than fetch
|
||||
GIT_STRATEGY: clone
|
||||
# we will download archive for each submodule instead of clone.
|
||||
# we don't do "recursive" when fetch submodule as they're not used in CI now.
|
||||
GIT_SUBMODULE_STRATEGY: none
|
||||
# since we're using merged-result pipelines, the last commit should work for most cases
|
||||
GIT_DEPTH: 1
|
||||
# --no-recurse-submodules: we use cache for submodules
|
||||
# --prune --prune-tags: in case remote branch or tag is force pushed
|
||||
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.2-dev
|
||||
|
||||
SUBMODULE_FETCH_TOOL: "tools/ci/ci_fetch_submodule.py"
|
||||
# by default we will fetch all submodules
|
||||
# jobs can overwrite this variable to only fetch submodules they required
|
||||
@ -39,20 +44,18 @@ variables:
|
||||
IDF_SKIP_CHECK_SUBMODULES: 1
|
||||
|
||||
IDF_PATH: "$CI_PROJECT_DIR"
|
||||
BATCH_BUILD: "1"
|
||||
V: "0"
|
||||
CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py"
|
||||
PYTHON_VER: 3.8.17
|
||||
|
||||
# Docker images
|
||||
ESP_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-env-v5.2:2"
|
||||
ESP_IDF_DOC_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.2:2-1"
|
||||
ESP_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-env-v5.2:2"
|
||||
ESP_IDF_DOC_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-doc-env-v5.2:2-1"
|
||||
QEMU_IMAGE: "${CI_DOCKER_REGISTRY}/qemu-v5.2:2-20230522"
|
||||
TARGET_TEST_ENV_IMAGE: "$CI_DOCKER_REGISTRY/target-test-env-v5.2:2"
|
||||
TARGET_TEST_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/target-test-env-v5.2:2"
|
||||
|
||||
SONARQUBE_SCANNER_IMAGE: "${CI_DOCKER_REGISTRY}/sonarqube-scanner:5"
|
||||
|
||||
PRE_COMMIT_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-pre-commit:1"
|
||||
PRE_COMMIT_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-pre-commit:1"
|
||||
|
||||
# target test repo parameters
|
||||
TEST_ENV_CONFIG_REPO: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/qa/ci-test-runner-configs.git"
|
||||
@ -92,6 +95,7 @@ variables:
|
||||
|
||||
if echo "$CI_MERGE_REQUEST_LABELS" | egrep "(^|,)include_nightly_run(,|$)"; then
|
||||
export INCLUDE_NIGHTLY_RUN="1"
|
||||
export NIGHTLY_RUN="1"
|
||||
fi
|
||||
|
||||
# configure cmake related flags
|
||||
@ -168,6 +172,11 @@ variables:
|
||||
# Show ccache statistics if enabled globally
|
||||
test "$CI_CCACHE_STATS" == 1 && test -n "$(which ccache)" && ccache --show-stats || true
|
||||
|
||||
.upload_failed_job_log_artifacts: &upload_failed_job_log_artifacts |
|
||||
if [ $CI_JOB_STATUS = "failed" ]; then
|
||||
python tools/ci/artifacts_handler.py upload --type logs
|
||||
fi
|
||||
|
||||
.before_script:minimal:
|
||||
before_script:
|
||||
- *common-before_scripts
|
||||
@ -194,6 +203,117 @@ variables:
|
||||
.after_script:build:ccache:
|
||||
after_script:
|
||||
- *show_ccache_statistics
|
||||
- *upload_failed_job_log_artifacts
|
||||
|
||||
##############################
|
||||
# Git Strategy Job Templates #
|
||||
##############################
|
||||
.git_init: &git_init |
|
||||
mkdir -p "${CI_PROJECT_DIR}"
|
||||
cd "${CI_PROJECT_DIR}"
|
||||
git init
|
||||
|
||||
.git_fetch_from_mirror_url_if_exists: &git_fetch_from_mirror_url_if_exists |
|
||||
# check if set mirror
|
||||
if [ -n "${LOCAL_GITLAB_HTTPS_HOST:-}" ] && [ -n "${ESPCI_TOKEN:-}" ]; then
|
||||
MIRROR_REPO_URL="https://bot:${ESPCI_TOKEN}@${LOCAL_GITLAB_HTTPS_HOST}/${CI_PROJECT_PATH}"
|
||||
elif [ -n "${LOCAL_GIT_MIRROR:-}" ]; then
|
||||
MIRROR_REPO_URL="${LOCAL_GIT_MIRROR}/${CI_PROJECT_PATH}"
|
||||
fi
|
||||
|
||||
# fetch from mirror first if set
|
||||
if [ -n "${MIRROR_REPO_URL:-}" ]; then
|
||||
if git remote -v | grep origin; then
|
||||
git remote set-url origin "${MIRROR_REPO_URL}"
|
||||
else
|
||||
git remote add origin "${MIRROR_REPO_URL}"
|
||||
fi
|
||||
# mirror url may fail with authentication issue
|
||||
git fetch origin --no-recurse-submodules || true
|
||||
fi
|
||||
|
||||
# set remote url to CI_REPOSITORY_URL
|
||||
if git remote -v | grep origin; then
|
||||
git remote set-url origin "${CI_REPOSITORY_URL}"
|
||||
else
|
||||
git remote add origin "${CI_REPOSITORY_URL}"
|
||||
fi
|
||||
|
||||
.git_checkout_fetch_head: &git_checkout_fetch_head |
|
||||
git checkout FETCH_HEAD
|
||||
git clean ${GIT_CLEAN_FLAGS}
|
||||
|
||||
# git diff requires two commits, with different CI env var
|
||||
#
|
||||
# By default, we use git strategy "clone" with depth 1 to speed up the clone process.
|
||||
# But for jobs requires running `git diff`, we need to fetch more commits to get the correct diffs.
|
||||
#
|
||||
# Since there's no way to get the correct git_depth before the job starts,
|
||||
# we can't set `GIT_DEPTH` in the job definition.
|
||||
#
|
||||
# Set git strategy to "none" and fetch manually instead.
|
||||
.before_script:fetch:git_diff:
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
before_script:
|
||||
- *git_init
|
||||
- *git_fetch_from_mirror_url_if_exists
|
||||
- |
|
||||
# merged results pipelines, by default
|
||||
if [[ -n $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA ]]; then
|
||||
git fetch origin $CI_MERGE_REQUEST_DIFF_BASE_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
|
||||
git fetch origin $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
|
||||
export GIT_DIFF_OUTPUT=$(git diff --name-only $CI_MERGE_REQUEST_DIFF_BASE_SHA $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA)
|
||||
# merge request pipelines, when the mr got conflicts
|
||||
elif [[ -n $CI_MERGE_REQUEST_DIFF_BASE_SHA ]]; then
|
||||
git fetch origin $CI_MERGE_REQUEST_DIFF_BASE_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
|
||||
git fetch origin $CI_COMMIT_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
|
||||
export GIT_DIFF_OUTPUT=$(git diff --name-only $CI_MERGE_REQUEST_DIFF_BASE_SHA $CI_COMMIT_SHA)
|
||||
# other pipelines, like the protected branches pipelines
|
||||
elif [[ "$CI_COMMIT_BEFORE_SHA" != "0000000000000000000000000000000000000000" ]]; then
|
||||
git fetch origin $CI_COMMIT_BEFORE_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
|
||||
git fetch origin $CI_COMMIT_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
|
||||
export GIT_DIFF_OUTPUT=$(git diff --name-only $CI_COMMIT_BEFORE_SHA $CI_COMMIT_SHA)
|
||||
else
|
||||
# pipeline source could be web, scheduler, etc.
|
||||
git fetch origin $CI_COMMIT_SHA --depth=2 ${GIT_FETCH_EXTRA_FLAGS}
|
||||
export GIT_DIFF_OUTPUT=$(git diff --name-only $CI_COMMIT_SHA~1 $CI_COMMIT_SHA)
|
||||
fi
|
||||
- *git_checkout_fetch_head
|
||||
- *common-before_scripts
|
||||
- *setup_tools_and_idf_python_venv
|
||||
- add_gitlab_ssh_keys
|
||||
|
||||
# git describe requires commit history until the latest tag
|
||||
.before_script:fetch:git_describe:
|
||||
variables:
|
||||
GIT_STRAEGY: none
|
||||
before_script:
|
||||
- *git_init
|
||||
- *git_fetch_from_mirror_url_if_exists
|
||||
- |
|
||||
git fetch origin refs/tags/"${LATEST_GIT_TAG}":refs/tags/"${LATEST_GIT_TAG}" --depth=1
|
||||
git repack -d
|
||||
git fetch origin $CI_COMMIT_SHA --shallow-since=$(git log -1 --format=%as "${LATEST_GIT_TAG}")
|
||||
- *git_checkout_fetch_head
|
||||
- *common-before_scripts
|
||||
- *setup_tools_and_idf_python_venv
|
||||
- add_gitlab_ssh_keys
|
||||
|
||||
# target test runners may locate in different places
|
||||
# for runners set git mirror, we fetch from the mirror first, then fetch the HEAD commit
|
||||
.before_script:fetch:target_test:
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
before_script:
|
||||
- *git_init
|
||||
- *git_fetch_from_mirror_url_if_exists
|
||||
- git fetch origin "${CI_COMMIT_SHA}" --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
|
||||
- *git_checkout_fetch_head
|
||||
- *common-before_scripts
|
||||
- *setup_tools_and_idf_python_venv
|
||||
- add_gitlab_ssh_keys
|
||||
# no submodules
|
||||
|
||||
#############
|
||||
# `default` #
|
||||
|
@ -83,16 +83,6 @@
|
||||
- "build:{0}"
|
||||
- build:target_test
|
||||
|
||||
build:integration_test:
|
||||
labels:
|
||||
- build
|
||||
patterns:
|
||||
- build_components
|
||||
- build_system
|
||||
included_in:
|
||||
- build:target_test
|
||||
|
||||
|
||||
####################
|
||||
# Target Test Jobs #
|
||||
####################
|
||||
@ -173,23 +163,6 @@ build:integration_test:
|
||||
- "build:example_test"
|
||||
- build:target_test
|
||||
|
||||
"test:integration_test_{0}":
|
||||
matrix:
|
||||
- - wifi
|
||||
- ble
|
||||
labels:
|
||||
- integration_test_{0}
|
||||
- integration_test
|
||||
- target_test
|
||||
patterns:
|
||||
- integration_test-{0}
|
||||
- target_test-{0}
|
||||
# - maybe others
|
||||
included_in:
|
||||
- test:integration_test
|
||||
- build:integration_test
|
||||
- build:target_test
|
||||
|
||||
"test:host_test":
|
||||
labels:
|
||||
- host_test
|
||||
|
@ -1,8 +1,7 @@
|
||||
.deploy_job_template:
|
||||
stage: deploy
|
||||
image: $ESP_ENV_IMAGE
|
||||
tags:
|
||||
- deploy
|
||||
tags: [ deploy ]
|
||||
|
||||
# Check this before push_to_github
|
||||
check_submodule_sync:
|
||||
@ -10,11 +9,11 @@ check_submodule_sync:
|
||||
- .deploy_job_template
|
||||
- .rules:test:submodule
|
||||
stage: test_deploy
|
||||
tags:
|
||||
- github_sync
|
||||
tags: [ brew, github_sync ]
|
||||
retry: 2
|
||||
variables:
|
||||
GIT_STRATEGY: clone
|
||||
# for brew runners, we always set GIT_STRATEGY to fetch
|
||||
GIT_STRATEGY: fetch
|
||||
SUBMODULES_TO_FETCH: "none"
|
||||
PUBLIC_IDF_URL: "https://github.com/espressif/esp-idf.git"
|
||||
dependencies: []
|
||||
@ -35,6 +34,12 @@ push_to_github:
|
||||
- .rules:push_to_github
|
||||
needs:
|
||||
- check_submodule_sync
|
||||
tags: [ brew, github_sync ]
|
||||
variables:
|
||||
# for brew runners, we always set GIT_STRATEGY to fetch
|
||||
GIT_STRATEGY: fetch
|
||||
# github also need full record of commits
|
||||
GIT_DEPTH: 0
|
||||
script:
|
||||
- add_github_ssh_keys
|
||||
- git remote remove github &>/dev/null || true
|
||||
@ -47,6 +52,9 @@ deploy_update_SHA_in_esp-dockerfiles:
|
||||
- .before_script:minimal
|
||||
- .rules:protected-no_label-always
|
||||
dependencies: []
|
||||
variables:
|
||||
GIT_DEPTH: 2
|
||||
tags: [ shiny, build ]
|
||||
script:
|
||||
- 'curl --header "PRIVATE-TOKEN: ${ESPCI_SCRIPTS_TOKEN}" -o create_MR_in_esp_dockerfile.sh $GITLAB_HTTP_SERVER/api/v4/projects/1260/repository/files/create_MR_in_esp_dockerfile%2Fcreate_MR_in_esp_dockerfile.sh/raw\?ref\=master'
|
||||
- chmod +x create_MR_in_esp_dockerfile.sh
|
||||
|
@ -37,16 +37,25 @@
|
||||
.if-dev-push: &if-dev-push
|
||||
if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_COMMIT_TAG !~ /^qa-test/ && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event")'
|
||||
|
||||
.if-schedule: &if-schedule
|
||||
if: '$CI_PIPELINE_SOURCE == "schedule"'
|
||||
|
||||
.doc-rules:build:docs-full:
|
||||
rules:
|
||||
- <<: *if-qa-test-tag
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-schedule
|
||||
- <<: *if-label-build_docs
|
||||
- <<: *if-label-docs_full
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-docs-full
|
||||
|
||||
.doc-rules:build:docs-full-prod:
|
||||
rules:
|
||||
- <<: *if-qa-test-tag
|
||||
when: never
|
||||
- <<: *if-protected-no_label
|
||||
|
||||
.doc-rules:build:docs-partial:
|
||||
rules:
|
||||
- <<: *if-qa-test-tag
|
||||
@ -83,10 +92,6 @@ check_docs_lang_sync:
|
||||
stage: build_doc
|
||||
tags:
|
||||
- build_docs
|
||||
needs:
|
||||
- job: fast_template_app
|
||||
artifacts: false
|
||||
optional: true
|
||||
script:
|
||||
- cd docs
|
||||
- build-docs -t $DOCTGT -bs $DOC_BUILDERS -l $DOCLANG build
|
||||
@ -110,6 +115,24 @@ build_docs_html_full:
|
||||
extends:
|
||||
- .build_docs_template
|
||||
- .doc-rules:build:docs-full
|
||||
needs:
|
||||
- job: fast_template_app
|
||||
artifacts: false
|
||||
optional: true
|
||||
artifacts:
|
||||
when: always
|
||||
paths:
|
||||
- docs/_build/*/*/*.txt
|
||||
- docs/_build/*/*/html/*
|
||||
expire_in: 4 days
|
||||
variables:
|
||||
DOC_BUILDERS: "html"
|
||||
|
||||
build_docs_html_full_prod:
|
||||
extends:
|
||||
- .build_docs_template
|
||||
- .doc-rules:build:docs-full-prod
|
||||
dependencies: [] # Stop build_docs jobs from downloading all previous job's artifacts
|
||||
artifacts:
|
||||
when: always
|
||||
paths:
|
||||
@ -123,6 +146,10 @@ build_docs_html_partial:
|
||||
extends:
|
||||
- .build_docs_template
|
||||
- .doc-rules:build:docs-partial
|
||||
needs:
|
||||
- job: fast_template_app
|
||||
artifacts: false
|
||||
optional: true
|
||||
artifacts:
|
||||
when: always
|
||||
paths:
|
||||
@ -142,6 +169,23 @@ build_docs_pdf:
|
||||
extends:
|
||||
- .build_docs_template
|
||||
- .doc-rules:build:docs-full
|
||||
needs:
|
||||
- job: fast_template_app
|
||||
artifacts: false
|
||||
optional: true
|
||||
artifacts:
|
||||
when: always
|
||||
paths:
|
||||
- docs/_build/*/*/latex/*
|
||||
expire_in: 4 days
|
||||
variables:
|
||||
DOC_BUILDERS: "latex"
|
||||
|
||||
build_docs_pdf_prod:
|
||||
extends:
|
||||
- .build_docs_template
|
||||
- .doc-rules:build:docs-full-prod
|
||||
dependencies: [] # Stop build_docs jobs from downloading all previous job's artifacts
|
||||
artifacts:
|
||||
when: always
|
||||
paths:
|
||||
@ -194,13 +238,12 @@ deploy_docs_production:
|
||||
# The DOCS_PROD_* variables used by this job are "Protected" so these branches must all be marked "Protected" in Gitlab settings
|
||||
extends:
|
||||
- .deploy_docs_template
|
||||
rules:
|
||||
- <<: *if-protected-no_label
|
||||
- .doc-rules:build:docs-full-prod
|
||||
stage: post_deploy
|
||||
dependencies: # set dependencies to null to avoid missing artifacts issue
|
||||
needs: # ensure runs after push_to_github succeeded
|
||||
- build_docs_html_full
|
||||
- build_docs_pdf
|
||||
- build_docs_html_full_prod
|
||||
- build_docs_pdf_prod
|
||||
- job: push_to_github
|
||||
artifacts: false
|
||||
variables:
|
||||
@ -215,8 +258,7 @@ deploy_docs_production:
|
||||
check_doc_links:
|
||||
extends:
|
||||
- .build_docs_template
|
||||
rules:
|
||||
- <<: *if-protected-no_label
|
||||
- .doc-rules:build:docs-full-prod
|
||||
stage: post_deploy
|
||||
needs:
|
||||
- job: deploy_docs_production
|
||||
|
@ -13,8 +13,7 @@
|
||||
- job: upload-submodules-cache
|
||||
optional: true
|
||||
artifacts: false
|
||||
- job: mr_variables
|
||||
optional: true # only MR pipelines would have this
|
||||
- pipeline_variables
|
||||
|
||||
test_nvs_on_host:
|
||||
extends: .host_test_template
|
||||
@ -208,14 +207,6 @@ test_mkdfu:
|
||||
- cd ${IDF_PATH}/tools/test_mkdfu
|
||||
- ./test_mkdfu.py
|
||||
|
||||
test_sbom:
|
||||
extends:
|
||||
- .host_test_template
|
||||
- .rules:patterns:sbom
|
||||
script:
|
||||
- cd ${IDF_PATH}/tools/test_sbom
|
||||
- pytest
|
||||
|
||||
test_autocomplete:
|
||||
extends:
|
||||
- .host_test_template
|
||||
@ -314,8 +305,8 @@ test_pytest_qemu:
|
||||
--pytest-apps
|
||||
-m qemu
|
||||
--collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
|
||||
--modified-components ${MR_MODIFIED_COMPONENTS}
|
||||
--modified-files ${MR_MODIFIED_FILES}
|
||||
--modified-components ${MODIFIED_COMPONENTS}
|
||||
--modified-files ${MODIFIED_FILES}
|
||||
- retry_failed git clone $KNOWN_FAILURE_CASES_REPO known_failure_cases
|
||||
- run_cmd pytest
|
||||
--target $IDF_TARGET
|
||||
@ -334,6 +325,7 @@ test_pytest_linux:
|
||||
paths:
|
||||
- XUNIT_RESULT.xml
|
||||
- pytest_embedded_log/
|
||||
- "**/build*/build_log.txt"
|
||||
reports:
|
||||
junit: XUNIT_RESULT.xml
|
||||
expire_in: 1 week
|
||||
@ -343,8 +335,8 @@ test_pytest_linux:
|
||||
--pytest-apps
|
||||
-m host_test
|
||||
--collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
|
||||
--modified-components ${MR_MODIFIED_COMPONENTS}
|
||||
--modified-files ${MR_MODIFIED_FILES}
|
||||
--modified-components ${MODIFIED_COMPONENTS}
|
||||
--modified-files ${MODIFIED_FILES}
|
||||
- retry_failed git clone $KNOWN_FAILURE_CASES_REPO known_failure_cases
|
||||
- run_cmd pytest
|
||||
--target linux
|
||||
|
@ -8,7 +8,7 @@
|
||||
- "tools/**/*"
|
||||
- ".gitlab-ci.yml"
|
||||
- ".gitlab/ci/common.yml"
|
||||
- ".gitlab/ci/integration-test.yml"
|
||||
- ".gitlab/ci/integration_test.yml"
|
||||
- ".gitmodules"
|
||||
- "CMakeLists.txt"
|
||||
- "install.sh"
|
||||
@ -22,6 +22,10 @@
|
||||
- if: '$CI_PIPELINE_SOURCE != "merge_request_event"'
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
changes: *patterns-integration_test
|
||||
# support trigger by ci labels
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*target_test(?:,[^,\n\r]+)*$/i'
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*integration_test(?:,[^,\n\r]+)*$/i'
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*build(?:,[^,\n\r]+)*$/i'
|
||||
|
||||
gen_integration_pipeline:
|
||||
extends:
|
||||
|
@ -5,27 +5,16 @@
|
||||
- host_test
|
||||
dependencies: []
|
||||
|
||||
.check_pre_commit_template:
|
||||
check_pre_commit:
|
||||
extends:
|
||||
- .pre_check_template
|
||||
- .before_script:minimal
|
||||
image: $PRE_COMMIT_IMAGE
|
||||
|
||||
check_pre_commit_master_release:
|
||||
extends:
|
||||
- .check_pre_commit_template
|
||||
- .rules:protected
|
||||
needs:
|
||||
- pipeline_variables
|
||||
script:
|
||||
- fetch_submodules
|
||||
- git diff-tree --no-commit-id --name-only -r $PIPELINE_COMMIT_SHA | xargs pre-commit run --files
|
||||
|
||||
check_pre_commit_MR:
|
||||
extends:
|
||||
- .check_pre_commit_template
|
||||
- .rules:mr
|
||||
script:
|
||||
- fetch_submodules
|
||||
- python ${CI_PROJECT_DIR}/tools/ci/ci_get_mr_info.py files ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} | xargs pre-commit run --files
|
||||
- pre-commit run --files $MODIFIED_FILES
|
||||
|
||||
check_MR_style_dangerjs:
|
||||
extends:
|
||||
@ -60,6 +49,7 @@ check_version:
|
||||
extends:
|
||||
- .pre_check_template
|
||||
- .rules:protected
|
||||
- .before_script:fetch:git_describe
|
||||
script:
|
||||
- export IDF_PATH=$PWD
|
||||
- tools/ci/check_idf_version.sh
|
||||
@ -148,10 +138,12 @@ check_esp_system:
|
||||
|
||||
# For release tag pipelines only, make sure the tag was created with 'git tag -a' so it will update
|
||||
# the version returned by 'git describe'
|
||||
# Don't forget to update the env var `LATEST_GIT_TAG` in .gitlab/ci/common.yml
|
||||
check_version_tag:
|
||||
extends:
|
||||
- .pre_check_template
|
||||
- .rules:tag:release
|
||||
- .before_script:fetch:git_describe
|
||||
script:
|
||||
- (git cat-file -t $CI_COMMIT_REF_NAME | grep tag) || (echo "ESP-IDF versions must be annotated tags." && exit 1)
|
||||
|
||||
@ -179,22 +171,23 @@ check_configure_ci_environment_parsing:
|
||||
- cd tools/ci
|
||||
- python -m unittest ci_build_apps.py
|
||||
|
||||
mr_variables:
|
||||
pipeline_variables:
|
||||
extends:
|
||||
- .pre_check_template
|
||||
- .rules:mr
|
||||
- .before_script:minimal
|
||||
- .before_script:fetch:git_diff
|
||||
tags:
|
||||
- build
|
||||
script:
|
||||
- echo "MR_MODIFIED_FILES=$(python tools/ci/ci_get_mr_info.py files ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} | xargs)" >> mr.env
|
||||
- echo "MR_MODIFIED_COMPONENTS=$(python tools/ci/ci_get_mr_info.py components ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} | xargs)" >> mr.env
|
||||
- >
|
||||
- MODIFIED_FILES=$(echo "$GIT_DIFF_OUTPUT" | xargs)
|
||||
- echo "MODIFIED_FILES=$MODIFIED_FILES" >> pipeline.env
|
||||
- echo "MODIFIED_COMPONENTS=$(run_cmd python tools/ci/ci_get_mr_info.py components --modified-files $MODIFIED_FILES | xargs)" >> pipeline.env
|
||||
- |
|
||||
if echo "$CI_MERGE_REQUEST_LABELS" | egrep "(^|,)BUILD_AND_TEST_ALL_APPS(,|$)"; then
|
||||
echo "BUILD_AND_TEST_ALL_APPS=1" >> mr.env
|
||||
echo "BUILD_AND_TEST_ALL_APPS=1" >> pipeline.env
|
||||
fi
|
||||
- cat mr.env
|
||||
- cat pipeline.env
|
||||
- python tools/ci/artifacts_handler.py upload --type modified_files_and_components_report
|
||||
artifacts:
|
||||
reports:
|
||||
dotenv: mr.env
|
||||
dotenv: pipeline.env
|
||||
expire_in: 4 days
|
||||
|
@ -67,9 +67,6 @@
|
||||
- "tools/ci/ci_build_apps.py"
|
||||
- "tools/test_build_system/**/*"
|
||||
|
||||
.patterns-sbom: &patterns-sbom
|
||||
- "tools/test_sbom/*"
|
||||
|
||||
.patterns-custom_test: &patterns-custom_test
|
||||
- "tools/ci/idf_pytest/**/*"
|
||||
- "tools/ci/python_packages/gitlab_api.py"
|
||||
@ -112,22 +109,6 @@
|
||||
.patterns-component_ut-wifi: &patterns-component_ut-wifi
|
||||
- "components/esp_wifi/**/*"
|
||||
|
||||
.patterns-integration_test-ble: &patterns-integration_test-ble
|
||||
- "tools/ci/python_packages/gitlab_api.py"
|
||||
- "tools/ci/integration_test/**/*"
|
||||
- "components/bt/controller/lib_esp32"
|
||||
- "components/bt/controller/lib_esp32c3_family"
|
||||
- "components/bt/controller/lib_esp32h2/esp32h2-bt-lib"
|
||||
- "components/bt/host/nimble/nimble"
|
||||
- "components/esp_phy/lib"
|
||||
- "components/esp_coex/??[!s][!t]*/**/*"
|
||||
- "components/esp_coex/???/**/*"
|
||||
- "components/esp_coex/*"
|
||||
|
||||
.patterns-integration_test-wifi: &patterns-integration_test-wifi
|
||||
- "tools/ci/python_packages/gitlab_api.py"
|
||||
- "tools/ci/integration_test/**/*"
|
||||
|
||||
.patterns-build_macos: &patterns-build_macos
|
||||
- "tools/ci/test_configure_ci_environment.sh"
|
||||
|
||||
@ -213,6 +194,7 @@
|
||||
- "components/unity/unity"
|
||||
- "components/heap/tlsf"
|
||||
- "components/bt/controller/lib_esp32c6/esp32c6-bt-lib"
|
||||
- "components/bt/esp_ble_mesh/lib/lib"
|
||||
- ".gitmodules"
|
||||
|
||||
.patterns-danger-npm: &patterns-danger-npm
|
||||
@ -461,14 +443,6 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-sonarqube-files
|
||||
|
||||
.rules:patterns:sbom:
|
||||
rules:
|
||||
- <<: *if-protected
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-sbom
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-submodule
|
||||
|
||||
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
# DO NOT place comments or maintain any code from this line
|
||||
#
|
||||
@ -571,15 +545,6 @@
|
||||
.if-label-host_test: &if-label-host_test
|
||||
if: '$BOT_LABEL_HOST_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*host_test(?:,[^,\n\r]+)*$/i'
|
||||
|
||||
.if-label-integration_test: &if-label-integration_test
|
||||
if: '$BOT_LABEL_INTEGRATION_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*integration_test(?:,[^,\n\r]+)*$/i'
|
||||
|
||||
.if-label-integration_test_ble: &if-label-integration_test_ble
|
||||
if: '$BOT_LABEL_INTEGRATION_TEST_BLE || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*integration_test_ble(?:,[^,\n\r]+)*$/i'
|
||||
|
||||
.if-label-integration_test_wifi: &if-label-integration_test_wifi
|
||||
if: '$BOT_LABEL_INTEGRATION_TEST_WIFI || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*integration_test_wifi(?:,[^,\n\r]+)*$/i'
|
||||
|
||||
.if-label-macos: &if-label-macos
|
||||
if: '$BOT_LABEL_MACOS || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*macos(?:,[^,\n\r]+)*$/i'
|
||||
|
||||
@ -1584,9 +1549,6 @@
|
||||
- <<: *if-label-example_test_esp32p4
|
||||
- <<: *if-label-example_test_esp32s2
|
||||
- <<: *if-label-example_test_esp32s3
|
||||
- <<: *if-label-integration_test
|
||||
- <<: *if-label-integration_test_ble
|
||||
- <<: *if-label-integration_test_wifi
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-build-example_test
|
||||
@ -1634,10 +1596,6 @@
|
||||
changes: *patterns-example_test-usb
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-example_test-wifi
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-integration_test-ble
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-integration_test-wifi
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-target_test-adc
|
||||
- <<: *if-dev-push
|
||||
|
@ -20,6 +20,8 @@ check_pylint:
|
||||
extends:
|
||||
- .pre_check_template
|
||||
- .rules:patterns:python-files
|
||||
needs:
|
||||
- pipeline_variables
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
@ -28,9 +30,9 @@ check_pylint:
|
||||
script:
|
||||
- |
|
||||
if [ -n "$CI_MERGE_REQUEST_IID" ]; then
|
||||
export files=$(python ${CI_PROJECT_DIR}/tools/ci/ci_get_mr_info.py files ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} | grep ".py$");
|
||||
export files=$(echo "$GIT_DIFF_OUTPUT" | grep ".py$" | xargs);
|
||||
else
|
||||
export files=$(find . -iname "*.py" -print);
|
||||
export files=$(git ls-files "*.py" | xargs);
|
||||
fi
|
||||
- if [ -z "$files" ]; then echo "No python files found"; exit 0; fi
|
||||
- run_cmd pylint --exit-zero --load-plugins=pylint_gitlab --output-format=gitlab-codeclimate:pylint.json $files
|
||||
@ -82,7 +84,7 @@ code_quality_check:
|
||||
allow_failure: true # since now it's using exit code to indicate the code analysis result,
|
||||
# we don't want to block ci when critical issues founded
|
||||
script:
|
||||
- export CI_MERGE_REQUEST_COMMITS=$(python ${CI_PROJECT_DIR}/tools/ci/ci_get_mr_info.py commits ${CI_COMMIT_REF_NAME} | tr '\n' ',')
|
||||
- export CI_MERGE_REQUEST_COMMITS=$(python ${CI_PROJECT_DIR}/tools/ci/ci_get_mr_info.py commits --src-branch ${CI_COMMIT_REF_NAME} | tr '\n' ',')
|
||||
# test if this branch have merge request, if not, exit 0
|
||||
- test -n "$CI_MERGE_REQUEST_IID" || exit 0
|
||||
- test -n "$CI_MERGE_REQUEST_COMMITS" || exit 0
|
||||
|
@ -1,17 +1,18 @@
|
||||
.target_test_template:
|
||||
image: $TARGET_TEST_ENV_IMAGE
|
||||
extends:
|
||||
- .before_script:fetch:target_test
|
||||
stage: target_test
|
||||
timeout: 1 hour
|
||||
dependencies: []
|
||||
variables:
|
||||
GIT_DEPTH: 1
|
||||
SUBMODULES_TO_FETCH: "none"
|
||||
cache:
|
||||
# Usually do not need submodule-cache in target_test
|
||||
- key: pip-cache
|
||||
paths:
|
||||
- .cache/pip
|
||||
policy: pull
|
||||
after_script:
|
||||
- python tools/ci/artifacts_handler.py upload --type logs junit_reports
|
||||
|
||||
.pytest_template:
|
||||
extends:
|
||||
|
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -143,3 +143,7 @@
|
||||
[submodule "components/esp_coex/lib"]
|
||||
path = components/esp_coex/lib
|
||||
url = ../../espressif/esp-coex-lib.git
|
||||
|
||||
[submodule "components/bt/esp_ble_mesh/lib/lib"]
|
||||
path = components/bt/esp_ble_mesh/lib/lib
|
||||
url = ../../espressif/esp-ble-mesh-lib.git
|
||||
|
@ -177,12 +177,6 @@ repos:
|
||||
always_run: true
|
||||
pass_filenames: false
|
||||
require_serial: true
|
||||
- id: submodule-sbom-hash-check
|
||||
name: Check if sbom-hash values for submodules in .gitmodules match submodules checkout hash in git tree
|
||||
entry: python tools/test_sbom/test_submodules.py
|
||||
language: python
|
||||
always_run: true
|
||||
pass_filenames: false
|
||||
- id: cleanup-ignore-lists
|
||||
name: Remove non-existing patterns from ignore lists
|
||||
entry: tools/ci/cleanup_ignore_lists.py
|
||||
@ -205,7 +199,7 @@ repos:
|
||||
- id: conventional-precommit-linter
|
||||
stages: [commit-msg]
|
||||
- repo: https://github.com/espressif/astyle_py.git
|
||||
rev: v1.0.2
|
||||
rev: v1.0.5
|
||||
hooks:
|
||||
- id: astyle_py
|
||||
# If you are modifying astyle version, update tools/format.sh as well
|
||||
@ -221,3 +215,7 @@ repos:
|
||||
name: shellcheck dash (export.sh)
|
||||
args: ['--shell', 'dash', '-x']
|
||||
files: 'export.sh'
|
||||
- repo: https://github.com/espressif/esp-idf-sbom.git
|
||||
rev: v0.11.0
|
||||
hooks:
|
||||
- id: validate-sbom-manifest
|
||||
|
@ -199,13 +199,18 @@ esp_err_t esp_ota_write(esp_ota_handle_t handle, const void *data, size_t size)
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
if (size == 0) {
|
||||
ESP_LOGD(TAG, "write data size is 0");
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
// find ota handle in linked list
|
||||
for (it = LIST_FIRST(&s_ota_ops_entries_head); it != NULL; it = LIST_NEXT(it, entries)) {
|
||||
if (it->handle == handle) {
|
||||
if (it->need_erase) {
|
||||
// must erase the partition before writing to it
|
||||
uint32_t first_sector = it->wrote_size / SPI_FLASH_SEC_SIZE;
|
||||
uint32_t last_sector = (it->wrote_size + size) / SPI_FLASH_SEC_SIZE;
|
||||
uint32_t first_sector = it->wrote_size / SPI_FLASH_SEC_SIZE; // first affected sector
|
||||
uint32_t last_sector = (it->wrote_size + size - 1) / SPI_FLASH_SEC_SIZE; // last affected sector
|
||||
|
||||
ret = ESP_OK;
|
||||
if ((it->wrote_size % SPI_FLASH_SEC_SIZE) == 0) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -111,7 +111,7 @@ esp_err_t esp_ota_begin(const esp_partition_t* partition, size_t image_size, esp
|
||||
* @param size Size of data buffer in bytes.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: Data was written to flash successfully.
|
||||
* - ESP_OK: Data was written to flash successfully, or size = 0
|
||||
* - ESP_ERR_INVALID_ARG: handle is invalid.
|
||||
* - ESP_ERR_OTA_VALIDATE_FAILED: First byte of image contains invalid app image magic byte.
|
||||
* - ESP_ERR_FLASH_OP_TIMEOUT or ESP_ERR_FLASH_OP_FAIL: Flash write failed.
|
||||
|
@ -139,7 +139,7 @@ menu "Bootloader config"
|
||||
|
||||
config BOOTLOADER_CACHE_32BIT_ADDR_OCTAL_FLASH
|
||||
bool
|
||||
default y if ESPTOOLPY_OCT_FLASH && SPI_FLASH_32BIT_ADDRESS
|
||||
default y if ESPTOOLPY_OCT_FLASH && BOOTLOADER_FLASH_32BIT_ADDR
|
||||
default n
|
||||
|
||||
endmenu
|
||||
|
@ -9,9 +9,9 @@
|
||||
* Make sure the bootloader can load into main memory without overwriting itself.
|
||||
*
|
||||
* ESP32-P4 ROM static data usage is as follows:
|
||||
* - 0x4086ad08 - 0x4087c610: Shared buffers, used in UART/USB/SPI download mode only
|
||||
* - 0x4087c610 - 0x4087e610: CPU1 stack, can be reclaimed as heap after RTOS startup
|
||||
* - 0x4087e610 - 0x40880000: ROM .bss and .data (not easily reclaimable)
|
||||
* - 0x4ff296b8 - 0x4ff3afc0: Shared buffers, used in UART/USB/SPI download mode only
|
||||
* - 0x4ff3afc0 - 0x4ff3fba4: CPU1 stack, can be reclaimed as heap after RTOS startup
|
||||
* - 0x4ff3fba4 - 0x4ff40000: ROM .bss and .data (not easily reclaimable)
|
||||
*
|
||||
* The 2nd stage bootloader can take space up to the end of ROM shared
|
||||
* buffers area (0x4087c610).
|
||||
@ -217,34 +217,38 @@ SECTIONS
|
||||
/**
|
||||
* Appendix: Memory Usage of ROM bootloader
|
||||
*
|
||||
* 0x4086ad08 ------------------> _dram0_0_start
|
||||
* 0x4ff296b8 ------------------> _dram0_0_start
|
||||
* | |
|
||||
* | |
|
||||
* | | 1. Large buffers that are only used in certain boot modes, see shared_buffers.h
|
||||
* | |
|
||||
* | |
|
||||
* 0x4087c610 ------------------> __stack_sentry
|
||||
* 0x4ff3afc0 ------------------> __stack_sentry
|
||||
* | |
|
||||
* | | 2. Startup pro cpu stack (freed when IDF app is running)
|
||||
* | |
|
||||
* 0x4087e610 ------------------> __stack (pro cpu)
|
||||
* 0x4ff3cfc0 ------------------> __stack (pro cpu)
|
||||
* | |
|
||||
* | | Startup app cpu stack
|
||||
* | |
|
||||
* 0x4ff3efc0 ------------------> __stack_app (app cpu)
|
||||
* | |
|
||||
* | |
|
||||
* | | 3. Shared memory only used in startup code or nonos/early boot*
|
||||
* | | (can be freed when IDF runs)
|
||||
* | |
|
||||
* | |
|
||||
* 0x4087f564 ------------------> _dram0_rtos_reserved_start
|
||||
* 0x4ff3fba4 ------------------> _dram0_rtos_reserved_start
|
||||
* | |
|
||||
* | |
|
||||
* | | 4. Shared memory used in startup code and when IDF runs
|
||||
* | |
|
||||
* | |
|
||||
* 0x4087fab0 ------------------> _dram0_rtos_reserved_end
|
||||
* 0x4ff3ff94 ------------------> _dram0_rtos_reserved_end
|
||||
* | |
|
||||
* 0x4087fce8 ------------------> _data_start_interface
|
||||
* 0x4ff3ffc8 ------------------> _data_start_interface
|
||||
* | |
|
||||
* | | 5. End of DRAM is the 'interface' data with constant addresses (ECO compatible)
|
||||
* | |
|
||||
* 0x40880000 ------------------> _data_end_interface
|
||||
* 0x4ff40000 ------------------> _data_end_interface
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -18,6 +18,9 @@
|
||||
#include "esp32s2/rom/usb/cdc_acm.h"
|
||||
#include "esp32s2/rom/usb/usb_common.h"
|
||||
#endif
|
||||
#if SOC_USB_SERIAL_JTAG_SUPPORTED
|
||||
#include "hal/usb_phy_ll.h"
|
||||
#endif
|
||||
#include "esp_rom_gpio.h"
|
||||
#include "esp_rom_uart.h"
|
||||
#include "esp_rom_sys.h"
|
||||
@ -35,6 +38,7 @@ void bootloader_console_init(void)
|
||||
void bootloader_console_init(void)
|
||||
{
|
||||
const int uart_num = CONFIG_ESP_CONSOLE_UART_NUM;
|
||||
int __DECLARE_RCC_ATOMIC_ENV __attribute__ ((unused)); // To avoid build errors/warnings about __DECLARE_RCC_ATOMIC_ENV
|
||||
|
||||
// Install rom uart printf as console.
|
||||
esp_rom_install_uart_printf();
|
||||
@ -56,8 +60,8 @@ void bootloader_console_init(void)
|
||||
uart_tx_gpio != UART_NUM_0_TXD_DIRECT_GPIO_NUM ||
|
||||
uart_rx_gpio != UART_NUM_0_RXD_DIRECT_GPIO_NUM) {
|
||||
// Change default UART pins back to GPIOs
|
||||
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_U0RXD_U, PIN_FUNC_GPIO);
|
||||
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_U0TXD_U, PIN_FUNC_GPIO);
|
||||
gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[UART_NUM_0_RXD_DIRECT_GPIO_NUM], PIN_FUNC_GPIO);
|
||||
gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[UART_NUM_0_TXD_DIRECT_GPIO_NUM], PIN_FUNC_GPIO);
|
||||
// Route GPIO signals to/from pins
|
||||
const uint32_t tx_idx = UART_PERIPH_SIGNAL(uart_num, SOC_UART_TX_PIN_IDX);
|
||||
const uint32_t rx_idx = UART_PERIPH_SIGNAL(uart_num, SOC_UART_RX_PIN_IDX);
|
||||
@ -68,7 +72,11 @@ void bootloader_console_init(void)
|
||||
esp_rom_gpio_connect_in_signal(uart_rx_gpio, rx_idx, 0);
|
||||
gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[uart_tx_gpio], PIN_FUNC_GPIO);
|
||||
// Enable the peripheral
|
||||
periph_ll_enable_clk_clear_rst(PERIPH_UART0_MODULE + uart_num);
|
||||
uart_ll_enable_bus_clock(uart_num, true);
|
||||
uart_ll_reset_register(uart_num);
|
||||
// Reset TX and RX FIFOs
|
||||
uart_ll_txfifo_rst(UART_LL_GET_HW(uart_num));
|
||||
uart_ll_rxfifo_rst(UART_LL_GET_HW(uart_num));
|
||||
}
|
||||
#endif // CONFIG_ESP_CONSOLE_UART_CUSTOM
|
||||
|
||||
@ -77,7 +85,6 @@ void bootloader_console_init(void)
|
||||
#if ESP_ROM_UART_CLK_IS_XTAL
|
||||
clock_hz = (uint32_t)rtc_clk_xtal_freq_get() * MHZ; // From esp32-s3 on, UART clk source is selected to XTAL in ROM
|
||||
#endif
|
||||
int __DECLARE_RCC_ATOMIC_ENV __attribute__ ((unused)); // To avoid build errors/warnings about __DECLARE_RCC_ATOMIC_ENV
|
||||
esp_rom_uart_set_clock_baudrate(uart_num, clock_hz, CONFIG_ESP_CONSOLE_UART_BAUDRATE);
|
||||
}
|
||||
#endif // CONFIG_ESP_CONSOLE_UART
|
||||
@ -98,6 +105,10 @@ void bootloader_console_init(void)
|
||||
esp_rom_uart_usb_acm_init(s_usb_cdc_buf, sizeof(s_usb_cdc_buf));
|
||||
esp_rom_uart_set_as_console(ESP_ROM_USB_OTG_NUM);
|
||||
esp_rom_install_channel_putc(1, bootloader_console_write_char_usb);
|
||||
#if SOC_USB_SERIAL_JTAG_SUPPORTED
|
||||
usb_phy_ll_usb_wrap_pad_enable(&USB_WRAP, true);
|
||||
usb_phy_ll_int_otg_enable(&USB_WRAP);
|
||||
#endif
|
||||
}
|
||||
#endif //CONFIG_ESP_CONSOLE_USB_CDC
|
||||
|
||||
|
@ -4,7 +4,3 @@ components/bootloader_support/test_apps/rtc_custom_section:
|
||||
enable:
|
||||
- if: SOC_RTC_MEM_SUPPORTED == 1
|
||||
reason: this feature is supported on chips that have RTC memory
|
||||
disable:
|
||||
- if: IDF_TARGET == "esp32p4"
|
||||
temporary: true
|
||||
reason: this feature on esp32p4 isn't supported yet # TODO: IDF-8069
|
||||
|
@ -1,2 +1,2 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
|
@ -45,10 +45,10 @@ set(ble_mesh_include_dirs
|
||||
"esp_ble_mesh/api/core/include"
|
||||
"esp_ble_mesh/api/models/include"
|
||||
"esp_ble_mesh/api"
|
||||
"esp_ble_mesh/lib/include"
|
||||
"esp_ble_mesh/v1.1/api/core/include"
|
||||
"esp_ble_mesh/v1.1/api/models/include"
|
||||
"esp_ble_mesh/v1.1/btc/include"
|
||||
"esp_ble_mesh/v1.1/include"
|
||||
)
|
||||
|
||||
set(bluedroid_include_dirs host/bluedroid/api/include/api)
|
||||
@ -70,31 +70,36 @@ if(CONFIG_BT_ENABLED)
|
||||
set(srcs "")
|
||||
set(include_dirs "")
|
||||
set(ldfragments "linker.lf")
|
||||
if(CONFIG_BT_CONTROLLER_ENABLED)
|
||||
if(CONFIG_IDF_TARGET_ESP32)
|
||||
list(APPEND srcs "controller/esp32/bt.c"
|
||||
"controller/esp32/hli_api.c"
|
||||
"controller/esp32/hli_vectors.S")
|
||||
|
||||
if(CONFIG_IDF_TARGET_ESP32)
|
||||
list(APPEND srcs "controller/esp32/bt.c"
|
||||
"controller/esp32/hli_api.c"
|
||||
"controller/esp32/hli_vectors.S")
|
||||
elseif(CONFIG_IDF_TARGET_ESP32C3)
|
||||
list(APPEND srcs "controller/esp32c3/bt.c")
|
||||
|
||||
elseif(CONFIG_IDF_TARGET_ESP32C3)
|
||||
list(APPEND srcs "controller/esp32c3/bt.c")
|
||||
elseif(CONFIG_IDF_TARGET_ESP32S3)
|
||||
list(APPEND srcs "controller/esp32c3/bt.c")
|
||||
|
||||
elseif(CONFIG_IDF_TARGET_ESP32S3)
|
||||
list(APPEND srcs "controller/esp32c3/bt.c")
|
||||
elseif(CONFIG_IDF_TARGET_ESP32C2)
|
||||
list(APPEND srcs "controller/esp32c2/bt.c")
|
||||
|
||||
elseif(CONFIG_IDF_TARGET_ESP32C2)
|
||||
set(ldfragments "linker.lf.esp32c2")
|
||||
list(APPEND srcs "controller/esp32c2/bt.c")
|
||||
elseif(CONFIG_IDF_TARGET_ESP32C2)
|
||||
set(ldfragments "linker.lf.esp32c2")
|
||||
list(APPEND srcs "controller/esp32c2/bt.c")
|
||||
|
||||
elseif(CONFIG_IDF_TARGET_ESP32C6)
|
||||
list(APPEND srcs "controller/esp32c6/bt.c")
|
||||
elseif(CONFIG_IDF_TARGET_ESP32C6)
|
||||
list(APPEND srcs "controller/esp32c6/bt.c")
|
||||
|
||||
elseif(CONFIG_IDF_TARGET_ESP32H2)
|
||||
list(APPEND srcs "controller/esp32h2/bt.c")
|
||||
endif()
|
||||
|
||||
list(APPEND include_dirs ${target_specific_include_dirs})
|
||||
|
||||
elseif(CONFIG_IDF_TARGET_ESP32H2)
|
||||
list(APPEND srcs "controller/esp32h2/bt.c")
|
||||
endif()
|
||||
|
||||
list(APPEND include_dirs ${target_specific_include_dirs})
|
||||
|
||||
# Common
|
||||
list(APPEND include_dirs common/osi/include)
|
||||
|
||||
@ -174,6 +179,7 @@ if(CONFIG_BT_ENABLED)
|
||||
|
||||
list(APPEND srcs "host/bluedroid/api/esp_a2dp_api.c"
|
||||
"host/bluedroid/api/esp_avrc_api.c"
|
||||
"host/bluedroid/api/esp_bluedroid_hci.c"
|
||||
"host/bluedroid/api/esp_bt_device.c"
|
||||
"host/bluedroid/api/esp_bt_main.c"
|
||||
"host/bluedroid/api/esp_gap_ble_api.c"
|
||||
@ -509,7 +515,6 @@ if(CONFIG_BT_ENABLED)
|
||||
"esp_ble_mesh/core/rpl.c"
|
||||
"esp_ble_mesh/core/scan.c"
|
||||
"esp_ble_mesh/core/test.c"
|
||||
"esp_ble_mesh/core/transport.c"
|
||||
"esp_ble_mesh/models/common/device_property.c"
|
||||
"esp_ble_mesh/models/common/model_common.c"
|
||||
"esp_ble_mesh/models/client/client_common.c"
|
||||
@ -545,7 +550,13 @@ if(CONFIG_BT_ENABLED)
|
||||
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_rpr_model.c"
|
||||
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_sar_model.c"
|
||||
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_srpl_model.c"
|
||||
"esp_ble_mesh/v1.1/ext.c")
|
||||
"esp_ble_mesh/lib/ext.c")
|
||||
|
||||
if(CONFIG_BLE_MESH_SAR_ENHANCEMENT)
|
||||
list(APPEND srcs "esp_ble_mesh/core/transport.enh.c")
|
||||
else()
|
||||
list(APPEND srcs "esp_ble_mesh/core/transport.c")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@ -608,6 +619,7 @@ if(CONFIG_BT_ENABLED)
|
||||
host/nimble/nimble/nimble/host/services/ipss/include
|
||||
host/nimble/nimble/nimble/host/services/lls/include
|
||||
host/nimble/nimble/nimble/host/services/prox/include
|
||||
host/nimble/nimble/nimble/host/services/cts/include
|
||||
host/nimble/nimble/nimble/host/services/tps/include
|
||||
host/nimble/nimble/nimble/host/util/include
|
||||
host/nimble/nimble/nimble/host/store/ram/include
|
||||
@ -628,6 +640,7 @@ if(CONFIG_BT_ENABLED)
|
||||
"host/nimble/nimble/nimble/host/services/dis/src/ble_svc_dis.c"
|
||||
"host/nimble/nimble/nimble/host/services/lls/src/ble_svc_lls.c"
|
||||
"host/nimble/nimble/nimble/host/services/prox/src/ble_svc_prox.c"
|
||||
"host/nimble/nimble/nimble/host/services/cts/src/ble_svc_cts.c"
|
||||
"host/nimble/nimble/nimble/host/src/ble_hs_conn.c"
|
||||
"host/nimble/nimble/nimble/host/src/ble_store_util.c"
|
||||
"host/nimble/nimble/nimble/host/src/ble_sm.c"
|
||||
@ -813,20 +826,20 @@ endif()
|
||||
|
||||
if(CONFIG_BLE_MESH)
|
||||
if(CONFIG_IDF_TARGET_ESP32)
|
||||
add_prebuilt_library(mesh_v11 "esp_ble_mesh/v1.1/lib/esp32/libmesh_v1.1.a")
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE mesh_v11)
|
||||
add_prebuilt_library(ble_mesh "esp_ble_mesh/lib/lib/esp32/libble_mesh.a")
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE ble_mesh)
|
||||
elseif(CONFIG_IDF_TARGET_ESP32S3)
|
||||
add_prebuilt_library(mesh_v11 "esp_ble_mesh/v1.1/lib/esp32s3/libmesh_v1.1.a")
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE mesh_v11)
|
||||
add_prebuilt_library(ble_mesh "esp_ble_mesh/lib/lib/esp32s3/libble_mesh.a")
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE ble_mesh)
|
||||
elseif(CONFIG_IDF_TARGET_ESP32C3)
|
||||
add_prebuilt_library(mesh_v11 "esp_ble_mesh/v1.1/lib/esp32c3/libmesh_v1.1.a")
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE mesh_v11)
|
||||
add_prebuilt_library(ble_mesh "esp_ble_mesh/lib/lib/esp32c3/libble_mesh.a")
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE ble_mesh)
|
||||
elseif(CONFIG_IDF_TARGET_ESP32C6)
|
||||
add_prebuilt_library(mesh_v11 "esp_ble_mesh/v1.1/lib/esp32c6/libmesh_v1.1.a")
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE mesh_v11)
|
||||
add_prebuilt_library(ble_mesh "esp_ble_mesh/lib/lib/esp32c6/libble_mesh.a")
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE ble_mesh)
|
||||
elseif(CONFIG_IDF_TARGET_ESP32H2)
|
||||
add_prebuilt_library(mesh_v11 "esp_ble_mesh/v1.1/lib/esp32h2/libmesh_v1.1.a")
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE mesh_v11)
|
||||
add_prebuilt_library(ble_mesh "esp_ble_mesh/lib/lib/esp32h2/libble_mesh.a")
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE ble_mesh)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
menu "Bluetooth"
|
||||
visible if SOC_BT_SUPPORTED
|
||||
|
||||
config BT_ENABLED
|
||||
bool "Bluetooth"
|
||||
depends on SOC_BT_SUPPORTED && !APP_NO_BLOBS
|
||||
depends on !APP_NO_BLOBS
|
||||
help
|
||||
Select this option to enable Bluetooth and show the submenu with Bluetooth configuration choices.
|
||||
|
||||
@ -22,10 +21,12 @@ menu "Bluetooth"
|
||||
|
||||
config BT_NIMBLE_ENABLED
|
||||
bool "NimBLE - BLE only"
|
||||
depends on BT_CONTROLLER_ENABLED
|
||||
help
|
||||
This option is recommended for BLE only usecases to save on memory
|
||||
|
||||
config BT_CONTROLLER_ONLY
|
||||
depends on SOC_BT_SUPPORTED
|
||||
bool "Disabled"
|
||||
help
|
||||
This option is recommended when you want to communicate directly with the
|
||||
@ -42,6 +43,7 @@ menu "Bluetooth"
|
||||
This helps to choose Bluetooth controller stack
|
||||
|
||||
config BT_CONTROLLER_ENABLED
|
||||
depends on SOC_BT_SUPPORTED
|
||||
bool "Enabled"
|
||||
help
|
||||
This option is recommended for Bluetooth controller usecases
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -29,6 +29,12 @@
|
||||
#define UC_BT_STACK_NO_LOG FALSE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_CONTROLLER_ENABLED
|
||||
#define UC_BT_CONTROLLER_INCLUDED TRUE
|
||||
#else
|
||||
#define UC_BT_CONTROLLER_INCLUDED FALSE
|
||||
#endif
|
||||
|
||||
/**********************************************************
|
||||
* Thread/Task reference
|
||||
**********************************************************/
|
||||
|
@ -16,8 +16,8 @@
|
||||
#include "freertos/task.h"
|
||||
#include "freertos/queue.h"
|
||||
#include "freertos/semphr.h"
|
||||
#include "freertos/xtensa_api.h"
|
||||
#include "freertos/portmacro.h"
|
||||
#include "xtensa_api.h" // Replace with interrupt allocator API (IDF-3891)
|
||||
#include "xtensa/core-macros.h"
|
||||
#include "esp_types.h"
|
||||
#include "esp_mac.h"
|
||||
@ -35,7 +35,7 @@
|
||||
#include "soc/rtc.h"
|
||||
#include "soc/soc_memory_layout.h"
|
||||
#include "soc/dport_reg.h"
|
||||
#include "esp_coexist_internal.h"
|
||||
#include "private/esp_coexist_internal.h"
|
||||
#include "esp_timer.h"
|
||||
#if !CONFIG_FREERTOS_UNICORE
|
||||
#include "esp_ipc.h"
|
||||
@ -1197,23 +1197,12 @@ static int coex_register_wifi_channel_change_callback_wrapper(void *cb)
|
||||
static int coex_version_get_wrapper(unsigned int *major, unsigned int *minor, unsigned int *patch)
|
||||
{
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
const char *ver_str = esp_coex_version_get();
|
||||
if (ver_str != NULL) {
|
||||
unsigned int _major = 0, _minor = 0, _patch = 0;
|
||||
if (sscanf(ver_str, "%u.%u.%u", &_major, &_minor, &_patch) != 3) {
|
||||
return -1;
|
||||
}
|
||||
if (major != NULL) {
|
||||
*major = _major;
|
||||
}
|
||||
if (minor != NULL) {
|
||||
*minor = _minor;
|
||||
}
|
||||
if (patch != NULL) {
|
||||
*patch = _patch;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
coex_version_t version;
|
||||
ESP_ERROR_CHECK(coex_version_get_value(&version));
|
||||
*major = (unsigned int)version.major;
|
||||
*minor = (unsigned int)version.minor;
|
||||
*patch = (unsigned int)version.patch;
|
||||
return 0;
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <xtensa/coreasm.h>
|
||||
#include <xtensa/corebits.h>
|
||||
#include <xtensa/config/system.h>
|
||||
#include "freertos/xtensa_context.h"
|
||||
#include "xtensa_context.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "soc/soc.h"
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#endif
|
||||
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
#include "esp_coexist_internal.h"
|
||||
#include "private/esp_coexist_internal.h"
|
||||
#endif
|
||||
|
||||
#include "nimble/nimble_npl_os.h"
|
||||
@ -644,6 +644,12 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
coex_init();
|
||||
#endif
|
||||
|
||||
ret = ble_controller_init(cfg);
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
|
||||
goto modem_deint;
|
||||
}
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
interface_func_t bt_controller_log_interface;
|
||||
bt_controller_log_interface = esp_bt_controller_log_interface;
|
||||
@ -661,16 +667,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
#endif // CONFIG_BT_CONTROLLER_LOG_DUMP
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
|
||||
goto modem_deint;
|
||||
goto controller_init_err;
|
||||
}
|
||||
#endif // CONFIG_BT_CONTROLLER_LOG_ENABLED
|
||||
|
||||
ret = ble_controller_init(cfg);
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
|
||||
goto modem_deint;
|
||||
}
|
||||
|
||||
ret = controller_sleep_init();
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "controller_sleep_init failed %d", ret);
|
||||
@ -691,11 +691,12 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
return ESP_OK;
|
||||
free_controller:
|
||||
controller_sleep_deinit();
|
||||
ble_controller_deinit();
|
||||
modem_deint:
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
controller_init_err:
|
||||
ble_log_deinit_async();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
ble_controller_deinit();
|
||||
modem_deint:
|
||||
esp_phy_modem_deinit();
|
||||
periph_module_disable(PERIPH_BT_MODULE);
|
||||
#if CONFIG_BT_NIMBLE_ENABLED
|
||||
@ -1003,7 +1004,7 @@ uint8_t esp_ble_get_chip_rev_version(void)
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
|
||||
{
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x,", addr[i]);
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "soc/rtc.h"
|
||||
#include "soc/rtc_cntl_reg.h"
|
||||
#include "soc/soc_memory_layout.h"
|
||||
#include "esp_coexist_internal.h"
|
||||
#include "private/esp_coexist_internal.h"
|
||||
#include "esp_timer.h"
|
||||
#include "esp_sleep.h"
|
||||
#include "esp_rom_sys.h"
|
||||
@ -43,8 +43,6 @@
|
||||
#include "riscv/interrupt.h"
|
||||
#include "esp32c3/rom/rom_layout.h"
|
||||
#else //CONFIG_IDF_TARGET_ESP32S3
|
||||
#include "freertos/xtensa_api.h"
|
||||
#include "xtensa/core-macros.h"
|
||||
#include "esp32s3/rom/rom_layout.h"
|
||||
#endif
|
||||
#if CONFIG_BT_ENABLED
|
||||
|
@ -212,6 +212,15 @@ menu "Memory Settings"
|
||||
help
|
||||
Dynamic memory size of block 2
|
||||
|
||||
config BT_LE_MSYS_BUF_FROM_HEAP
|
||||
bool "Get Msys Mbuf from heap"
|
||||
default y
|
||||
depends on BT_LE_MSYS_INIT_IN_CONTROLLER
|
||||
help
|
||||
This option sets the source of the shared msys mbuf memory between
|
||||
the Host and the Controller. Allocate the memory from the heap if
|
||||
this option is sets, from the mempool otherwise.
|
||||
|
||||
config BT_LE_ACL_BUF_COUNT
|
||||
int "ACL Buffer count"
|
||||
default 10
|
||||
@ -539,5 +548,5 @@ config BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD
|
||||
again.
|
||||
|
||||
config BT_LE_MSYS_INIT_IN_CONTROLLER
|
||||
bool
|
||||
bool "Msys Mbuf Init in Controller"
|
||||
default y
|
||||
|
@ -24,7 +24,7 @@
|
||||
#endif // ESP_PLATFORM
|
||||
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
#include "esp_coexist_internal.h"
|
||||
#include "private/esp_coexist_internal.h"
|
||||
#endif // CONFIG_SW_COEXIST_ENABLE
|
||||
|
||||
#include "nimble/nimble_npl_os.h"
|
||||
@ -488,9 +488,6 @@ IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
|
||||
}
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
r_ble_rtc_wake_up_state_clr();
|
||||
#if SOC_PM_RETENTION_HAS_CLOCK_BUG
|
||||
sleep_retention_do_extra_retention(true);
|
||||
#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG
|
||||
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
|
||||
esp_phy_disable(PHY_MODEM_BT);
|
||||
#ifdef CONFIG_PM_ENABLE
|
||||
@ -507,9 +504,6 @@ IRAM_ATTR void controller_wakeup_cb(void *arg)
|
||||
#ifdef CONFIG_PM_ENABLE
|
||||
esp_pm_lock_acquire(s_pm_lock);
|
||||
r_ble_rtc_wake_up_state_clr();
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE && SOC_PM_RETENTION_HAS_CLOCK_BUG
|
||||
sleep_retention_do_extra_retention(false);
|
||||
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE && SOC_PM_RETENTION_HAS_CLOCK_BUG */
|
||||
#endif //CONFIG_PM_ENABLE
|
||||
esp_phy_enable(PHY_MODEM_BT);
|
||||
s_ble_active = true;
|
||||
@ -570,12 +564,21 @@ esp_err_t controller_sleep_init(void)
|
||||
if (rc != ESP_OK) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
#if SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
|
||||
sleep_modem_register_mac_bb_module_prepare_callback(sleep_modem_mac_bb_power_down_prepare,
|
||||
sleep_modem_mac_bb_power_up_prepare);
|
||||
#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
|
||||
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
|
||||
return rc;
|
||||
|
||||
error:
|
||||
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
#if SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
|
||||
sleep_modem_unregister_mac_bb_module_prepare_callback(sleep_modem_mac_bb_power_down_prepare,
|
||||
sleep_modem_mac_bb_power_up_prepare);
|
||||
#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
|
||||
esp_sleep_disable_bt_wakeup();
|
||||
esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
|
||||
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
|
||||
@ -592,6 +595,10 @@ error:
|
||||
void controller_sleep_deinit(void)
|
||||
{
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
#if SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
|
||||
sleep_modem_unregister_mac_bb_module_prepare_callback(sleep_modem_mac_bb_power_down_prepare,
|
||||
sleep_modem_mac_bb_power_up_prepare);
|
||||
#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
|
||||
r_ble_rtc_wake_up_state_clr();
|
||||
esp_sleep_disable_bt_wakeup();
|
||||
sleep_modem_ble_mac_modem_state_deinit();
|
||||
@ -771,6 +778,12 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
coex_init();
|
||||
#endif // CONFIG_SW_COEXIST_ENABLE
|
||||
|
||||
ret = ble_controller_init(cfg);
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
|
||||
goto modem_deint;
|
||||
}
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
interface_func_t bt_controller_log_interface;
|
||||
bt_controller_log_interface = esp_bt_controller_log_interface;
|
||||
@ -788,16 +801,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
#endif // CONFIG_BT_CONTROLLER_LOG_DUMP
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
|
||||
goto modem_deint;
|
||||
goto controller_init_err;
|
||||
}
|
||||
#endif // CONFIG_BT_CONTROLLER_LOG_ENABLED
|
||||
|
||||
ret = ble_controller_init(cfg);
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
|
||||
goto modem_deint;
|
||||
}
|
||||
|
||||
esp_ble_change_rtc_freq(slow_clk_freq);
|
||||
|
||||
ble_controller_scan_duplicate_config();
|
||||
@ -825,12 +832,13 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
|
||||
free_controller:
|
||||
controller_sleep_deinit();
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
controller_init_err:
|
||||
ble_log_deinit_async();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
os_msys_deinit();
|
||||
ble_controller_deinit();
|
||||
modem_deint:
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
ble_log_deinit_async();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
esp_phy_modem_deinit();
|
||||
modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
|
||||
modem_clock_module_disable(PERIPH_BT_MODULE);
|
||||
@ -950,11 +958,6 @@ esp_err_t esp_bt_controller_disable(void)
|
||||
esp_pm_lock_release(s_pm_lock);
|
||||
#endif // CONFIG_PM_ENABLE
|
||||
s_ble_active = false;
|
||||
} else {
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
/* Avoid consecutive backup of register cause assertion */
|
||||
sleep_retention_module_deinit();
|
||||
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
}
|
||||
ble_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
|
||||
return ESP_OK;
|
||||
@ -1173,7 +1176,7 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
|
||||
{
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x,", addr[i]);
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
|
@ -24,7 +24,7 @@
|
||||
#endif // ESP_PLATFORM
|
||||
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
#include "esp_coexist_internal.h"
|
||||
#include "private/esp_coexist_internal.h"
|
||||
#endif // CONFIG_SW_COEXIST_ENABLE
|
||||
|
||||
#include "nimble/nimble_npl_os.h"
|
||||
@ -751,6 +751,12 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
coex_init();
|
||||
#endif // CONFIG_SW_COEXIST_ENABLE
|
||||
|
||||
ret = ble_controller_init(cfg);
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
|
||||
goto modem_deint;
|
||||
}
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
interface_func_t bt_controller_log_interface;
|
||||
bt_controller_log_interface = esp_bt_controller_log_interface;
|
||||
@ -768,16 +774,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
#endif // CONFIG_BT_CONTROLLER_LOG_DUMP
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
|
||||
goto modem_deint;
|
||||
goto controller_init_err;
|
||||
}
|
||||
#endif // CONFIG_BT_CONTROLLER_LOG_ENABLED
|
||||
|
||||
ret = ble_controller_init(cfg);
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
|
||||
goto modem_deint;
|
||||
}
|
||||
|
||||
esp_ble_change_rtc_freq(slow_clk_freq);
|
||||
|
||||
ble_controller_scan_duplicate_config();
|
||||
@ -806,12 +806,13 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
|
||||
free_controller:
|
||||
controller_sleep_deinit();
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
controller_init_err:
|
||||
ble_log_deinit_async();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
os_msys_deinit();
|
||||
ble_controller_deinit();
|
||||
modem_deint:
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
ble_log_deinit_async();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
|
||||
modem_clock_module_disable(PERIPH_BT_MODULE);
|
||||
#if CONFIG_BT_NIMBLE_ENABLED
|
||||
@ -1147,7 +1148,7 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
|
||||
{
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x,", addr[i]);
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
|
Submodule components/bt/controller/lib_esp32 updated: 943b0f24eb...d1d4b7635d
Submodule components/bt/controller/lib_esp32c2/esp32c2-bt-lib updated: 4fb60aa91d...5dc39aabee
Submodule components/bt/controller/lib_esp32c3_family updated: 7fb979154b...f103dfec01
Submodule components/bt/controller/lib_esp32c6/esp32c6-bt-lib updated: 25d9661bc3...0caa942705
Submodule components/bt/controller/lib_esp32h2/esp32h2-bt-lib updated: 8450d3f508...acf2950557
@ -6,6 +6,15 @@ if BLE_MESH
|
||||
help
|
||||
It is a temporary solution and needs further modifications.
|
||||
|
||||
config BLE_MESH_RANDOM_ADV_INTERVAL
|
||||
bool "Support using random adv interval for mesh packets"
|
||||
select BT_BLE_HIGH_DUTY_ADV_INTERVAL if BT_BLUEDROID_ENABLED
|
||||
default n
|
||||
help
|
||||
Enable this option to allow using random advertising interval
|
||||
for mesh packets. And this could help avoid collision of
|
||||
advertising packets.
|
||||
|
||||
config BLE_MESH_USE_DUPLICATE_SCAN
|
||||
bool "Support Duplicate Scan in BLE Mesh"
|
||||
select BTDM_BLE_SCAN_DUPL if IDF_TARGET_ESP32
|
||||
@ -14,6 +23,7 @@ if BLE_MESH
|
||||
select BT_CTRL_BLE_MESH_SCAN_DUPL_EN if IDF_TARGET_ESP32C3
|
||||
select BT_LE_SCAN_DUPL if IDF_TARGET_ESP32C6
|
||||
select BT_LE_SCAN_DUPL if IDF_TARGET_ESP32H2
|
||||
select BT_NIMBLE_VS_SUPPORT if BT_NIMBLE_ENABLED
|
||||
default y
|
||||
help
|
||||
Enable this option to allow using specific duplicate scan filter
|
||||
@ -678,6 +688,13 @@ if BLE_MESH
|
||||
When the above situation is encountered, this option can be used to decide whether
|
||||
to perform the IV index recovery procedure.
|
||||
|
||||
config BLE_MESH_SAR_ENHANCEMENT
|
||||
bool "Segmentation and reassembly enhancement"
|
||||
default n
|
||||
help
|
||||
Enable this option to use the enhanced segmentation and reassembly
|
||||
mechanism introduced in Bluetooth Mesh Protocol 1.1.
|
||||
|
||||
config BLE_MESH_TX_SEG_MSG_COUNT
|
||||
int "Maximum number of simultaneous outgoing segmented messages"
|
||||
default 1
|
||||
@ -1091,6 +1108,16 @@ if BLE_MESH
|
||||
help
|
||||
Maximum number of Bridging Table entries that the Bridge Configuration Server can support.
|
||||
|
||||
config BLE_MESH_BRIDGE_CRPL
|
||||
int "Maximum capacity of bridge replay protection list"
|
||||
default 5
|
||||
range 1 255
|
||||
help
|
||||
This option specifies the maximum capacity of the bridge replay
|
||||
protection list. The bridge replay protection list is used to
|
||||
prevent a bridged subnet from replay attack, which will store the
|
||||
source address and sequence number of the received bridge messages.
|
||||
|
||||
endif #BLE_MESH_BRC_SRV
|
||||
|
||||
config BLE_MESH_PRB_CLI
|
||||
@ -1474,6 +1501,7 @@ if BLE_MESH
|
||||
|
||||
config BLE_MESH_BQB_TEST
|
||||
bool "Enable BLE Mesh specific internal test"
|
||||
select BLE_MESH_IV_UPDATE_TEST
|
||||
default n
|
||||
help
|
||||
This option is used to enable some internal functions for auto-pts test.
|
||||
|
@ -53,6 +53,34 @@ esp_err_t esp_ble_mesh_proxy_gatt_disable(void)
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
#if CONFIG_BLE_MESH_PRB_SRV
|
||||
esp_err_t esp_ble_mesh_private_proxy_identity_enable(void)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_PROV;
|
||||
msg.act = BTC_BLE_MESH_ACT_PRIVATE_PROXY_IDENTITY_ENABLE;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_mesh_private_proxy_identity_disable(void)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_PROV;
|
||||
msg.act = BTC_BLE_MESH_ACT_PRIVATE_PROXY_IDENTITY_DISABLE;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_PRB_SRV */
|
||||
|
||||
esp_err_t esp_ble_mesh_proxy_client_connect(esp_ble_mesh_bd_addr_t addr,
|
||||
esp_ble_mesh_addr_type_t addr_type,
|
||||
uint16_t net_idx)
|
||||
|
@ -48,6 +48,30 @@ esp_err_t esp_ble_mesh_proxy_gatt_enable(void);
|
||||
*/
|
||||
esp_err_t esp_ble_mesh_proxy_gatt_disable(void);
|
||||
|
||||
/**
|
||||
* @brief Enable advertising with Private Node Identity.
|
||||
*
|
||||
* @note This API requires that GATT Proxy support be enabled. Once called,
|
||||
* each subnet starts advertising using Private Node Identity for the
|
||||
* next 60 seconds, and after 60s Private Network ID will be advertised.
|
||||
* Under normal conditions, the BLE Mesh Proxy Node Identity, Network
|
||||
* ID advertising, Proxy Private Node Identity and Private Network
|
||||
* ID advertising will be enabled automatically by BLE Mesh stack
|
||||
* after the device is provisioned.
|
||||
*
|
||||
* @return ESP_OK on success or error code otherwise.
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_mesh_private_proxy_identity_enable(void);
|
||||
|
||||
/**
|
||||
* @brief Disable advertising with Private Node Identity.
|
||||
*
|
||||
* @return ESP_OK on success or error code otherwise.
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_mesh_private_proxy_identity_disable(void);
|
||||
|
||||
/**
|
||||
* @brief Proxy Client creates a connection with the Proxy Server.
|
||||
*
|
||||
|
@ -916,6 +916,8 @@ typedef enum {
|
||||
ESP_BLE_MESH_NODE_PROV_INPUT_NUMBER_COMP_EVT, /*!< Node input number completion event */
|
||||
ESP_BLE_MESH_NODE_PROV_INPUT_STRING_COMP_EVT, /*!< Node input string completion event */
|
||||
ESP_BLE_MESH_NODE_PROXY_IDENTITY_ENABLE_COMP_EVT, /*!< Enable BLE Mesh Proxy Identity advertising completion event */
|
||||
ESP_BLE_MESH_NODE_PRIVATE_PROXY_IDENTITY_ENABLE_COMP_EVT, /*!< Enable BLE Mesh Private Proxy Identity advertising completion event */
|
||||
ESP_BLE_MESH_NODE_PRIVATE_PROXY_IDENTITY_DISABLE_COMP_EVT, /*!< Disable BLE Mesh Private Proxy Identity advertising completion event */
|
||||
ESP_BLE_MESH_NODE_PROXY_GATT_ENABLE_COMP_EVT, /*!< Enable BLE Mesh GATT Proxy Service completion event */
|
||||
ESP_BLE_MESH_NODE_PROXY_GATT_DISABLE_COMP_EVT, /*!< Disable BLE Mesh GATT Proxy Service completion event */
|
||||
ESP_BLE_MESH_NODE_ADD_LOCAL_NET_KEY_COMP_EVT, /*!< Node add NetKey locally completion event */
|
||||
@ -1109,6 +1111,18 @@ typedef union {
|
||||
struct ble_mesh_proxy_gatt_disable_comp_param {
|
||||
int err_code; /*!< Indicate the result of disabling Mesh Proxy Service */
|
||||
} node_proxy_gatt_disable_comp; /*!< Event parameter of ESP_BLE_MESH_NODE_PROXY_GATT_DISABLE_COMP_EVT */
|
||||
/**
|
||||
* @brief ESP_BLE_MESH_NODE_PRIVATE_PROXY_IDENTITY_ENABLE_COMP_EVT
|
||||
*/
|
||||
struct ble_mesh_proxy_private_identity_enable_comp_param {
|
||||
int err_code; /*!< Indicate the result of enabling Mesh Proxy private advertising */
|
||||
} node_private_proxy_identity_enable_comp; /*!< Event parameter of ESP_BLE_MESH_NODE_PRIVATE_PROXY_IDENTITY_ENABLE_COMP_EVT */
|
||||
/**
|
||||
* @brief ESP_BLE_MESH_NODE_PRIVATE_PROXY_IDENTITY_DISABLE_COMP_EVT
|
||||
*/
|
||||
struct ble_mesh_proxy_private_identity_disable_comp_param {
|
||||
int err_code; /*!< Indicate the result of disabling Mesh Proxy private advertising */
|
||||
} node_private_proxy_identity_disable_comp; /*!< Event parameter of ESP_BLE_MESH_NODE_PRIVATE_PROXY_IDENTITY_DISABLE_COMP_EVT */
|
||||
/**
|
||||
* @brief ESP_BLE_MESH_NODE_ADD_LOCAL_NET_KEY_COMP_EVT
|
||||
*/
|
||||
|
@ -2368,6 +2368,16 @@ void btc_ble_mesh_prov_call_handler(btc_msg_t *msg)
|
||||
act = ESP_BLE_MESH_NODE_PROXY_GATT_DISABLE_COMP_EVT;
|
||||
param.node_proxy_gatt_disable_comp.err_code = bt_mesh_proxy_server_gatt_disable();
|
||||
break;
|
||||
#if CONFIG_BLE_MESH_PRB_SRV
|
||||
case BTC_BLE_MESH_ACT_PRIVATE_PROXY_IDENTITY_ENABLE:
|
||||
act = ESP_BLE_MESH_NODE_PRIVATE_PROXY_IDENTITY_ENABLE_COMP_EVT;
|
||||
param.node_private_proxy_identity_enable_comp.err_code = bt_mesh_proxy_private_identity_enable();
|
||||
break;
|
||||
case BTC_BLE_MESH_ACT_PRIVATE_PROXY_IDENTITY_DISABLE:
|
||||
act = ESP_BLE_MESH_NODE_PRIVATE_PROXY_IDENTITY_DISABLE_COMP_EVT;
|
||||
param.node_private_proxy_identity_disable_comp.err_code = bt_mesh_proxy_private_identity_disable();
|
||||
break;
|
||||
#endif /* CONFIG_BLE_MESH_PRB_SRV */
|
||||
#endif /* CONFIG_BLE_MESH_GATT_PROXY_SERVER */
|
||||
#endif /* (CONFIG_BLE_MESH_NODE && CONFIG_BLE_MESH_PB_GATT) || CONFIG_BLE_MESH_GATT_PROXY_SERVER */
|
||||
#if CONFIG_BLE_MESH_PROVISIONER
|
||||
|
@ -28,6 +28,8 @@ typedef enum {
|
||||
BTC_BLE_MESH_ACT_INPUT_STRING,
|
||||
BTC_BLE_MESH_ACT_SET_DEVICE_NAME,
|
||||
BTC_BLE_MESH_ACT_PROXY_IDENTITY_ENABLE,
|
||||
BTC_BLE_MESH_ACT_PRIVATE_PROXY_IDENTITY_ENABLE,
|
||||
BTC_BLE_MESH_ACT_PRIVATE_PROXY_IDENTITY_DISABLE,
|
||||
BTC_BLE_MESH_ACT_PROXY_GATT_ENABLE,
|
||||
BTC_BLE_MESH_ACT_PROXY_GATT_DISABLE,
|
||||
BTC_BLE_MESH_ACT_NODE_ADD_LOCAL_NET_KEY,
|
||||
|
@ -85,3 +85,8 @@ int bt_mesh_rand(void *buf, size_t len)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t bt_mesh_get_rand(void)
|
||||
{
|
||||
return esp_random();
|
||||
}
|
||||
|
@ -53,6 +53,8 @@ void bt_mesh_free_buf(struct net_buf_simple *buf);
|
||||
|
||||
int bt_mesh_rand(void *buf, size_t len);
|
||||
|
||||
uint32_t bt_mesh_get_rand(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -207,7 +207,7 @@ int k_delayed_work_free(struct k_delayed_work *work)
|
||||
|
||||
alarm = hash_map_get(bm_alarm_hash_map, work);
|
||||
if (alarm == NULL) {
|
||||
BT_WARN("Free, alarm not found");
|
||||
BT_DBG("Free, alarm not found");
|
||||
bt_mesh_alarm_unlock();
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -964,6 +964,9 @@ int bt_mesh_model_publish(struct bt_mesh_model *model)
|
||||
ctx.send_ttl = pub->ttl;
|
||||
ctx.send_cred = pub->cred ? BLE_MESH_FRIENDSHIP_CRED : BLE_MESH_FLOODING_CRED;
|
||||
ctx.send_szmic = pub->send_szmic;
|
||||
#if 0
|
||||
ctx.send_tag |= BLE_MESH_TAG_IMMUTABLE_CRED;
|
||||
#endif
|
||||
if (pub->send_rel) {
|
||||
/* Tag with send-segmented */
|
||||
ctx.send_tag |= BLE_MESH_TAG_SEND_SEGMENTED;
|
||||
|
@ -32,8 +32,11 @@
|
||||
/* Pre-5.0 controllers enforce a minimum interval of 100ms
|
||||
* whereas 5.0+ controllers can go down to 20ms.
|
||||
*/
|
||||
#define ADV_INT_DEFAULT_MS 100
|
||||
#define ADV_INT_FAST_MS 20
|
||||
#if CONFIG_BLE_MESH_HCI_5_0
|
||||
#define ADV_ITVL_MIN 20
|
||||
#else
|
||||
#define ADV_ITVL_MIN 100
|
||||
#endif
|
||||
|
||||
static const uint8_t adv_type[] = {
|
||||
[BLE_MESH_ADV_PROV] = BLE_MESH_DATA_MESH_PROV,
|
||||
@ -141,10 +144,19 @@ static inline void adv_send_end(int err, const struct bt_mesh_send_cb *cb,
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t bt_mesh_pdu_duration(uint8_t xmit)
|
||||
{
|
||||
uint16_t duration = 0U;
|
||||
uint16_t adv_int = 0U;
|
||||
|
||||
adv_int = MAX(ADV_ITVL_MIN, BLE_MESH_TRANSMIT_INT(xmit));
|
||||
duration = (BLE_MESH_TRANSMIT_COUNT(xmit) + 1) * (adv_int + 10);
|
||||
|
||||
return duration;
|
||||
}
|
||||
|
||||
static inline int adv_send(struct net_buf *buf)
|
||||
{
|
||||
const int32_t adv_int_min = ((bt_mesh_dev.hci_version >= BLE_MESH_HCI_VERSION_5_0) ?
|
||||
ADV_INT_FAST_MS : ADV_INT_DEFAULT_MS);
|
||||
const struct bt_mesh_send_cb *cb = BLE_MESH_ADV(buf)->cb;
|
||||
void *cb_data = BLE_MESH_ADV(buf)->cb_data;
|
||||
struct bt_mesh_adv_param param = {0};
|
||||
@ -158,7 +170,7 @@ static inline int adv_send(struct net_buf *buf)
|
||||
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV
|
||||
if (BLE_MESH_ADV(buf)->type != BLE_MESH_ADV_BLE) {
|
||||
#endif
|
||||
adv_int = MAX(adv_int_min,
|
||||
adv_int = MAX(ADV_ITVL_MIN,
|
||||
BLE_MESH_TRANSMIT_INT(BLE_MESH_ADV(buf)->xmit));
|
||||
duration = (BLE_MESH_TRANSMIT_COUNT(BLE_MESH_ADV(buf)->xmit) + 1) *
|
||||
(adv_int + 10);
|
||||
@ -180,7 +192,7 @@ static inline int adv_send(struct net_buf *buf)
|
||||
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)),
|
||||
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_UUID16_ALL, 0x29, 0x18),
|
||||
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_adv_start(¶m, solic_ad, 3, NULL, 0);
|
||||
|
@ -25,6 +25,8 @@ extern "C" {
|
||||
|
||||
#define BLE_MESH_ADV(buf) (*(struct bt_mesh_adv **)net_buf_user_data(buf))
|
||||
|
||||
uint16_t bt_mesh_pdu_duration(uint8_t xmit);
|
||||
|
||||
typedef struct bt_mesh_msg {
|
||||
bool relay; /* Flag indicates if the packet is a relayed one */
|
||||
void *arg; /* Pointer to the struct net_buf */
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "mesh/common.h"
|
||||
#include "prov_pvnr.h"
|
||||
#include "net.h"
|
||||
#include "beacon.h"
|
||||
|
||||
#include "mesh_v1.1/utils.h"
|
||||
|
||||
@ -323,6 +324,7 @@ int bt_le_adv_start(const struct bt_mesh_adv_param *param,
|
||||
tBLE_ADDR_TYPE addr_type_own = 0U;
|
||||
tBLE_BD_ADDR p_dir_bda = {0};
|
||||
tBTM_BLE_AFP adv_fil_pol = 0U;
|
||||
uint16_t interval = 0U;
|
||||
uint8_t adv_type = 0U;
|
||||
int err = 0;
|
||||
|
||||
@ -369,7 +371,15 @@ int bt_le_adv_start(const struct bt_mesh_adv_param *param,
|
||||
}
|
||||
|
||||
#if CONFIG_BLE_MESH_PRB_SRV
|
||||
addr_type_own = bt_mesh_private_beacon_update_addr_type(ad);
|
||||
/* NOTE: When a Mesh Private beacon is advertised, the Mesh Private beacon shall
|
||||
* use a resolvable private address or a non-resolvable private address in the
|
||||
* AdvA field of the advertising PDU.
|
||||
*/
|
||||
if (ad->type == BLE_MESH_DATA_MESH_BEACON && ad->data[0] == BEACON_TYPE_PRIVATE) {
|
||||
addr_type_own = BLE_MESH_ADDR_RANDOM;
|
||||
} else {
|
||||
addr_type_own = BLE_MESH_ADDR_PUBLIC;
|
||||
}
|
||||
#else
|
||||
addr_type_own = BLE_MESH_ADDR_PUBLIC;
|
||||
#endif
|
||||
@ -378,9 +388,24 @@ int bt_le_adv_start(const struct bt_mesh_adv_param *param,
|
||||
adv_fil_pol = BLE_MESH_AP_SCAN_CONN_ALL;
|
||||
p_start_adv_cb = start_adv_completed_cb;
|
||||
|
||||
interval = param->interval_min;
|
||||
|
||||
#if CONFIG_BLE_MESH_RANDOM_ADV_INTERVAL
|
||||
/* If non-connectable mesh packets are transmitted with an adv interval
|
||||
* not smaller than 10ms, then we will use a random adv interval between
|
||||
* [interval / 2, interval] for them.
|
||||
*/
|
||||
if (adv_type == BLE_MESH_ADV_NONCONN_IND && interval >= 16) {
|
||||
interval >>= 1;
|
||||
interval += (bt_mesh_get_rand() % (interval + 1));
|
||||
|
||||
BT_INFO("%u->%u", param->interval_min, interval);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Check if we can start adv using BTM_BleSetAdvParamsStartAdvCheck */
|
||||
BLE_MESH_BTM_CHECK_STATUS(
|
||||
BTM_BleSetAdvParamsAll(param->interval_min, param->interval_max, adv_type,
|
||||
BTM_BleSetAdvParamsAll(interval, interval, adv_type,
|
||||
addr_type_own, &p_dir_bda,
|
||||
channel_map, adv_fil_pol, p_start_adv_cb));
|
||||
BLE_MESH_BTM_CHECK_STATUS(BTM_BleStartAdv());
|
||||
@ -1978,7 +2003,7 @@ int bt_mesh_update_exceptional_list(uint8_t sub_code, uint32_t type, void *info)
|
||||
|
||||
if ((sub_code > BLE_MESH_EXCEP_LIST_SUB_CODE_CLEAN) ||
|
||||
(sub_code < BLE_MESH_EXCEP_LIST_SUB_CODE_CLEAN &&
|
||||
type > BLE_MESH_EXCEP_LIST_TYPE_MESH_PROXY_ADV) ||
|
||||
type >= BLE_MESH_EXCEP_LIST_TYPE_MAX) ||
|
||||
(sub_code == BLE_MESH_EXCEP_LIST_SUB_CODE_CLEAN &&
|
||||
!(type & BLE_MESH_EXCEP_LIST_CLEAN_ALL_LIST))) {
|
||||
BT_ERR("%s, Invalid parameter", __func__);
|
||||
@ -1990,6 +2015,16 @@ int bt_mesh_update_exceptional_list(uint8_t sub_code, uint32_t type, void *info)
|
||||
BT_ERR("Invalid Provisioning Link ID");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* When removing an unused link (i.e., Link ID is 0), and since
|
||||
* Controller has never added this Link ID, it will cause error
|
||||
* log been wrongly reported.
|
||||
* Therefore, add this check here to avoid such occurrences.
|
||||
*/
|
||||
if (*(uint32_t *)info == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
sys_memcpy_swap(value, info, sizeof(uint32_t));
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017 Intel Corporation
|
||||
* SPDX-FileContributor: 2018-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2018-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -2514,7 +2514,7 @@ static void node_identity_set(struct bt_mesh_model *model,
|
||||
* any subnet is 0x01, then the value of the Private Node
|
||||
* Identity state shall be Disable (0x00).
|
||||
*/
|
||||
disable_all_private_node_identity();
|
||||
bt_mesh_proxy_private_identity_disable();
|
||||
#endif
|
||||
bt_mesh_proxy_server_identity_start(sub);
|
||||
} else {
|
||||
@ -3575,6 +3575,17 @@ uint8_t bt_mesh_net_transmit_get(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void bt_mesh_relay_local_set(bool enable)
|
||||
{
|
||||
if (conf && conf->relay != BLE_MESH_RELAY_NOT_SUPPORTED) {
|
||||
if (enable) {
|
||||
conf->relay = BLE_MESH_RELAY_ENABLED;
|
||||
} else {
|
||||
conf->relay = BLE_MESH_RELAY_DISABLED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t bt_mesh_relay_get(void)
|
||||
{
|
||||
if (conf) {
|
||||
|
@ -246,10 +246,10 @@ extern "C" {
|
||||
/* Defines the status codes for Opcodes Aggregator messages. */
|
||||
#define AGG_STATUS_SUCCESS 0x00
|
||||
#define AGG_STATUS_INVALID_ADDRESS 0x01
|
||||
#define AGG_STATUS_INVALID_MODEL 0x02
|
||||
#define AGG_STATUS_WRONG_ACCESS_KEY 0x03
|
||||
#define AGG_STATUS_WRONG_OPCODE 0x04
|
||||
#define AGG_STATUS_MSG_NOT_UNDERSTOOD 0x05
|
||||
#define AGG_STATUS_WRONG_ACCESS_KEY 0x02
|
||||
#define AGG_STATUS_WRONG_OPCODE 0x03
|
||||
#define AGG_STATUS_MSG_NOT_UNDERSTOOD 0x04
|
||||
#define AGG_STATUS_RESPONSE_OVERFLOW 0x05
|
||||
|
||||
enum {
|
||||
BLE_MESH_VA_CHANGED, /* Label information changed */
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017 Intel Corporation
|
||||
* SPDX-FileContributor: 2018-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2018-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -810,6 +810,9 @@ enum {
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_BEACON,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_PROV_ADV,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_PROXY_ADV,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_SOLIC_PDU,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_URI,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MAX,
|
||||
};
|
||||
|
||||
#define BLE_MESH_EXCEP_LIST_CLEAN_ADDR_LIST BIT(0)
|
||||
@ -817,8 +820,10 @@ enum {
|
||||
#define BLE_MESH_EXCEP_LIST_CLEAN_MESH_BEACON_LIST BIT(2)
|
||||
#define BLE_MESH_EXCEP_LIST_CLEAN_MESH_PROV_ADV_LIST BIT(3)
|
||||
#define BLE_MESH_EXCEP_LIST_CLEAN_MESH_PROXY_ADV_LIST BIT(4)
|
||||
#define BLE_MESH_EXCEP_LIST_CLEAN_ALL_LIST (BIT(0) | BIT(1) | \
|
||||
BIT(2) | BIT(3) | BIT(4))
|
||||
#define BLE_MESH_EXCEP_LIST_CLEAN_MESH_SOLIC_PDU_LIST BIT(5)
|
||||
#define BLE_MESH_EXCEP_LIST_CLEAN_MESH_URI_LIST BIT(6)
|
||||
#define BLE_MESH_EXCEP_LIST_CLEAN_ALL_LIST (BIT(0) | BIT(1) | BIT(2) | BIT(3) | \
|
||||
BIT(4) | BIT(5) | BIT(6))
|
||||
|
||||
int bt_mesh_update_exceptional_list(uint8_t sub_code, uint32_t type, void *info);
|
||||
|
||||
|
@ -212,6 +212,8 @@ typedef union {
|
||||
} cfg_net_transmit_set;
|
||||
} bt_mesh_cfg_server_state_change_t;
|
||||
|
||||
void bt_mesh_relay_local_set(bool enable);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -141,6 +141,11 @@ struct bt_mesh_uuid_128 {
|
||||
*/
|
||||
#define BLE_MESH_UUID_MESH_PROXY BLE_MESH_UUID_DECLARE_16(0x1828)
|
||||
#define BLE_MESH_UUID_MESH_PROXY_VAL 0x1828
|
||||
/** @def BLE_MESH_UUID_MESH_PROXY_SOLIC_VAL
|
||||
* @brief Mesh Proxy Solicitation UUID
|
||||
*/
|
||||
#define BLE_MESH_UUID_MESH_PROXY_SOLIC BLE_MESH_UUID_DECLARE_16(0x1859)
|
||||
#define BLE_MESH_UUID_MESH_PROXY_SOLIC_VAL 0x1859
|
||||
/** @def BLE_MESH_UUID_GATT_PRIMARY
|
||||
* @brief GATT Primary Service
|
||||
*/
|
||||
@ -466,10 +471,6 @@ struct bt_mesh_uuid_128 {
|
||||
*/
|
||||
#define BLE_MESH_UUID_MESH_PROXY_DATA_OUT BLE_MESH_UUID_DECLARE_16(0x2ade)
|
||||
#define BLE_MESH_UUID_MESH_PROXY_DATA_OUT_VAL 0x2ade
|
||||
/** @def BLE_MESH_UUID_MESH_PROXY_SOLIC_VAL
|
||||
* @brief Mesh Proxy Solicitation UUID
|
||||
*/
|
||||
#define BLE_MESH_UUID_MESH_PROXY_SOLIC_VAL 0x7fcb
|
||||
|
||||
/*
|
||||
* Protocol UUIDs
|
||||
|
@ -148,10 +148,9 @@ int bt_mesh_enable_directed_forwarding(uint16_t net_idx, bool directed_forwardin
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_DF_SRV */
|
||||
|
||||
#endif
|
||||
#if CONFIG_BLE_MESH_NODE
|
||||
|
||||
const uint8_t *bt_mesh_node_get_local_net_key(uint16_t net_idx)
|
||||
{
|
||||
struct bt_mesh_subnet *sub = NULL;
|
||||
@ -369,5 +368,4 @@ int bt_mesh_node_bind_app_key_to_model(uint16_t elem_addr, uint16_t mod_id,
|
||||
BT_ERR("Model bound is full!");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BLE_MESH_NODE */
|
||||
|
@ -238,6 +238,20 @@ static void clear_friendship(bool force, bool disable)
|
||||
lpn_cb(lpn->frnd, false);
|
||||
}
|
||||
|
||||
/* If the Low Power node supports directed forwarding functionality when
|
||||
* the friendship is established in a subnet, the Low Power node shall
|
||||
* store the current value of the Directed Forwarding state and shall set
|
||||
* the state to 0x00 for that subnet. When that friendship is terminated,
|
||||
* the Low Power node shall set the Directed Forwarding state to the stored
|
||||
* value.
|
||||
*/
|
||||
#if CONFIG_BLE_MESH_DF_SRV
|
||||
if (lpn->established) {
|
||||
bt_mesh_restore_directed_forwarding_state(bt_mesh.sub[0].net_idx,
|
||||
lpn->old_directed_forwarding);
|
||||
}
|
||||
#endif
|
||||
|
||||
lpn->frnd = BLE_MESH_ADDR_UNASSIGNED;
|
||||
lpn->fsn = 0U;
|
||||
lpn->req_attempts = 0U;
|
||||
@ -1027,9 +1041,9 @@ int bt_mesh_lpn_friend_update(struct bt_mesh_net_rx *rx,
|
||||
* the Low Power node shall set the Directed Forwarding state to the stored
|
||||
* value.
|
||||
*/
|
||||
/* TODO:
|
||||
* Store - clear - restore directed forwarding state value of the subnet.
|
||||
*/
|
||||
#if CONFIG_BLE_MESH_DF_SRV
|
||||
lpn->old_directed_forwarding = bt_mesh_get_and_disable_directed_forwarding_state(sub);
|
||||
#endif
|
||||
}
|
||||
|
||||
friend_response_received(lpn);
|
||||
|
@ -606,6 +606,13 @@ bool bt_mesh_kr_update(struct bt_mesh_subnet *sub, uint8_t new_kr, bool new_key)
|
||||
case BLE_MESH_KR_PHASE_2:
|
||||
BT_INFO("KR Phase 0x%02x -> Normal", sub->kr_phase);
|
||||
|
||||
#if CONFIG_BLE_MESH_PRB_SRV
|
||||
/* In this case, consider that kr_flag has changed, so
|
||||
* need to modify the content of the random field.
|
||||
*/
|
||||
bt_mesh_private_beacon_update_random(sub);
|
||||
#endif
|
||||
|
||||
sub->kr_phase = BLE_MESH_KR_NORMAL;
|
||||
bt_mesh_net_revoke_keys(sub);
|
||||
|
||||
@ -669,13 +676,26 @@ bool bt_mesh_net_iv_update(uint32_t iv_index, bool iv_update)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* If a node in Normal Operation receives a Secure Network beacon or
|
||||
* a Mesh Private beacon with an IV index less than the last known
|
||||
* IV Index or greater than the last known IV Index + 42, the Secure
|
||||
* Network beacon or the Mesh Private beacon shall be ignored.
|
||||
*/
|
||||
if (iv_index < bt_mesh.iv_index ||
|
||||
iv_index > bt_mesh.iv_index + 42) {
|
||||
BT_ERR("IV Index out of sync: 0x%08x != 0x%08x",
|
||||
iv_index, bt_mesh.iv_index);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bt_mesh_atomic_test_bit(bt_mesh.flags, BLE_MESH_IVU_IN_PROGRESS)) {
|
||||
/* We're currently in IV Update mode */
|
||||
|
||||
if (iv_index != bt_mesh.iv_index) {
|
||||
BT_WARN("IV Index mismatch: 0x%08x != 0x%08x",
|
||||
iv_index, bt_mesh.iv_index);
|
||||
return false;
|
||||
if (iv_index >= bt_mesh.iv_index + 1) {
|
||||
BT_WARN("Performing IV Index Recovery");
|
||||
(void)memset(bt_mesh.rpl, 0, sizeof(bt_mesh.rpl));
|
||||
bt_mesh.iv_index = iv_index;
|
||||
bt_mesh.seq = 0U;
|
||||
goto do_update;
|
||||
}
|
||||
|
||||
if (iv_update) {
|
||||
@ -691,18 +711,6 @@ bool bt_mesh_net_iv_update(uint32_t iv_index, bool iv_update)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* If a node in Normal Operation receives a Secure Network beacon or
|
||||
* a Mesh Private beacon with an IV index less than the last known
|
||||
* IV Index or greater than the last known IV Index + 42, the Secure
|
||||
* Network beacon or the Mesh Private beacon shall be ignored.
|
||||
*/
|
||||
if (iv_index < bt_mesh.iv_index ||
|
||||
iv_index > bt_mesh.iv_index + 42) {
|
||||
BT_ERR("IV Index out of sync: 0x%08x != 0x%08x",
|
||||
iv_index, bt_mesh.iv_index);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* If a node in Normal Operation receives a Secure Network beacon
|
||||
* or a Mesh Private beacon with an IV index greater than the
|
||||
* last known IV Index + 1, it may initiate an IV Index Recovery
|
||||
@ -1027,6 +1035,7 @@ int bt_mesh_net_send(struct bt_mesh_net_tx *tx, struct net_buf *buf,
|
||||
tx->ctx->send_ttl = bt_mesh_default_ttl_get();
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* The output filter of the interface connected to advertising
|
||||
* or GATT bearers shall drop all messages with the TTL value
|
||||
* set to 1 unless they contain a network PDU that is tagged
|
||||
@ -1038,6 +1047,7 @@ int bt_mesh_net_send(struct bt_mesh_net_tx *tx, struct net_buf *buf,
|
||||
err = -EIO;
|
||||
goto done;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Spec:
|
||||
* If the message security material is not set by the network
|
||||
@ -1246,7 +1256,7 @@ int net_decrypt(struct bt_mesh_subnet *sub, const uint8_t *enc,
|
||||
|
||||
rx->ctx.addr = BLE_MESH_NET_HDR_SRC(buf->data);
|
||||
if (!BLE_MESH_ADDR_IS_UNICAST(rx->ctx.addr)) {
|
||||
BT_INFO("Ignoring non-unicast src addr 0x%04x", rx->ctx.addr);
|
||||
BT_DBG("Ignoring non-unicast src addr 0x%04x", rx->ctx.addr);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -1397,7 +1407,8 @@ static bool relay_to_adv(enum bt_mesh_net_if net_if)
|
||||
case BLE_MESH_NET_IF_ADV:
|
||||
return (bt_mesh_relay_get() == BLE_MESH_RELAY_ENABLED);
|
||||
case BLE_MESH_NET_IF_PROXY:
|
||||
return (bt_mesh_gatt_proxy_get() == BLE_MESH_GATT_PROXY_ENABLED);
|
||||
return (bt_mesh_gatt_proxy_get() == BLE_MESH_GATT_PROXY_ENABLED ||
|
||||
bt_mesh_private_gatt_proxy_state_get() == BLE_MESH_PRIVATE_GATT_PROXY_ENABLED);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -1465,6 +1476,13 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
|
||||
return;
|
||||
}
|
||||
|
||||
#if CONFIG_BLE_MESH_BRC_SRV
|
||||
if (rx->sbr_rpl) {
|
||||
BT_ERR("Bridge RPL attack");
|
||||
goto done;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (cred != BLE_MESH_FLOODING_CRED
|
||||
#if CONFIG_BLE_MESH_DF_SRV
|
||||
&& cred != BLE_MESH_DIRECTED_CRED
|
||||
@ -1474,8 +1492,13 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
|
||||
return;
|
||||
}
|
||||
|
||||
if (rx->ctx.recv_ttl == 0x01 && bt_mesh_tag_relay(tag) == false) {
|
||||
BT_DBG("Ignore PDU with TTL=1 but not tagged as relay");
|
||||
if (rx->ctx.recv_ttl == 0x01) {
|
||||
BT_DBG("Ignore PDU with TTL = 1");
|
||||
return;
|
||||
}
|
||||
|
||||
if (rx->ctx.recv_ttl == 0x02 && bt_mesh_tag_relay(tag) == false) {
|
||||
BT_DBG("Ignore PDU with TTL = 2 but not tagged as relay");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1553,10 +1576,11 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
|
||||
|
||||
BT_DBG("Relaying packet. TTL is now %u", BLE_MESH_NET_HDR_TTL(buf->data));
|
||||
|
||||
/* 1. Update NID if RX or RX was with friend credentials.
|
||||
/* 1. Update NID if RX or RX was with friend credentials(included by case 3).
|
||||
* 2. Update NID if the net_key has changed.
|
||||
* 3. Update NID if credential has changed.
|
||||
*/
|
||||
if (rx->ctx.recv_cred == BLE_MESH_FRIENDSHIP_CRED || netkey_changed) {
|
||||
if (netkey_changed || cred != rx->ctx.recv_cred) {
|
||||
buf->data[0] &= 0x80; /* Clear everything except IVI */
|
||||
buf->data[0] |= nid;
|
||||
}
|
||||
@ -1600,19 +1624,6 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
|
||||
if (((bearer & BLE_MESH_ADV_BEARER) && relay_to_adv(rx->net_if)) ||
|
||||
netkey_changed ||
|
||||
rx->ctx.recv_cred == BLE_MESH_FRIENDSHIP_CRED) {
|
||||
/* NOTE: temporary add for case MESH/NODE/SBR/NET/BV-01-C */
|
||||
#if CONFIG_BLE_MESH_BRC_SRV
|
||||
if (bt_mesh_bridge_rpl_check(rx, NULL) && netkey_changed) {
|
||||
BT_ERR("It is RPL attack, not bridge");
|
||||
/**
|
||||
* @todo:/NODE/DF/INIT/BV-TBD-C,
|
||||
* The message from LT2 was double-checked,
|
||||
* so the message was mistaken for an RPL attack.
|
||||
*/
|
||||
goto done;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !CONFIG_BLE_MESH_RELAY_ADV_BUF
|
||||
bt_mesh_adv_send(buf, xmit, NULL, NULL);
|
||||
#else
|
||||
|
@ -58,7 +58,6 @@ struct bt_mesh_subnet {
|
||||
uint8_t mpb_flags_last; /* Flags of last sent private beacon */
|
||||
uint8_t mpb_ivi_last: 1; /* IV Index of last sent private beacon */
|
||||
uint8_t mpb_random[13]; /* Random of current private beacon */
|
||||
uint8_t mpb_random_last[13]; /* Random of last sent private beacon */
|
||||
|
||||
uint8_t private_node_id; /* Private Node Identity State */
|
||||
#endif /* CONFIG_BLE_MESH_PRIVATE_BEACON */
|
||||
@ -274,6 +273,10 @@ struct bt_mesh_lpn {
|
||||
/* Previous Friend of this LPN */
|
||||
uint16_t old_friend;
|
||||
|
||||
#if CONFIG_BLE_MESH_DF_SRV
|
||||
uint8_t old_directed_forwarding;
|
||||
#endif
|
||||
|
||||
/* Duration reported for last advertising packet */
|
||||
uint16_t adv_duration;
|
||||
|
||||
@ -381,13 +384,14 @@ struct bt_mesh_net_rx {
|
||||
struct bt_mesh_subnet *sub;
|
||||
struct bt_mesh_msg_ctx ctx;
|
||||
uint32_t seq; /* Sequence Number */
|
||||
uint8_t old_iv:1, /* iv_index - 1 was used */
|
||||
uint16_t old_iv:1, /* iv_index - 1 was used */
|
||||
new_key:1, /* Data was encrypted with updated key */
|
||||
friend_cred:1 __attribute__((deprecated)), /* Data was encrypted with friend cred */
|
||||
ctl:1, /* Network Control */
|
||||
net_if:2, /* Network interface */
|
||||
local_match:1, /* Matched a local element */
|
||||
friend_match:1; /* Matched an LPN we're friends for */
|
||||
friend_match:1, /* Matched an LPN we're friends for */
|
||||
sbr_rpl:1; /* Bridge RPL attacker */
|
||||
uint16_t msg_cache_idx; /* Index of entry in message cache */
|
||||
};
|
||||
|
||||
@ -406,7 +410,7 @@ extern struct bt_mesh_net bt_mesh;
|
||||
|
||||
#define BLE_MESH_NET_IVI_TX (bt_mesh.iv_index - \
|
||||
bt_mesh_atomic_test_bit(bt_mesh.flags, \
|
||||
BLE_MESH_IVU_IN_PROGRESS))
|
||||
BLE_MESH_IVU_IN_PROGRESS))
|
||||
#define BLE_MESH_NET_IVI_RX(rx) (bt_mesh.iv_index - (rx)->old_iv)
|
||||
|
||||
#define BLE_MESH_NET_HDR_LEN 9
|
||||
|
@ -758,15 +758,17 @@ int bt_le_adv_start(const struct bt_mesh_adv_param *param,
|
||||
const struct bt_mesh_adv_data *ad, size_t ad_len,
|
||||
const struct bt_mesh_adv_data *sd, size_t sd_len)
|
||||
{
|
||||
struct ble_gap_adv_params adv_params;
|
||||
uint8_t buf[BLE_HS_ADV_MAX_SZ];
|
||||
uint16_t interval = 0;
|
||||
uint8_t buf_len = 0;
|
||||
int err;
|
||||
|
||||
#if BLE_MESH_DEV
|
||||
if (bt_mesh_atomic_test_bit(bt_mesh_dev.flags, BLE_MESH_DEV_ADVERTISING)) {
|
||||
return -EALREADY;
|
||||
}
|
||||
#endif
|
||||
uint8_t buf[BLE_HS_ADV_MAX_SZ];
|
||||
uint8_t buf_len = 0;
|
||||
int err;
|
||||
struct ble_gap_adv_params adv_params;
|
||||
|
||||
err = set_ad(ad, ad_len, buf, &buf_len);
|
||||
if (err) {
|
||||
@ -797,8 +799,6 @@ int bt_le_adv_start(const struct bt_mesh_adv_param *param,
|
||||
}
|
||||
|
||||
memset(&adv_params, 0, sizeof adv_params);
|
||||
adv_params.itvl_min = param->interval_min;
|
||||
adv_params.itvl_max = param->interval_max;
|
||||
|
||||
if (param->options & BLE_MESH_ADV_OPT_CONNECTABLE) {
|
||||
adv_params.conn_mode = BLE_GAP_CONN_MODE_UND;
|
||||
@ -811,6 +811,25 @@ int bt_le_adv_start(const struct bt_mesh_adv_param *param,
|
||||
adv_params.disc_mode = BLE_GAP_DISC_MODE_NON;
|
||||
}
|
||||
|
||||
interval = param->interval_min;
|
||||
|
||||
#if CONFIG_BLE_MESH_RANDOM_ADV_INTERVAL
|
||||
/* If non-connectable mesh packets are transmitted with an adv interval
|
||||
* not smaller than 10ms, then we will use a random adv interval between
|
||||
* [interval / 2, interval] for them.
|
||||
*/
|
||||
if (adv_params.conn_mode == BLE_GAP_CONN_MODE_NON &&
|
||||
adv_params.disc_mode == BLE_GAP_DISC_MODE_NON && interval >= 16) {
|
||||
interval >>= 1;
|
||||
interval += (bt_mesh_get_rand() % (interval + 1));
|
||||
|
||||
BT_INFO("%u->%u", param->interval_min, interval);
|
||||
}
|
||||
#endif
|
||||
|
||||
adv_params.itvl_min = interval;
|
||||
adv_params.itvl_max = interval;
|
||||
|
||||
again:
|
||||
err = ble_gap_adv_start(BLE_OWN_ADDR_PUBLIC, NULL, BLE_HS_FOREVER, &adv_params,
|
||||
gap_event_cb, NULL);
|
||||
@ -1940,10 +1959,6 @@ int bt_mesh_update_exceptional_list(uint8_t sub_code, uint32_t type, void *info)
|
||||
uint8_t value[6] = {0};
|
||||
int rc = 0;
|
||||
|
||||
#if MYNEWT_VAL(BLE_HCI_VS)
|
||||
struct ble_hci_vs_duplicate_exception_list_cp cmd;
|
||||
#endif
|
||||
|
||||
if ((sub_code > BLE_MESH_EXCEP_LIST_SUB_CODE_CLEAN) ||
|
||||
(sub_code < BLE_MESH_EXCEP_LIST_SUB_CODE_CLEAN &&
|
||||
type > BLE_MESH_EXCEP_LIST_TYPE_MESH_PROXY_ADV) ||
|
||||
@ -1958,18 +1973,23 @@ int bt_mesh_update_exceptional_list(uint8_t sub_code, uint32_t type, void *info)
|
||||
BT_ERR("Invalid Provisioning Link ID");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* When removing an unused link (i.e., Link ID is 0), and since
|
||||
* Controller has never added this Link ID, it will cause error
|
||||
* log been wrongly reported.
|
||||
* Therefore, add this check here to avoid such occurrences.
|
||||
*/
|
||||
if (*(uint32_t *)info == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
sys_memcpy_swap(value, info, sizeof(uint32_t));
|
||||
}
|
||||
|
||||
BT_DBG("%s exceptional list, type 0x%08x", sub_code ? "Remove" : "Add", type);
|
||||
|
||||
#if MYNEWT_VAL(BLE_HCI_VS)
|
||||
cmd.operation = sub_code;
|
||||
cmd.type = htole32(type);
|
||||
memcpy(&cmd.device_info, value, 6);
|
||||
|
||||
rc = ble_hs_hci_send_vs_cmd(BLE_HCI_OCF_VS_DUPLICATE_EXCEPTION_LIST,
|
||||
&cmd, sizeof(cmd), NULL, 0);
|
||||
rc = ble_gap_duplicate_exception_list(sub_code, type, value, NULL);
|
||||
#endif
|
||||
|
||||
return rc;
|
||||
|
@ -62,8 +62,8 @@ extern "C" {
|
||||
#define REC_RSP_REC_NOT_PRESENT 0x01
|
||||
#define REC_RSP_OFFSET_OUT_OF_BOUND 0x02
|
||||
|
||||
#define CERT_BASED_PROV_SUPPORT(oob) ((oob) & BIT_MASK(7))
|
||||
#define PROV_REC_SUPPORT(oob) ((oob) & BIT_MASK(8))
|
||||
#define CERT_BASED_PROV_SUPPORT(oob) ((oob) & BIT(7))
|
||||
#define PROV_REC_SUPPORT(oob) ((oob) & BIT(8))
|
||||
|
||||
#if CONFIG_BLE_MESH_PROV_EPA
|
||||
#define PROV_ENC_SIZE(link) ((link)->algorithm == PROV_ALG_P256_HMAC_SHA256 ? 32 : 16)
|
||||
|
@ -371,8 +371,7 @@ static int provisioner_start_prov_pb_adv(const uint8_t uuid[16], const bt_mesh_a
|
||||
|
||||
for (i = 0; i < CONFIG_BLE_MESH_PBA_SAME_TIME; i++) {
|
||||
if (!bt_mesh_atomic_test_bit(prov_links[i].flags, LINK_ACTIVE) &&
|
||||
!bt_mesh_atomic_test_bit(prov_links[i].flags, LINK_CLOSING)
|
||||
) {
|
||||
!bt_mesh_atomic_test_bit(prov_links[i].flags, LINK_CLOSING)) {
|
||||
memcpy(prov_links[i].uuid, uuid, 16);
|
||||
prov_links[i].oob_info = oob_info;
|
||||
if (addr) {
|
||||
@ -1070,14 +1069,24 @@ static void reset_adv_link(struct bt_mesh_prov_link *link, uint8_t reason)
|
||||
|
||||
static void send_link_open(struct bt_mesh_prov_link *link)
|
||||
{
|
||||
uint8_t count;
|
||||
int i;
|
||||
|
||||
/* Generate link ID, and may need to check if this id is
|
||||
* currently being used, which may will not happen ever.
|
||||
*/
|
||||
bt_mesh_rand(&link->link_id, sizeof(link->link_id));
|
||||
link->link_id = 0;
|
||||
|
||||
while (1) {
|
||||
count = 0;
|
||||
|
||||
/* Make sure the generated Link ID is not 0 */
|
||||
while(link->link_id == 0) {
|
||||
bt_mesh_rand(&link->link_id, sizeof(link->link_id));
|
||||
if (count++ > 10) {
|
||||
BT_ERR("Link ID error: all zero");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check if the generated Link ID is the same with other links */
|
||||
for (i = 0; i < CONFIG_BLE_MESH_PBA_SAME_TIME; i++) {
|
||||
if (bt_mesh_atomic_test_bit(prov_links[i].flags, LINK_ACTIVE) &&
|
||||
prov_links[i].link_id == link->link_id) {
|
||||
@ -1085,6 +1094,7 @@ static void send_link_open(struct bt_mesh_prov_link *link)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == CONFIG_BLE_MESH_PBA_SAME_TIME) {
|
||||
break;
|
||||
}
|
||||
@ -3037,8 +3047,8 @@ void bt_mesh_provisioner_prov_adv_recv(struct net_buf_simple *buf,
|
||||
|
||||
uuid = buf->data;
|
||||
net_buf_simple_pull(buf, 16);
|
||||
/* Mesh beacon uses big-endian to send beacon data */
|
||||
oob_info = net_buf_simple_pull_be16(buf);
|
||||
/* According CSS, all the field within adv data shall be little-endian */
|
||||
oob_info = net_buf_simple_pull_le16(buf);
|
||||
|
||||
if (provisioner_check_unprov_dev_info(uuid, BLE_MESH_PROV_GATT)) {
|
||||
return;
|
||||
|
@ -35,7 +35,8 @@ _Static_assert(!(IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_SERVER) && IS_ENABLED(CON
|
||||
|
||||
#define ADV_OPT (BLE_MESH_ADV_OPT_CONNECTABLE | BLE_MESH_ADV_OPT_ONE_TIME)
|
||||
|
||||
#if CONFIG_BLE_MESH_GATT_PROXY_SERVER && CONFIG_BLE_MESH_PRB_SRV
|
||||
#if CONFIG_BLE_MESH_GATT_PROXY_SERVER && \
|
||||
(CONFIG_BLE_MESH_PRB_SRV || CONFIG_BLE_MESH_PROXY_SOLIC_PDU_RX)
|
||||
#define RAND_UPDATE_INTERVAL K_MINUTES(10)
|
||||
|
||||
/* The Random field of Private Network Identity
|
||||
@ -438,12 +439,12 @@ static int beacon_send(struct bt_mesh_proxy_client *client, struct bt_mesh_subne
|
||||
|
||||
#if CONFIG_BLE_MESH_PROXY_PRIVACY
|
||||
if (client->proxy_privacy == BLE_MESH_PROXY_PRIVACY_ENABLED) {
|
||||
bt_mesh_private_beacon_create(sub, &buf);
|
||||
|
||||
/* NOTE: Each time a Mesh Private beacon for a subnet is sent to a Proxy Client,
|
||||
* the Random field in the Mesh Private beacon shall be regenerated.
|
||||
*/
|
||||
bt_mesh_private_beacon_update_random(sub);
|
||||
|
||||
bt_mesh_private_beacon_create(sub, &buf);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
@ -476,22 +477,9 @@ static void proxy_send_beacons(struct k_work *work)
|
||||
for (i = 0; i < ARRAY_SIZE(bt_mesh.sub); i++) {
|
||||
struct bt_mesh_subnet *sub = &bt_mesh.sub[i];
|
||||
|
||||
#if 0
|
||||
if (bt_mesh_gatt_proxy_get() == BLE_MESH_GATT_PROXY_ENABLED ||
|
||||
sub->node_id == BLE_MESH_NODE_IDENTITY_RUNNING) {
|
||||
sub->proxy_privacy = BLE_MESH_PROXY_PRIVACY_DISABLED;
|
||||
} else if (true) {
|
||||
#if CONFIG_BLE_MESH_PRB_SRV
|
||||
/* TODO: Check if Private GATT Proxy or Private Node Identity is enabled */
|
||||
#endif
|
||||
sub->proxy_privacy = BLE_MESH_PROXY_PRIVACY_ENABLED;
|
||||
} else {
|
||||
sub->proxy_privacy = BLE_MESH_PROXY_PRIVACY_NOT_SUPPORTED;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (sub->net_idx != BLE_MESH_KEY_UNUSED) {
|
||||
beacon_send(client, sub);
|
||||
|
||||
#if CONFIG_BLE_MESH_DF_SRV
|
||||
if (sub->directed_proxy != BLE_MESH_DIRECTED_PROXY_NOT_SUPPORTED) {
|
||||
bt_mesh_directed_proxy_server_directed_proxy_caps_status_send(client->conn, sub);
|
||||
@ -630,16 +618,58 @@ static bool is_exist_private_node_id_enable(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
void disable_all_private_node_identity(void)
|
||||
int bt_mesh_proxy_private_identity_disable(void)
|
||||
{
|
||||
if (!bt_mesh_is_provisioned()) {
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(bt_mesh.sub); i++) {
|
||||
/* NOTE: Set private node identity state of all valid subnets disabled */
|
||||
struct bt_mesh_subnet *sub = &bt_mesh.sub[i];
|
||||
|
||||
if (sub->net_idx != BLE_MESH_KEY_UNUSED) {
|
||||
bt_mesh_proxy_server_private_identity_stop(sub);
|
||||
if (sub->net_idx == BLE_MESH_KEY_UNUSED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sub->private_node_id == BLE_MESH_PRIVATE_NODE_IDENTITY_NOT_SUPPORTED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bt_mesh_proxy_server_private_identity_stop(sub);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bt_mesh_proxy_private_identity_enable(void)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
if (!bt_mesh_is_provisioned()) {
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
for (size_t i = 0U; i < ARRAY_SIZE(bt_mesh.sub); i++) {
|
||||
struct bt_mesh_subnet *sub = &bt_mesh.sub[i];
|
||||
|
||||
if (sub->net_idx == BLE_MESH_KEY_UNUSED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sub->private_node_id == BLE_MESH_PRIVATE_NODE_IDENTITY_NOT_SUPPORTED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bt_mesh_proxy_server_private_identity_start(sub);
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count) {
|
||||
bt_mesh_adv_update();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_PRB_SRV */
|
||||
#endif /* GATT_PROXY */
|
||||
@ -1373,7 +1403,7 @@ static const struct bt_mesh_adv_data net_id_ad[] = {
|
||||
BLE_MESH_ADV_DATA(BLE_MESH_DATA_SVC_DATA16, proxy_svc_data, NET_ID_LEN),
|
||||
};
|
||||
|
||||
#if CONFIG_BLE_MESH_PRB_SRV
|
||||
#if CONFIG_BLE_MESH_PRB_SRV || CONFIG_BLE_MESH_PROXY_SOLIC_PDU_RX
|
||||
static const struct bt_mesh_adv_data private_node_id_ad[] = {
|
||||
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_FLAGS, (BLE_MESH_AD_GENERAL | BLE_MESH_AD_NO_BREDR)),
|
||||
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_UUID16_ALL, 0x28, 0x18),
|
||||
@ -1533,23 +1563,6 @@ static int private_node_id_adv(struct bt_mesh_subnet *sub)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void bt_mesh_prb_pnid_adv_local_set(bool start)
|
||||
{
|
||||
for (size_t i = 0U; i < ARRAY_SIZE(bt_mesh.sub); i++) {
|
||||
struct bt_mesh_subnet *sub = &bt_mesh.sub[i];
|
||||
|
||||
if (sub->net_idx == BLE_MESH_KEY_UNUSED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (start) {
|
||||
bt_mesh_proxy_server_private_identity_start(sub);
|
||||
} else {
|
||||
bt_mesh_proxy_server_private_identity_stop(sub);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_PRB_SRV */
|
||||
|
||||
#if (CONFIG_BLE_MESH_PRB_SRV || \
|
||||
@ -1751,7 +1764,8 @@ static size_t gatt_prov_adv_create(struct bt_mesh_adv_data prov_sd[2])
|
||||
}
|
||||
|
||||
memcpy(prov_svc_data + 2, bt_mesh_prov_get()->uuid, 16);
|
||||
sys_put_be16(bt_mesh_prov_get()->oob_info, prov_svc_data + 18);
|
||||
/* According CSS, all the field within adv data shall be little-endian */
|
||||
sys_put_le16(bt_mesh_prov_get()->oob_info, prov_svc_data + 18);
|
||||
|
||||
if (bt_mesh_prov_get()->uri) {
|
||||
size_t uri_len = strlen(bt_mesh_prov_get()->uri);
|
||||
|
@ -107,9 +107,9 @@ void bt_mesh_disable_private_gatt_proxy(void);
|
||||
|
||||
bool bt_mesh_proxy_server_is_node_id_enable(void);
|
||||
|
||||
void disable_all_private_node_identity(void);
|
||||
int bt_mesh_proxy_private_identity_disable(void);
|
||||
|
||||
void bt_mesh_prb_pnid_adv_local_set(bool start);
|
||||
int bt_mesh_proxy_private_identity_enable(void);
|
||||
#endif /* CONFIG_BLE_MESH_PRB_SRV */
|
||||
|
||||
void bt_mesh_proxy_server_identity_start(struct bt_mesh_subnet *sub);
|
||||
|
@ -87,11 +87,6 @@ bool bt_mesh_rpl_check(struct bt_mesh_net_rx *rx, struct bt_mesh_rpl **match)
|
||||
return rpl_check_and_store(rx, match);
|
||||
}
|
||||
|
||||
bool bt_mesh_bridge_rpl_check(struct bt_mesh_net_rx *rx, struct bt_mesh_rpl **match)
|
||||
{
|
||||
return rpl_check_and_store(rx, match);
|
||||
}
|
||||
|
||||
void bt_mesh_rpl_update(void)
|
||||
{
|
||||
/* Discard "old old" IV Index entries from RPL and flag
|
||||
|
@ -20,8 +20,6 @@ void bt_mesh_update_rpl(struct bt_mesh_rpl *rpl, struct bt_mesh_net_rx *rx);
|
||||
|
||||
bool bt_mesh_rpl_check(struct bt_mesh_net_rx *rx, struct bt_mesh_rpl **match);
|
||||
|
||||
bool bt_mesh_bridge_rpl_check(struct bt_mesh_net_rx *rx, struct bt_mesh_rpl **match);
|
||||
|
||||
void bt_mesh_rpl_update(void);
|
||||
|
||||
void bt_mesh_rpl_reset_single(uint16_t src, bool erase);
|
||||
|
@ -90,7 +90,7 @@ static struct seg_tx {
|
||||
uint8_t tag; /* Additional metadata */
|
||||
const struct bt_mesh_send_cb *cb;
|
||||
void *cb_data;
|
||||
struct k_delayed_work retransmit; /* Retransmit timer */
|
||||
struct k_delayed_work rtx_timer; /* Segment Retransmission timer */
|
||||
} seg_tx[CONFIG_BLE_MESH_TX_SEG_MSG_COUNT];
|
||||
|
||||
static struct seg_rx {
|
||||
@ -106,7 +106,7 @@ static struct seg_rx {
|
||||
uint16_t dst;
|
||||
uint32_t block;
|
||||
uint32_t last;
|
||||
struct k_delayed_work ack;
|
||||
struct k_delayed_work ack_timer;
|
||||
struct net_buf_simple buf;
|
||||
} seg_rx[CONFIG_BLE_MESH_RX_SEG_MSG_COUNT] = {
|
||||
[0 ... (CONFIG_BLE_MESH_RX_SEG_MSG_COUNT - 1)] = {
|
||||
@ -145,7 +145,7 @@ uint8_t bt_mesh_get_seg_rtx_num(void)
|
||||
return SEG_RETRANSMIT_ATTEMPTS;
|
||||
}
|
||||
|
||||
int32_t bt_mesh_get_seg_rtx_timeout(uint8_t ttl)
|
||||
int32_t bt_mesh_get_seg_rtx_timeout(uint16_t dst, uint8_t ttl)
|
||||
{
|
||||
/* This function will be used when a client model sending an
|
||||
* acknowledged message. And if the dst of a message is not
|
||||
@ -322,7 +322,7 @@ static void seg_tx_reset(struct seg_tx *tx)
|
||||
|
||||
bt_mesh_seg_tx_lock();
|
||||
|
||||
k_delayed_work_cancel(&tx->retransmit);
|
||||
k_delayed_work_cancel(&tx->rtx_timer);
|
||||
|
||||
tx->cb = NULL;
|
||||
tx->cb_data = NULL;
|
||||
@ -360,6 +360,8 @@ static inline void seg_tx_complete(struct seg_tx *tx, int err)
|
||||
|
||||
seg_tx_reset(tx);
|
||||
|
||||
/* TODO: notify the completion of sending segmented message */
|
||||
|
||||
if (cb && cb->end) {
|
||||
cb->end(err, cb_data);
|
||||
}
|
||||
@ -377,7 +379,7 @@ static void schedule_retransmit(struct seg_tx *tx)
|
||||
return;
|
||||
}
|
||||
|
||||
k_delayed_work_submit(&tx->retransmit, SEG_RETRANSMIT_TIMEOUT(tx));
|
||||
k_delayed_work_submit(&tx->rtx_timer, SEG_RETRANSMIT_TIMEOUT(tx));
|
||||
}
|
||||
|
||||
static void seg_first_send_start(uint16_t duration, int err, void *user_data)
|
||||
@ -471,7 +473,7 @@ static void seg_tx_send_unacked(struct seg_tx *tx)
|
||||
|
||||
static void seg_retransmit(struct k_work *work)
|
||||
{
|
||||
struct seg_tx *tx = CONTAINER_OF(work, struct seg_tx, retransmit);
|
||||
struct seg_tx *tx = CONTAINER_OF(work, struct seg_tx, rtx_timer);
|
||||
|
||||
seg_tx_send_unacked(tx);
|
||||
}
|
||||
@ -511,10 +513,6 @@ static int send_seg(struct bt_mesh_net_tx *net_tx, struct net_buf_simple *sdu,
|
||||
}
|
||||
|
||||
tx->dst = net_tx->ctx->addr;
|
||||
/* TODO:
|
||||
* When SAR Transmitter is introduced, the xmit may be
|
||||
* updated with "bt_mesh_get_sar_seg_transmit()".
|
||||
*/
|
||||
if (sdu->len) {
|
||||
tx->seg_n = (sdu->len - 1) / seg_len(!!ctl_op);
|
||||
} else {
|
||||
@ -784,6 +782,12 @@ static int sdu_recv(struct bt_mesh_net_rx *rx, uint32_t seq, uint8_t hdr,
|
||||
rx->ctl, rx->ctx.recv_ttl, rx->ctx.addr, rx->ctx.recv_dst,
|
||||
bt_hex(sdu->data, sdu->len));
|
||||
|
||||
/* When the Device Key Candidate is available, and an access message
|
||||
* is decrypted using the Device Key Candidate that was delivered to
|
||||
* the access layer, then the node shall revoke the device key, the
|
||||
* Device Key Candidate shall become the device key, and the Device
|
||||
* Key Candidate shall become unavailable.
|
||||
*/
|
||||
revoke_dev_key(dev_key);
|
||||
|
||||
rx->ctx.app_idx = BLE_MESH_KEY_DEV;
|
||||
@ -942,7 +946,7 @@ static int trans_ack(struct bt_mesh_net_rx *rx, uint8_t hdr,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
k_delayed_work_cancel(&tx->retransmit);
|
||||
k_delayed_work_cancel(&tx->rtx_timer);
|
||||
|
||||
while ((bit = find_lsb_set(ack))) {
|
||||
if (tx->seg[bit - 1]) {
|
||||
@ -1216,11 +1220,9 @@ static int send_ack(struct bt_mesh_subnet *sub, uint16_t src, uint16_t dst,
|
||||
|
||||
static void seg_rx_reset(struct seg_rx *rx, bool full_reset)
|
||||
{
|
||||
BT_DBG("rx %p", rx);
|
||||
|
||||
bt_mesh_seg_rx_lock();
|
||||
|
||||
k_delayed_work_cancel(&rx->ack);
|
||||
k_delayed_work_cancel(&rx->ack_timer);
|
||||
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_FRIEND) && rx->obo &&
|
||||
rx->block != BLOCK_COMPLETE(rx->seg_n)) {
|
||||
@ -1267,9 +1269,7 @@ static uint32_t incomplete_timeout(struct seg_rx *rx)
|
||||
|
||||
static void seg_ack(struct k_work *work)
|
||||
{
|
||||
struct seg_rx *rx = CONTAINER_OF(work, struct seg_rx, ack);
|
||||
|
||||
BT_DBG("rx %p", rx);
|
||||
struct seg_rx *rx = CONTAINER_OF(work, struct seg_rx, ack_timer);
|
||||
|
||||
bt_mesh_seg_rx_lock();
|
||||
|
||||
@ -1291,14 +1291,14 @@ static void seg_ack(struct k_work *work)
|
||||
send_ack(rx->sub, rx->dst, rx->src, rx->ttl, &rx->seq_auth,
|
||||
rx->block, rx->obo);
|
||||
|
||||
k_delayed_work_submit(&rx->ack, ack_timeout(rx));
|
||||
k_delayed_work_submit(&rx->ack_timer, ack_timeout(rx));
|
||||
|
||||
bt_mesh_seg_rx_unlock();
|
||||
}
|
||||
|
||||
static inline bool sdu_len_is_ok(bool ctl, uint8_t seg_n)
|
||||
{
|
||||
return ((seg_n * seg_len(ctl) + 1) <= CONFIG_BLE_MESH_RX_SDU_MAX);
|
||||
return ((seg_n + 1) * seg_len(ctl) <= CONFIG_BLE_MESH_RX_SDU_MAX);
|
||||
}
|
||||
|
||||
static struct seg_rx *seg_rx_find(struct bt_mesh_net_rx *net_rx,
|
||||
@ -1568,9 +1568,9 @@ found_rx:
|
||||
/* Reset the Incomplete Timer */
|
||||
rx->last = k_uptime_get_32();
|
||||
|
||||
if (!k_delayed_work_remaining_get(&rx->ack) &&
|
||||
if (!k_delayed_work_remaining_get(&rx->ack_timer) &&
|
||||
!bt_mesh_lpn_established()) {
|
||||
k_delayed_work_submit(&rx->ack, ack_timeout(rx));
|
||||
k_delayed_work_submit(&rx->ack_timer, ack_timeout(rx));
|
||||
}
|
||||
|
||||
/* Location in buffer can be calculated based on seg_o & rx->ctl */
|
||||
@ -1594,7 +1594,7 @@ found_rx:
|
||||
|
||||
*pdu_type = BLE_MESH_FRIEND_PDU_COMPLETE;
|
||||
|
||||
k_delayed_work_cancel(&rx->ack);
|
||||
k_delayed_work_cancel(&rx->ack_timer);
|
||||
|
||||
send_ack(net_rx->sub, net_rx->ctx.recv_dst, net_rx->ctx.addr,
|
||||
net_rx->ctx.send_ttl, seq_auth, rx->block, rx->obo);
|
||||
@ -1754,11 +1754,11 @@ void bt_mesh_trans_init(void)
|
||||
bt_mesh_sar_init();
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(seg_tx); i++) {
|
||||
k_delayed_work_init(&seg_tx[i].retransmit, seg_retransmit);
|
||||
k_delayed_work_init(&seg_tx[i].rtx_timer, seg_retransmit);
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(seg_rx); i++) {
|
||||
k_delayed_work_init(&seg_rx[i].ack, seg_ack);
|
||||
k_delayed_work_init(&seg_rx[i].ack_timer, seg_ack);
|
||||
seg_rx[i].buf.__buf = (seg_rx_buf_data +
|
||||
(i * CONFIG_BLE_MESH_RX_SDU_MAX));
|
||||
seg_rx[i].buf.data = seg_rx[i].buf.__buf;
|
||||
@ -1778,11 +1778,11 @@ void bt_mesh_trans_deinit(bool erase)
|
||||
bt_mesh_rpl_reset(erase);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(seg_tx); i++) {
|
||||
k_delayed_work_free(&seg_tx[i].retransmit);
|
||||
k_delayed_work_free(&seg_tx[i].rtx_timer);
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(seg_rx); i++) {
|
||||
k_delayed_work_free(&seg_rx[i].ack);
|
||||
k_delayed_work_free(&seg_rx[i].ack_timer);
|
||||
}
|
||||
|
||||
bt_mesh_mutex_free(&seg_tx_lock);
|
||||
|
2344
components/bt/esp_ble_mesh/core/transport.enh.c
Normal file
2344
components/bt/esp_ble_mesh/core/transport.enh.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -96,7 +96,7 @@ struct bt_mesh_ctl_friend_sub_confirm {
|
||||
|
||||
uint8_t bt_mesh_get_seg_rtx_num(void);
|
||||
|
||||
int32_t bt_mesh_get_seg_rtx_timeout(uint8_t ttl);
|
||||
int32_t bt_mesh_get_seg_rtx_timeout(uint16_t dst, uint8_t ttl);
|
||||
|
||||
struct bt_mesh_app_key *bt_mesh_app_key_get(uint16_t app_idx);
|
||||
|
||||
|
@ -76,6 +76,7 @@
|
||||
#define CLI_PARAM(a) ((bt_mesh_client_common_param_t *)(a))
|
||||
#define CLI_NODE(a) ((bt_mesh_client_node_t *)(a))
|
||||
#define ADV_DATA(a) ((const struct bt_mesh_adv_data *)(a))
|
||||
#define RPL(a) ((struct bt_mesh_rpl *)(a))
|
||||
#define VOID(a) ((void *)(a))
|
||||
|
||||
/* Sys utilities */
|
||||
@ -739,6 +740,11 @@ size_t bt_mesh_ext_comp_get_elem_count(const void *comp)
|
||||
return COMP(comp)->elem_count;
|
||||
}
|
||||
|
||||
void *bt_mesh_ext_comp_get_elem_s(const void *comp)
|
||||
{
|
||||
return COMP(comp)->elem;
|
||||
}
|
||||
|
||||
void *bt_mesh_ext_comp_get_elem(const void *comp, uint8_t index)
|
||||
{
|
||||
return &COMP(comp)->elem[index];
|
||||
@ -2228,6 +2234,56 @@ bool bt_mesh_ext_lpn_match(uint16_t addr)
|
||||
#endif /* CONFIG_BLE_MESH_LOW_POWER */
|
||||
}
|
||||
|
||||
uint16_t bt_mesh_ext_lpn_frnd(void)
|
||||
{
|
||||
#if CONFIG_BLE_MESH_LOW_POWER
|
||||
return bt_mesh.lpn.frnd;
|
||||
#else
|
||||
assert(0);
|
||||
return 0;
|
||||
#endif /* CONFIG_BLE_MESH_LOW_POWER */
|
||||
}
|
||||
|
||||
/* RPL */
|
||||
uint16_t bt_mesh_ext_rpl_get_src(void *rpl)
|
||||
{
|
||||
#if CONFIG_BLE_MESH_LOW_POWER
|
||||
return RPL(rpl)->src;
|
||||
#else
|
||||
assert(0);
|
||||
return 0;
|
||||
#endif /* CONFIG_BLE_MESH_LOW_POWER */
|
||||
}
|
||||
|
||||
bool bt_mesh_ext_rpl_get_old_iv(void *rpl)
|
||||
{
|
||||
#if CONFIG_BLE_MESH_LOW_POWER
|
||||
return RPL(rpl)->old_iv;
|
||||
#else
|
||||
assert(0);
|
||||
return false;
|
||||
#endif /* CONFIG_BLE_MESH_LOW_POWER */
|
||||
}
|
||||
|
||||
uint32_t bt_mesh_ext_rpl_get_seq(void *rpl)
|
||||
{
|
||||
#if CONFIG_BLE_MESH_LOW_POWER
|
||||
return RPL(rpl)->seq;
|
||||
#else
|
||||
assert(0);
|
||||
return 0;
|
||||
#endif /* CONFIG_BLE_MESH_LOW_POWER */
|
||||
}
|
||||
|
||||
void bt_mesh_ext_update_rpl(void *rpl, void *rx)
|
||||
{
|
||||
#if CONFIG_BLE_MESH_LOW_POWER
|
||||
bt_mesh_update_rpl(RPL(rpl), NET_RX(rx));
|
||||
#else
|
||||
assert(0);
|
||||
#endif /* CONFIG_BLE_MESH_LOW_POWER */
|
||||
}
|
||||
|
||||
/* Adv */
|
||||
uint8_t bt_mesh_ext_adv_data_get_type(const void *ad)
|
||||
{
|
||||
@ -2558,16 +2614,6 @@ uint8_t *bt_mesh_ext_sub_get_mpb_random(void *sub)
|
||||
#endif /* CONFIG_BLE_MESH_PRIVATE_BEACON */
|
||||
}
|
||||
|
||||
uint8_t *bt_mesh_ext_sub_get_mpb_random_last(void *sub)
|
||||
{
|
||||
#if CONFIG_BLE_MESH_PRIVATE_BEACON
|
||||
return SUBNET(sub)->mpb_random_last;
|
||||
#else
|
||||
assert(0);
|
||||
return NULL;
|
||||
#endif /* CONFIG_BLE_MESH_PRIVATE_BEACON */
|
||||
}
|
||||
|
||||
uint8_t bt_mesh_ext_sub_get_private_node_id(void *sub)
|
||||
{
|
||||
#if CONFIG_BLE_MESH_PRIVATE_BEACON
|
||||
@ -3419,6 +3465,21 @@ void bt_mesh_ext_net_rx_set_net_if(void *rx, uint8_t net_if)
|
||||
NET_RX(rx)->net_if = net_if;
|
||||
}
|
||||
|
||||
bool bt_mesh_ext_net_rx_get_old_iv(void *rx)
|
||||
{
|
||||
return NET_RX(rx)->old_iv;
|
||||
}
|
||||
|
||||
bool bt_mesh_ext_net_rx_get_sbr_rpl(void *rx)
|
||||
{
|
||||
return NET_RX(rx)->sbr_rpl;
|
||||
}
|
||||
|
||||
void bt_mesh_ext_net_rx_set_sbr_rpl(void *rx, bool sbr_rpl)
|
||||
{
|
||||
NET_RX(rx)->sbr_rpl = sbr_rpl;
|
||||
}
|
||||
|
||||
/* struct bt_mesh_msg_ctx */
|
||||
uint16_t bt_mesh_ext_msg_ctx_get_net_idx(void *ctx)
|
||||
{
|
||||
@ -3674,12 +3735,6 @@ int bt_mesh_ext_client_send_msg(void *param, struct net_buf_simple *msg,
|
||||
return bt_mesh_client_send_msg(param, msg, need_ack, VOID(timeout_cb));
|
||||
}
|
||||
|
||||
/* Bridge Configuration */
|
||||
bool bt_mesh_ext_bridge_rpl_check(void *rx, void **match)
|
||||
{
|
||||
return bt_mesh_bridge_rpl_check(rx, (struct bt_mesh_rpl **)match);
|
||||
}
|
||||
|
||||
#if CONFIG_BLE_MESH_BRC_SRV
|
||||
struct bt_mesh_subnet_bridge_table {
|
||||
uint8_t bridge_direction;
|
||||
@ -3695,6 +3750,8 @@ struct bt_mesh_bridge_cfg_srv {
|
||||
uint16_t bridging_table_size;
|
||||
struct bt_mesh_subnet_bridge_table bridge_table[CONFIG_BLE_MESH_MAX_BRIDGING_TABLE_ENTRY_COUNT];
|
||||
};
|
||||
|
||||
static struct bt_mesh_rpl bridge_rpl[CONFIG_BLE_MESH_BRIDGE_CRPL];
|
||||
#endif /* CONFIG_BLE_MESH_BRC_SRV */
|
||||
|
||||
void *bt_mesh_ext_brc_srv_get_bridge_table_entry(void *srv, uint8_t index)
|
||||
@ -3707,6 +3764,16 @@ 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)
|
||||
{
|
||||
#if CONFIG_BLE_MESH_BRC_SRV
|
||||
return &bridge_rpl[index];
|
||||
#else
|
||||
assert(0);
|
||||
return NULL;
|
||||
#endif /* CONFIG_BLE_MESH_BRC_SRV */
|
||||
}
|
||||
|
||||
/* BTC */
|
||||
void bt_mesh_ext_agg_client_cb_evt_to_btc(uint32_t opcode, uint8_t event,
|
||||
void *model, void *ctx,
|
||||
@ -3935,6 +4002,7 @@ typedef struct {
|
||||
uint16_t config_ble_mesh_proxy_solic_rx_crpl;
|
||||
uint16_t config_ble_mesh_proxy_solic_tx_src_count;
|
||||
uint16_t config_ble_mesh_max_bridging_table_entry_count;
|
||||
uint16_t config_ble_mesh_bridge_crpl;
|
||||
uint16_t config_ble_mesh_max_disc_table_entry_count;
|
||||
uint16_t config_ble_mesh_max_forward_table_entry_count;
|
||||
uint16_t config_ble_mesh_max_deps_nodes_per_path;
|
||||
@ -4105,6 +4173,7 @@ static const bt_mesh_ext_config_t bt_mesh_ext_cfg = {
|
||||
#endif /* CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX */
|
||||
#if CONFIG_BLE_MESH_BRC_SRV
|
||||
.config_ble_mesh_max_bridging_table_entry_count = CONFIG_BLE_MESH_MAX_BRIDGING_TABLE_ENTRY_COUNT,
|
||||
.config_ble_mesh_bridge_crpl = CONFIG_BLE_MESH_BRIDGE_CRPL,
|
||||
#endif /* CONFIG_BLE_MESH_BRC_SRV */
|
||||
#if CONFIG_BLE_MESH_DF_SRV
|
||||
.config_ble_mesh_max_disc_table_entry_count = CONFIG_BLE_MESH_MAX_DISC_TABLE_ENTRY_COUNT,
|
||||
@ -4328,6 +4397,7 @@ typedef struct {
|
||||
|
||||
/* CONFIG_BLE_MESH_LOW_POWER */
|
||||
bool (*_bt_mesh_ext_lpn_match)(uint16_t addr);
|
||||
uint16_t (*_bt_mesh_ext_lpn_frnd)(void);
|
||||
/* CONFIG_BLE_MESH_LOW_POWER */
|
||||
|
||||
/* CONFIG_BLE_MESH_USE_DUPLICATE_SCAN */
|
||||
@ -4448,7 +4518,6 @@ typedef struct {
|
||||
uint8_t (*_bt_mesh_ext_sub_get_mpb_ivi_last)(void *sub);
|
||||
void (*_bt_mesh_ext_sub_set_mpb_ivi_last)(void *sub, uint8_t mpb_ivi_last);
|
||||
uint8_t *(*_bt_mesh_ext_sub_get_mpb_random)(void *sub);
|
||||
uint8_t *(*_bt_mesh_ext_sub_get_mpb_random_last)(void *sub);
|
||||
uint8_t (*_bt_mesh_ext_sub_get_private_node_id)(void *sub);
|
||||
uint8_t *(*_bt_mesh_ext_sub_get_keys_private_beacon)(void *sub, uint8_t index);
|
||||
/* CONFIG_BLE_MESH_PRIVATE_BEACON */
|
||||
@ -4457,6 +4526,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);
|
||||
/* CONFIG_BLE_MESH_BRC_SRV */
|
||||
|
||||
/* CONFIG_BLE_MESH_AGG_CLI */
|
||||
@ -4649,6 +4719,7 @@ static const bt_mesh_ext_funcs_t bt_mesh_ext_func = {
|
||||
|
||||
/* CONFIG_BLE_MESH_LOW_POWER */
|
||||
._bt_mesh_ext_lpn_match = bt_mesh_ext_lpn_match,
|
||||
._bt_mesh_ext_lpn_frnd = bt_mesh_ext_lpn_frnd,
|
||||
/* CONFIG_BLE_MESH_LOW_POWER */
|
||||
|
||||
/* CONFIG_BLE_MESH_USE_DUPLICATE_SCAN */
|
||||
@ -4770,7 +4841,6 @@ static const bt_mesh_ext_funcs_t bt_mesh_ext_func = {
|
||||
._bt_mesh_ext_sub_get_mpb_ivi_last = bt_mesh_ext_sub_get_mpb_ivi_last,
|
||||
._bt_mesh_ext_sub_set_mpb_ivi_last = bt_mesh_ext_sub_set_mpb_ivi_last,
|
||||
._bt_mesh_ext_sub_get_mpb_random = bt_mesh_ext_sub_get_mpb_random,
|
||||
._bt_mesh_ext_sub_get_mpb_random_last = bt_mesh_ext_sub_get_mpb_random_last,
|
||||
._bt_mesh_ext_sub_get_private_node_id = bt_mesh_ext_sub_get_private_node_id,
|
||||
._bt_mesh_ext_sub_get_keys_private_beacon = bt_mesh_ext_sub_get_keys_private_beacon,
|
||||
/* CONFIG_BLE_MESH_PRIVATE_BEACON */
|
||||
@ -4779,6 +4849,7 @@ static const bt_mesh_ext_funcs_t bt_mesh_ext_func = {
|
||||
._bt_mesh_ext_sub_get_sbr_net_idx = bt_mesh_ext_sub_get_sbr_net_idx,
|
||||
._bt_mesh_ext_sub_set_sbr_net_idx = bt_mesh_ext_sub_set_sbr_net_idx,
|
||||
._bt_mesh_ext_brc_srv_get_bridge_table_entry = bt_mesh_ext_brc_srv_get_bridge_table_entry,
|
||||
._bt_mesh_ext_brc_srv_get_bridge_rpl = bt_mesh_ext_brc_srv_get_bridge_rpl,
|
||||
/* CONFIG_BLE_MESH_BRC_SRV */
|
||||
|
||||
/* CONFIG_BLE_MESH_AGG_CLI */
|
@ -119,6 +119,11 @@ int bt_mesh_directed_update_dependent_node(void *sub, uint8_t type,
|
||||
int bt_mesh_directed_forwarding_ctl_recv(uint8_t ctl_op, void *rx,
|
||||
struct net_buf_simple *buf);
|
||||
|
||||
void bt_mesh_restore_directed_forwarding_state(uint16_t net_idx,
|
||||
uint8_t directed_forwarding);
|
||||
|
||||
uint8_t bt_mesh_get_and_disable_directed_forwarding_state(void *sub);
|
||||
|
||||
int bt_mesh_directed_forwarding_sub_init(void *sub);
|
||||
|
||||
int bt_mesh_recovery_directed_forwarding_table(void *sub);
|
||||
@ -182,6 +187,8 @@ bool bt_mesh_bridge_change_net_key(void *rx, const uint8_t **enc,
|
||||
const uint8_t **priv,
|
||||
uint8_t *nid, uint8_t cred);
|
||||
|
||||
int bt_mesh_print_subnet_bridge_table(void);
|
||||
|
||||
void bt_mesh_disable_directed_proxy_state(uint16_t net_idx);
|
||||
|
||||
void bt_mesh_disable_directed_friend_state(uint16_t net_idx);
|
||||
@ -241,6 +248,30 @@ uint8_t bt_mesh_net_retrans_match(void *rx, uint8_t *cred, uint8_t *tag);
|
||||
|
||||
bool bt_mesh_dev_key_ca_valid(void);
|
||||
|
||||
uint8_t bt_mesh_get_sar_sis(void);
|
||||
|
||||
uint8_t bt_mesh_get_sar_urc(void);
|
||||
|
||||
uint8_t bt_mesh_get_sar_urwpc(void);
|
||||
|
||||
uint8_t bt_mesh_get_sar_uris(void);
|
||||
|
||||
uint8_t bt_mesh_get_sar_urii(void);
|
||||
|
||||
uint8_t bt_mesh_get_sar_mrc(void);
|
||||
|
||||
uint8_t bt_mesh_get_sar_mris(void);
|
||||
|
||||
uint8_t bt_mesh_get_sar_st(void);
|
||||
|
||||
uint8_t bt_mesh_get_sar_adi(void);
|
||||
|
||||
uint8_t bt_mesh_get_sar_arc(void);
|
||||
|
||||
uint8_t bt_mesh_get_sar_dt(void);
|
||||
|
||||
uint8_t bt_mesh_get_sar_rsis(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
1
components/bt/esp_ble_mesh/lib/lib
Submodule
1
components/bt/esp_ble_mesh/lib/lib
Submodule
Submodule components/bt/esp_ble_mesh/lib/lib added at 41bf5fc092
@ -198,7 +198,7 @@ static int32_t bt_mesh_client_calc_timeout(struct bt_mesh_msg_ctx *ctx,
|
||||
* All the messages sent from here are access messages.
|
||||
*/
|
||||
seg_rtx_num = bt_mesh_get_seg_rtx_num();
|
||||
seg_rtx_to = bt_mesh_get_seg_rtx_timeout(ctx->send_ttl);
|
||||
seg_rtx_to = bt_mesh_get_seg_rtx_timeout(ctx->addr, ctx->send_ttl);
|
||||
seg_count = (msg->len + mic_size - 1) / 12U + 1U;
|
||||
|
||||
duration = bt_mesh_get_adv_duration(ctx);
|
||||
|
@ -63,15 +63,16 @@ typedef struct {
|
||||
sar_unicast_retrans_interval_step:4; /*!< SAR Unicast Retransmissions Interval Step state */
|
||||
uint8_t sar_unicast_retrans_interval_increment:4, /*!< SAR Unicast Retransmissions Interval Increment state */
|
||||
sar_multicast_retrans_count:4; /*!< SAR Multicast Retransmissions Count state */
|
||||
uint8_t sar_multicast_retrans_interval:4; /*!< SAR Multicast Retransmissions Interval state */
|
||||
uint8_t sar_multicast_retrans_interval_step:4; /*!< SAR Multicast Retransmissions Interval state */
|
||||
} esp_ble_mesh_sar_transmitter_set_t;
|
||||
|
||||
/** Parameters of SAR Receiver Set */
|
||||
typedef struct {
|
||||
uint8_t sar_segments_threshold:5, /*!< SAR Segments Threshold state */
|
||||
sar_ack_delay_increment:3; /*!< SAR Acknowledgment Delay Increment state */
|
||||
uint8_t sar_ack_retrans_count:2, /*!< SAR Acknowledgment Retransmissions Count state */
|
||||
sar_discard_timeout:4; /*!< SAR Discard Timeout state */
|
||||
uint8_t sar_discard_timeout:4, /*!< SAR Discard Timeout state */
|
||||
sar_receiver_segment_interval_step:4; /*!< SAR Receiver Segment Interval Step state */
|
||||
uint8_t sar_ack_retrans_count:4; /*!< SAR Acknowledgment Retransmissions Count state */
|
||||
} esp_ble_mesh_sar_receiver_set_t;
|
||||
|
||||
/**
|
||||
@ -90,15 +91,16 @@ typedef struct {
|
||||
sar_unicast_retrans_interval_step:4; /*!< SAR Unicast Retransmissions Interval Step state */
|
||||
uint8_t sar_unicast_retrans_interval_increment:4, /*!< SAR Unicast Retransmissions Interval Increment state */
|
||||
sar_multicast_retrans_count:4; /*!< SAR Multicast Retransmissions Count state */
|
||||
uint8_t sar_multicast_retrans_interval:4; /*!< SAR Multicast Retransmissions Interval state */
|
||||
uint8_t sar_multicast_retrans_interval_step:4; /*!< SAR Multicast Retransmissions Interval state */
|
||||
} esp_ble_mesh_sar_transmitter_status_t;
|
||||
|
||||
/** Parameters of SAR Receiver Status */
|
||||
typedef struct {
|
||||
uint8_t sar_segments_threshold:5, /*!< SAR Segments Threshold state */
|
||||
sar_ack_delay_increment:3; /*!< SAR Acknowledgment Delay Increment state */
|
||||
uint8_t sar_ack_retrans_count:2, /*!< SAR Acknowledgment Retransmissions Count state */
|
||||
sar_discard_timeout:4; /*!< SAR Discard Timeout state */
|
||||
uint8_t sar_discard_timeout:4, /*!< SAR Discard Timeout state */
|
||||
sar_receiver_segment_interval_step:4; /*!< SAR Receiver Segment Interval Step state */
|
||||
uint8_t sar_ack_retrans_count:4; /*!< SAR Acknowledgment Retransmissions Count state */
|
||||
} esp_ble_mesh_sar_receiver_status_t;
|
||||
|
||||
/** Result of sending SAR Configuration Client messages */
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,39 +0,0 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
echo "Copy Bluetooth Mesh v1.1 lib:"
|
||||
|
||||
chip=$1
|
||||
|
||||
if [[ $chip != "esp32" &&
|
||||
$chip != "esp32s3" &&
|
||||
$chip != "esp32c3" &&
|
||||
$chip != "esp32c6" &&
|
||||
$chip != "esp32h2" &&
|
||||
$chip != "all" ]]; then
|
||||
echo "Invalid Chip Target: $chip"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ $chip == "esp32" ||
|
||||
$chip == "esp32s3" ||
|
||||
$chip == "esp32c3" ||
|
||||
$chip == "esp32c6" ||
|
||||
$chip == "esp32h2" ]]; then
|
||||
cp ./build/$chip/libmesh_v1.1.a ./$chip/
|
||||
echo "Copy for $chip done!"
|
||||
elif [[ $chip == "all" ]]; then
|
||||
cp ./build/esp32/libmesh_v1.1.a ./esp32/
|
||||
echo "Copy for esp32 done!"
|
||||
|
||||
cp ./build/esp32s3/libmesh_v1.1.a ./esp32s3/
|
||||
echo "Copy for esp32s3 done!"
|
||||
|
||||
cp ./build/esp32c3/libmesh_v1.1.a ./esp32c3/
|
||||
echo "Copy for esp32c3 done!"
|
||||
|
||||
cp ./build/esp32c6/libmesh_v1.1.a ./esp32c6/
|
||||
echo "Copy for esp32c6 done!"
|
||||
|
||||
cp ./build/esp32h2/libmesh_v1.1.a ./esp32h2/
|
||||
echo "Copy for esp32h2 done!"
|
||||
fi
|
@ -49,7 +49,7 @@ config BT_BLUEDROID_ESP_COEX_VSC
|
||||
|
||||
config BT_CLASSIC_ENABLED
|
||||
bool "Classic Bluetooth"
|
||||
depends on BT_BLUEDROID_ENABLED && IDF_TARGET_ESP32
|
||||
depends on BT_BLUEDROID_ENABLED && ((BT_CONTROLLER_ENABLED && SOC_BT_CLASSIC_SUPPORTED) || BT_CONTROLLER_DISABLED)
|
||||
default n
|
||||
help
|
||||
For now this option needs "SMP_ENABLE" to be set to yes
|
||||
@ -83,21 +83,23 @@ config BT_L2CAP_ENABLED
|
||||
This enables the Logical Link Control and Adaptation Layer Protocol.
|
||||
Only supported classic bluetooth.
|
||||
|
||||
config BT_HFP_ENABLE
|
||||
menuconfig BT_HFP_ENABLE
|
||||
bool "Hands Free/Handset Profile"
|
||||
depends on BT_CLASSIC_ENABLED
|
||||
default n
|
||||
help
|
||||
Hands Free Unit and Audio Gateway can be included simultaneously
|
||||
but they cannot run simultaneously due to internal limitations.
|
||||
|
||||
choice BT_HFP_ROLE
|
||||
prompt "Hands-free Profile Role configuration"
|
||||
config BT_HFP_CLIENT_ENABLE
|
||||
bool "Hands Free Unit"
|
||||
depends on BT_HFP_ENABLE
|
||||
default y
|
||||
|
||||
config BT_HFP_CLIENT_ENABLE
|
||||
bool "Hands Free Unit"
|
||||
|
||||
config BT_HFP_AG_ENABLE
|
||||
bool "Audio Gateway"
|
||||
endchoice
|
||||
config BT_HFP_AG_ENABLE
|
||||
bool "Audio Gateway"
|
||||
depends on BT_HFP_ENABLE
|
||||
default y
|
||||
|
||||
choice BT_HFP_AUDIO_DATA_PATH
|
||||
prompt "audio(SCO) data path"
|
||||
@ -121,26 +123,26 @@ config BT_HFP_WBS_ENABLE
|
||||
This enables Wide Band Speech. Should disable it when SCO data path is PCM.
|
||||
Otherwise there will be no data transmited via GPIOs.
|
||||
|
||||
config BT_HID_ENABLED
|
||||
|
||||
menuconfig BT_HID_ENABLED
|
||||
bool "Classic BT HID"
|
||||
depends on BT_CLASSIC_ENABLED
|
||||
default n
|
||||
help
|
||||
This enables the BT HID Host
|
||||
|
||||
choice BT_HID_ROLE
|
||||
prompt "Profile Role configuration"
|
||||
config BT_HID_HOST_ENABLED
|
||||
bool "Classic BT HID Host"
|
||||
depends on BT_HID_ENABLED
|
||||
config BT_HID_HOST_ENABLED
|
||||
bool "Classic BT HID Host"
|
||||
help
|
||||
This enables the BT HID Host
|
||||
default n
|
||||
help
|
||||
This enables the BT HID Host
|
||||
|
||||
config BT_HID_DEVICE_ENABLED
|
||||
bool "Classic BT HID Device"
|
||||
help
|
||||
This enables the BT HID Device
|
||||
endchoice
|
||||
config BT_HID_DEVICE_ENABLED
|
||||
bool "Classic BT HID Device"
|
||||
depends on BT_HID_ENABLED
|
||||
help
|
||||
This enables the BT HID Device
|
||||
|
||||
config BT_BLE_ENABLED
|
||||
bool "Bluetooth Low Energy"
|
||||
@ -250,6 +252,14 @@ config BT_GATTC_MAX_CACHE_CHAR
|
||||
help
|
||||
Maximum GATTC cache characteristic count
|
||||
|
||||
config BT_GATTC_NOTIF_REG_MAX
|
||||
int "Max gattc notify(indication) register number"
|
||||
depends on BT_GATTC_ENABLE
|
||||
range 1 64
|
||||
default 5
|
||||
help
|
||||
Maximum GATTC notify(indication) register number
|
||||
|
||||
config BT_GATTC_CACHE_NVS_FLASH
|
||||
bool "Save gattc cache data to nvs flash"
|
||||
depends on BT_GATTC_ENABLE
|
||||
@ -1041,7 +1051,7 @@ config BT_ACL_CONNECTIONS
|
||||
|
||||
config BT_MULTI_CONNECTION_ENBALE
|
||||
bool "Enable BLE multi-conections"
|
||||
depends on BT_BLUEDROID_ENABLED
|
||||
depends on BT_BLE_ENABLED
|
||||
default y
|
||||
help
|
||||
Enable this option if there are multiple connections
|
||||
@ -1062,7 +1072,7 @@ config BT_BLE_DYNAMIC_ENV_MEMORY
|
||||
|
||||
config BT_BLE_HOST_QUEUE_CONG_CHECK
|
||||
bool "BLE queue congestion check"
|
||||
depends on BT_BLUEDROID_ENABLED
|
||||
depends on BT_BLE_ENABLED
|
||||
default n
|
||||
help
|
||||
When scanning and scan duplicate is not enabled, if there are a lot of adv packets around
|
||||
@ -1087,7 +1097,7 @@ config BT_BLE_ACT_SCAN_REP_ADV_SCAN
|
||||
|
||||
config BT_BLE_ESTAB_LINK_CONN_TOUT
|
||||
int "Timeout of BLE connection establishment"
|
||||
depends on BT_BLUEDROID_ENABLED
|
||||
depends on BT_BLE_ENABLED
|
||||
range 1 60
|
||||
default 30
|
||||
help
|
||||
@ -1106,8 +1116,9 @@ config BT_MAX_DEVICE_NAME_LEN
|
||||
|
||||
config BT_BLE_RPA_SUPPORTED
|
||||
bool "Update RPA to Controller"
|
||||
depends on BT_BLUEDROID_ENABLED && !SOC_BLE_DEVICE_PRIVACY_SUPPORTED
|
||||
default n
|
||||
depends on (BT_BLUEDROID_ENABLED && ((BT_CONTROLLER_ENABLED && !SOC_BLE_DEVICE_PRIVACY_SUPPORTED) || BT_CONTROLLER_DISABLED))
|
||||
default n if (BT_CONTROLLER_ENABLED && !SOC_BLE_DEVICE_PRIVACY_SUPPORTED)
|
||||
default y if BT_CONTROLLER_DISABLED
|
||||
help
|
||||
This enables controller RPA list function.
|
||||
For ESP32, ESP32 only support network privacy mode. If this option is enabled, ESP32 will only accept
|
||||
@ -1122,7 +1133,7 @@ config BT_BLE_RPA_SUPPORTED
|
||||
|
||||
config BT_BLE_RPA_TIMEOUT
|
||||
int "Timeout of resolvable private address"
|
||||
depends on BT_BLUEDROID_ENABLED
|
||||
depends on BT_BLE_ENABLED
|
||||
range 1 3600
|
||||
default 900
|
||||
help
|
||||
@ -1131,35 +1142,43 @@ config BT_BLE_RPA_TIMEOUT
|
||||
|
||||
config BT_BLE_50_FEATURES_SUPPORTED
|
||||
bool "Enable BLE 5.0 features"
|
||||
depends on (BT_BLUEDROID_ENABLED && (IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 || SOC_ESP_NIMBLE_CONTROLLER))
|
||||
depends on (BT_BLE_ENABLED && ((BT_CONTROLLER_ENABLED && SOC_BLE_50_SUPPORTED) || BT_CONTROLLER_DISABLED))
|
||||
default y
|
||||
help
|
||||
This enables BLE 5.0 features, this option only support esp32c3/esp32s3 chip
|
||||
Enabling this option activates BLE 5.0 features.
|
||||
This option is universally supported in chips that support BLE, except for ESP32.
|
||||
|
||||
config BT_BLE_42_FEATURES_SUPPORTED
|
||||
bool "Enable BLE 4.2 features"
|
||||
depends on (BT_BLUEDROID_ENABLED && (IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 || SOC_ESP_NIMBLE_CONTROLLER))
|
||||
depends on (BT_BLE_ENABLED && ((BT_CONTROLLER_ENABLED && SOC_BLE_SUPPORTED) || BT_CONTROLLER_DISABLED))
|
||||
default n
|
||||
help
|
||||
This enables BLE 4.2 features.
|
||||
|
||||
config BT_BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER
|
||||
bool "Enable BLE periodic advertising sync transfer feature"
|
||||
depends on (BT_BLUEDROID_ENABLED && BT_BLE_50_FEATURES_SUPPORTED && SOC_ESP_NIMBLE_CONTROLLER)
|
||||
depends on (BT_BLE_50_FEATURES_SUPPORTED && ((BT_CONTROLLER_ENABLED && SOC_ESP_NIMBLE_CONTROLLER) || BT_CONTROLLER_DISABLED))
|
||||
default n
|
||||
help
|
||||
This enables BLE periodic advertising sync transfer feature
|
||||
|
||||
config BT_BLE_FEAT_PERIODIC_ADV_ENH
|
||||
bool "Enable periodic adv enhancements(adi support)"
|
||||
depends on (BT_BLUEDROID_ENABLED && BT_BLE_50_FEATURES_SUPPORTED && SOC_ESP_NIMBLE_CONTROLLER)
|
||||
depends on (BT_BLE_50_FEATURES_SUPPORTED && ((BT_CONTROLLER_ENABLED && SOC_ESP_NIMBLE_CONTROLLER) || BT_CONTROLLER_DISABLED))
|
||||
default n
|
||||
help
|
||||
Enable the periodic advertising enhancements
|
||||
|
||||
config BT_BLE_FEAT_CREATE_SYNC_ENH
|
||||
bool "Enable create sync enhancements(reporting disable and duplicate filtering enable support)"
|
||||
depends on (BT_BLE_50_FEATURES_SUPPORTED && ((BT_CONTROLLER_ENABLED && SOC_ESP_NIMBLE_CONTROLLER) || BT_CONTROLLER_DISABLED))
|
||||
default n
|
||||
help
|
||||
Enable the create sync enhancements
|
||||
|
||||
config BT_BLE_HIGH_DUTY_ADV_INTERVAL
|
||||
bool "Enable BLE high duty advertising interval feature"
|
||||
depends on BT_BLUEDROID_ENABLED
|
||||
depends on BT_BLE_ENABLED
|
||||
default n
|
||||
help
|
||||
This enable BLE high duty advertising interval feature
|
||||
|
89
components/bt/host/bluedroid/api/esp_bluedroid_hci.c
Normal file
89
components/bt/host/bluedroid/api/esp_bluedroid_hci.c
Normal file
@ -0,0 +1,89 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "esp_log.h"
|
||||
#include "esp_bluedroid_hci.h"
|
||||
#include "common/bt_target.h"
|
||||
#include "hci/hci_trans_int.h"
|
||||
#if (BT_CONTROLLER_INCLUDED == TRUE)
|
||||
#include "esp_bt.h"
|
||||
#endif
|
||||
|
||||
#define LOG_TAG "HCI_API"
|
||||
|
||||
static esp_bluedroid_hci_driver_operations_t s_hci_driver_ops = { 0 };
|
||||
|
||||
esp_err_t esp_bluedroid_attach_hci_driver(const esp_bluedroid_hci_driver_operations_t *p_ops)
|
||||
{
|
||||
if (!p_ops) {
|
||||
ESP_LOGE(LOG_TAG, "%s invalid function parameter", __func__);
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
s_hci_driver_ops.send = p_ops->send;
|
||||
s_hci_driver_ops.check_send_available = p_ops->check_send_available;
|
||||
s_hci_driver_ops.register_host_callback = p_ops->register_host_callback;
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t esp_bluedroid_detach_hci_driver(void)
|
||||
{
|
||||
s_hci_driver_ops.send = NULL;
|
||||
s_hci_driver_ops.check_send_available = NULL;
|
||||
s_hci_driver_ops.register_host_callback = NULL;
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
* INTERNAL USE *
|
||||
****************************************************************/
|
||||
|
||||
bool hci_host_check_send_available(void)
|
||||
{
|
||||
bool can_send = false;
|
||||
#if (BT_CONTROLLER_INCLUDED == TRUE)
|
||||
can_send = esp_vhci_host_check_send_available();
|
||||
#else /* BT_CONTROLLER_INCLUDED == TRUE */
|
||||
if (s_hci_driver_ops.check_send_available) {
|
||||
can_send = s_hci_driver_ops.check_send_available();
|
||||
}
|
||||
#endif /* BT_CONTROLLER_INCLUDED == TRUE */
|
||||
return can_send;
|
||||
}
|
||||
|
||||
void hci_host_send_packet(uint8_t *data, uint16_t len)
|
||||
{
|
||||
#if (BT_CONTROLLER_INCLUDED == TRUE)
|
||||
esp_vhci_host_send_packet(data, len);
|
||||
#else /* BT_CONTROLLER_INCLUDED == TRUE */
|
||||
if (s_hci_driver_ops.send) {
|
||||
s_hci_driver_ops.send(data, len);
|
||||
}
|
||||
#endif /* BT_CONTROLLER_INCLUDED == TRUE */
|
||||
}
|
||||
|
||||
esp_err_t hci_host_register_callback(const esp_bluedroid_hci_driver_callbacks_t *callback)
|
||||
{
|
||||
esp_err_t ret = ESP_FAIL;
|
||||
|
||||
if (!callback) {
|
||||
ESP_LOGE(LOG_TAG, "%s invalid function parameter", __func__);
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
#if (BT_CONTROLLER_INCLUDED == TRUE)
|
||||
ret = esp_vhci_host_register_callback((esp_vhci_host_callback_t *)callback);
|
||||
#else /* BT_CONTROLLER_INCLUDED == TRUE */
|
||||
if (s_hci_driver_ops.register_host_callback) {
|
||||
ret = s_hci_driver_ops.register_host_callback(callback);
|
||||
}
|
||||
#endif /* BT_CONTROLLER_INCLUDED == TRUE */
|
||||
|
||||
return ret;
|
||||
}
|
@ -5,10 +5,13 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "common/bt_target.h"
|
||||
#include "esp_bt_main.h"
|
||||
#include "btc/btc_task.h"
|
||||
#include "btc/btc_main.h"
|
||||
#if (BT_CONTROLLER_INCLUDED == TRUE)
|
||||
#include "esp_bt.h"
|
||||
#endif
|
||||
#include "osi/future.h"
|
||||
#include "osi/allocator.h"
|
||||
#include "config/stack_config.h"
|
||||
@ -123,10 +126,12 @@ esp_err_t esp_bluedroid_init_with_cfg(esp_bluedroid_config_t *cfg)
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
#if (BT_CONTROLLER_INCLUDED == TRUE)
|
||||
if (esp_bt_controller_get_status() != ESP_BT_CONTROLLER_STATUS_ENABLED) {
|
||||
LOG_ERROR("Controller not initialised\n");
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (bd_already_init) {
|
||||
LOG_ERROR("Bluedroid already initialised\n");
|
||||
|
@ -122,6 +122,19 @@ 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_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
esp_err_t esp_ble_gap_update_conn_params(esp_ble_conn_update_params_t *params)
|
||||
@ -576,7 +589,11 @@ esp_err_t esp_ble_gap_set_security_param(esp_ble_sm_param_t param_type,
|
||||
LOG_ERROR("ESP_BLE_APP_ENC_KEY_SIZE is deprecated, use ESP_GATT_PERM_ENCRYPT_KEY_SIZE in characteristic definition");
|
||||
return ESP_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
if (param_type == ESP_BLE_SM_MAX_KEY_SIZE || param_type == ESP_BLE_SM_MIN_KEY_SIZE) {
|
||||
if (((uint8_t *)value)[0] > 16 || ((uint8_t *)value)[0] < 7) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
}
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_gap_args_t arg;
|
||||
|
||||
|
@ -475,4 +475,23 @@ esp_err_t esp_bt_gap_get_page_timeout(void)
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_gap_set_acl_pkt_types(esp_bd_addr_t remote_bda, uint16_t pkt_types)
|
||||
{
|
||||
btc_msg_t msg;
|
||||
btc_gap_bt_args_t arg;
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BT;
|
||||
msg.act = BTC_GAP_BT_ACT_SET_ACL_PKT_TYPES;
|
||||
|
||||
memcpy(&arg.set_acl_pkt_types.bda, remote_bda, sizeof(bt_bdaddr_t));
|
||||
arg.set_acl_pkt_types.pkt_types = pkt_types;
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
#endif /* #if BTC_GAP_BT_INCLUDED == TRUE */
|
||||
|
@ -21,7 +21,9 @@
|
||||
#include "common/bt_target.h"
|
||||
#include "common/bt_defs.h"
|
||||
#include "device/bdaddr.h"
|
||||
#if (BT_CONTROLLER_INCLUDED == TRUE)
|
||||
#include "esp_bt.h"
|
||||
#endif
|
||||
#include "esp_hf_ag_api.h"
|
||||
#include "esp_err.h"
|
||||
#include "esp_bt_main.h"
|
||||
@ -171,6 +173,9 @@ esp_err_t esp_hf_ag_volume_control(esp_bd_addr_t remote_addr, esp_hf_volume_cont
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
if (volume < 0 || volume > 15) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
btc_msg_t msg;
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_HF;
|
||||
@ -237,6 +242,9 @@ esp_err_t esp_hf_ag_devices_status_indchange(esp_bd_addr_t remote_addr,
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
if (signal < 0 || signal > 5) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
btc_msg_t msg;
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_HF;
|
||||
@ -285,6 +293,10 @@ esp_err_t esp_hf_ag_cind_response(esp_bd_addr_t remote_addr,
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
if (signal < 0 || signal > 5 || batt_lev < 0 || batt_lev > 5) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
btc_msg_t msg;
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_HF;
|
||||
@ -363,7 +375,7 @@ esp_err_t esp_hf_ag_cnum_response(esp_bd_addr_t remote_addr, char *number, int n
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
if (number == NULL) {
|
||||
if (number == NULL || number_type < 128 || number_type > 175) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
btc_msg_t msg;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -242,7 +242,7 @@ typedef int32_t (* esp_a2d_source_data_cb_t)(uint8_t *buf, int32_t len);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: if callback is a NULL function pointer
|
||||
*
|
||||
*/
|
||||
@ -259,7 +259,7 @@ esp_err_t esp_a2d_register_callback(esp_a2d_cb_t callback);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: if callback is a NULL function pointer
|
||||
*
|
||||
*/
|
||||
@ -276,7 +276,7 @@ esp_err_t esp_a2d_sink_register_data_callback(esp_a2d_sink_data_cb_t callback);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: if the initialization request is sent successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -291,7 +291,7 @@ esp_err_t esp_a2d_sink_init(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: if the deinitialization request is sent successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -307,7 +307,7 @@ esp_err_t esp_a2d_sink_deinit(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: connect request is sent to lower layer successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -323,7 +323,7 @@ esp_err_t esp_a2d_sink_connect(esp_bd_addr_t remote_bda);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -340,7 +340,7 @@ esp_err_t esp_a2d_sink_disconnect(esp_bd_addr_t remote_bda);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: delay value is sent to lower layer successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -353,7 +353,7 @@ esp_err_t esp_a2d_sink_set_delay_value(uint16_t delay_value);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: if the request is sent successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -369,7 +369,7 @@ esp_err_t esp_a2d_sink_get_delay_value(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: control command is sent to lower layer successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -386,7 +386,7 @@ esp_err_t esp_a2d_media_ctrl(esp_a2d_media_ctrl_t ctrl);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: if the initialization request is sent to lower layer successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -401,7 +401,7 @@ esp_err_t esp_a2d_source_init(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -418,7 +418,7 @@ esp_err_t esp_a2d_source_deinit(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: if callback is a NULL function pointer
|
||||
*
|
||||
*/
|
||||
@ -434,7 +434,7 @@ esp_err_t esp_a2d_source_register_data_callback(esp_a2d_source_data_cb_t callbac
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: connect request is sent to lower layer successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -449,7 +449,7 @@ esp_err_t esp_a2d_source_connect(esp_bd_addr_t remote_bda);
|
||||
* @param[in] remote_bda: remote bluetooth device address
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
|
@ -0,0 +1,84 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef __ESP_BLUEDROID_HCI_H__
|
||||
#define __ESP_BLUEDROID_HCI_H__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "esp_err.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* HCI driver callbacks */
|
||||
typedef struct esp_bluedroid_hci_driver_callbacks {
|
||||
/**
|
||||
* @brief callback used to notify that the host can send packet to controller
|
||||
*/
|
||||
void (*notify_host_send_available)(void);
|
||||
|
||||
/**
|
||||
* @brief callback used to notify that the controller has a packet to send to the host
|
||||
*
|
||||
* @param[in] data pointer to data buffer
|
||||
* @param[in] len length of data
|
||||
*
|
||||
* @return 0 received successfully, failed otherwise
|
||||
*/
|
||||
int (*notify_host_recv)(uint8_t *data, uint16_t len);
|
||||
} esp_bluedroid_hci_driver_callbacks_t;
|
||||
|
||||
/* HCI driver operations */
|
||||
typedef struct esp_bluedroid_hci_driver_operations {
|
||||
/**
|
||||
* @brief send data from host to controller
|
||||
*
|
||||
* @param[in] data pointer to data buffer
|
||||
* @param[in] len length of data
|
||||
*/
|
||||
void (*send)(uint8_t *data, uint16_t len);
|
||||
|
||||
/**
|
||||
* @brief host checks whether it can send data to controller
|
||||
*
|
||||
* @return true if host can send data, false otherwise
|
||||
*/
|
||||
bool (*check_send_available)(void);
|
||||
|
||||
/**
|
||||
* @brief register host callback
|
||||
*
|
||||
* @param[in] callback HCI driver callbacks
|
||||
*/
|
||||
esp_err_t (* register_host_callback)(const esp_bluedroid_hci_driver_callbacks_t *callback);
|
||||
} esp_bluedroid_hci_driver_operations_t;
|
||||
|
||||
/**
|
||||
* @brief get the operations of HCI transport layer. This API should only be used in
|
||||
* Bluedroid Host-only mode before Bluedroid initialization.
|
||||
*
|
||||
* @param[in] ops struct containing operations of HCI transport layer
|
||||
*
|
||||
* @return ESP_OK if get successfully, ESP_FAIL otherwise
|
||||
*/
|
||||
esp_err_t esp_bluedroid_attach_hci_driver(const esp_bluedroid_hci_driver_operations_t *ops);
|
||||
|
||||
/**
|
||||
* @brief remove the operations of HCI transport layer. This API should only be used in
|
||||
* Bluedroid Host-only mode before Bluedroid initialization.
|
||||
*
|
||||
* @param[in] ops struct containing operations of HCI transport layer
|
||||
*
|
||||
* @return ESP_OK if get successfully, ESP_FAIL otherwise
|
||||
*/
|
||||
esp_err_t esp_bluedroid_detach_hci_driver(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ESP_BLUEDROID_HCI_H__ */
|
@ -222,6 +222,8 @@ typedef enum {
|
||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_TRANS_RECV_EVT, /*!< when periodic advertising sync transfer received, the event comes */
|
||||
// DTM
|
||||
ESP_GAP_BLE_DTM_TEST_UPDATE_EVT, /*!< when direct test mode state changes, the event comes */
|
||||
// BLE_INCLUDED
|
||||
ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT, /*!< When clear advertising complete, the event comes */
|
||||
ESP_GAP_BLE_EVT_MAX, /*!< when maximum advertising event complete, the event comes */
|
||||
} esp_gap_ble_cb_event_t;
|
||||
|
||||
@ -902,12 +904,22 @@ typedef struct {
|
||||
* @brief periodic adv sync parameters
|
||||
*/
|
||||
typedef struct {
|
||||
esp_ble_gap_sync_t filter_policy; /*!< periodic advertising sync filter policy */
|
||||
uint8_t sid; /*!< periodic advertising sid */
|
||||
esp_ble_addr_type_t addr_type; /*!< periodic advertising address type */
|
||||
esp_bd_addr_t addr; /*!< periodic advertising address */
|
||||
uint16_t skip; /*!< the maximum number of periodic advertising events that can be skipped */
|
||||
uint16_t sync_timeout; /*!< synchronization timeout */
|
||||
esp_ble_gap_sync_t filter_policy; /*!< Configures the filter policy for periodic advertising sync:
|
||||
0: Use Advertising SID, Advertiser Address Type, and Advertiser Address parameters to determine the advertiser to listen to.
|
||||
1: Use the Periodic Advertiser List to determine the advertiser to listen to. */
|
||||
#if (CONFIG_BT_BLE_FEAT_CREATE_SYNC_ENH)
|
||||
esp_ble_gap_sync_t reports_disabled; /*!< Supported only by esp32c2, esp32c6, and esp32h2; can be set by menuconfig:
|
||||
0: Reporting initially enabled.
|
||||
1: Reporting initially disabled. */
|
||||
esp_ble_gap_sync_t filter_duplicates; /*!< Supported only by esp32c2, esp32c6, and esp32h2; can be set by menuconfig:
|
||||
0: Duplicate filtering initially disabled.
|
||||
1: Duplicate filtering initially enabled. */
|
||||
#endif
|
||||
uint8_t sid; /*!< SID of the periodic advertising */
|
||||
esp_ble_addr_type_t addr_type; /*!< Address type of the periodic advertising */
|
||||
esp_bd_addr_t addr; /*!< Address of the periodic advertising */
|
||||
uint16_t skip; /*!< Maximum number of periodic advertising events that can be skipped */
|
||||
uint16_t sync_timeout; /*!< Synchronization timeout */
|
||||
} esp_ble_gap_periodic_adv_sync_params_t;
|
||||
|
||||
/**
|
||||
@ -1086,6 +1098,12 @@ 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
|
||||
@ -2499,6 +2517,16 @@ esp_err_t esp_ble_dtm_enh_rx_start(const esp_ble_dtm_enh_rx_t *rx_params);
|
||||
*/
|
||||
esp_err_t esp_ble_dtm_stop(void);
|
||||
|
||||
/**
|
||||
* @brief This function is used to clear legacy advertising
|
||||
*
|
||||
*
|
||||
* @return - ESP_OK : success
|
||||
* - other : failed
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_gap_clear_advertising(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -91,7 +91,35 @@ typedef struct {
|
||||
|
||||
typedef uint8_t esp_bt_eir_type_t;
|
||||
|
||||
/* ACL Packet Types */
|
||||
#define ESP_BT_ACL_PKT_TYPES_MASK_DM1 0x0008
|
||||
#define ESP_BT_ACL_PKT_TYPES_MASK_DH1 0x0010
|
||||
#define ESP_BT_ACL_PKT_TYPES_MASK_DM3 0x0400
|
||||
#define ESP_BT_ACL_PKT_TYPES_MASK_DH3 0x0800
|
||||
#define ESP_BT_ACL_PKT_TYPES_MASK_DM5 0x4000
|
||||
#define ESP_BT_ACL_PKT_TYPES_MASK_DH5 0x8000
|
||||
#define ESP_BT_ACL_PKT_TYPES_MASK_NO_2_DH1 0x0002
|
||||
#define ESP_BT_ACL_PKT_TYPES_MASK_NO_3_DH1 0x0004
|
||||
#define ESP_BT_ACL_PKT_TYPES_MASK_NO_2_DH3 0x0100
|
||||
#define ESP_BT_ACL_PKT_TYPES_MASK_NO_3_DH3 0x0200
|
||||
#define ESP_BT_ACL_PKT_TYPES_MASK_NO_2_DH5 0x1000
|
||||
#define ESP_BT_ACL_PKT_TYPES_MASK_NO_3_DH5 0x2000
|
||||
|
||||
// DM1 cann not be disabled. All options are mandatory to include DM1.
|
||||
#define ESP_BT_ACL_DM1_ONLY (ESP_BT_ACL_PKT_TYPES_MASK_DM1 | 0x330e) /* 0x330e */
|
||||
#define ESP_BT_ACL_DH1_ONLY (ESP_BT_ACL_PKT_TYPES_MASK_DH1 | 0x330e) /* 0x331e */
|
||||
#define ESP_BT_ACL_DM3_ONLY (ESP_BT_ACL_PKT_TYPES_MASK_DM3 | 0x330e) /* 0x370e */
|
||||
#define ESP_BT_ACL_DH3_ONLY (ESP_BT_ACL_PKT_TYPES_MASK_DH3 | 0x330e) /* 0x3b0e */
|
||||
#define ESP_BT_ACL_DM5_ONLY (ESP_BT_ACL_PKT_TYPES_MASK_DM5 | 0x330e) /* 0x730e */
|
||||
#define ESP_BT_ACL_DH5_ONLY (ESP_BT_ACL_PKT_TYPES_MASK_DH5 | 0x330e) /* 0xb30e */
|
||||
#define ESP_BT_ACL_2_DH1_ONLY (~ESP_BT_ACL_PKT_TYPES_MASK_NO_2_DH1 & 0x330e) /* 0x330c */
|
||||
#define ESP_BT_ACL_3_DH1_ONLY (~ESP_BT_ACL_PKT_TYPES_MASK_NO_3_DH1 & 0x330e) /* 0x330a */
|
||||
#define ESP_BT_ACL_2_DH3_ONLY (~ESP_BT_ACL_PKT_TYPES_MASK_NO_2_DH3 & 0x330e) /* 0x320e */
|
||||
#define ESP_BT_ACL_3_DH3_ONLY (~ESP_BT_ACL_PKT_TYPES_MASK_NO_3_DH3 & 0x330e) /* 0x310e */
|
||||
#define ESP_BT_ACL_2_DH5_ONLY (~ESP_BT_ACL_PKT_TYPES_MASK_NO_2_DH5 & 0x330e) /* 0x230e */
|
||||
#define ESP_BT_ACL_3_DH5_ONLY (~ESP_BT_ACL_PKT_TYPES_MASK_NO_3_DH5 & 0x330e) /* 0x130e */
|
||||
|
||||
typedef uint16_t esp_bt_acl_pkt_type_t;
|
||||
|
||||
/* ESP_BT_EIR_FLAG bit definition */
|
||||
#define ESP_BT_EIR_FLAG_LIMIT_DISC (0x01 << 0)
|
||||
@ -220,6 +248,7 @@ typedef enum {
|
||||
ESP_BT_GAP_ACL_DISCONN_CMPL_STAT_EVT, /*!< ACL disconnection complete status event */
|
||||
ESP_BT_GAP_SET_PAGE_TO_EVT, /*!< Set page timeout event */
|
||||
ESP_BT_GAP_GET_PAGE_TO_EVT, /*!< Get page timeout event */
|
||||
ESP_BT_GAP_ACL_PKT_TYPE_CHANGED_EVT, /*!< Set ACL packet types event */
|
||||
ESP_BT_GAP_EVT_MAX,
|
||||
} esp_bt_gap_cb_event_t;
|
||||
|
||||
@ -394,6 +423,15 @@ typedef union {
|
||||
uint16_t page_to; /*!< page_timeout value to be set, unit is 0.625ms. */
|
||||
} get_page_timeout; /*!< get page timeout parameter struct */
|
||||
|
||||
/**
|
||||
* @brief ESP_BT_GAP_ACL_PKT_TYPE_CHANGED_EVT
|
||||
*/
|
||||
struct set_acl_pkt_types_param {
|
||||
esp_bt_status_t status; /*!< set ACL packet types status */
|
||||
esp_bd_addr_t bda; /*!< remote bluetooth device address */
|
||||
uint16_t pkt_types; /*!< packet types successfully set */
|
||||
} set_acl_pkt_types; /*!< set ACL packet types parameter struct */
|
||||
|
||||
/**
|
||||
* @brief ESP_BT_GAP_ACL_CONN_CMPL_STAT_EVT
|
||||
*/
|
||||
@ -834,6 +872,17 @@ esp_err_t esp_bt_gap_set_page_timeout(uint16_t page_to);
|
||||
*/
|
||||
esp_err_t esp_bt_gap_get_page_timeout(void);
|
||||
|
||||
/**
|
||||
* @brief Set ACL packet types
|
||||
* An ESP_BT_GAP_SET_ACL_PPKT_TYPES_EVT event will reported to
|
||||
* the APP layer.
|
||||
*
|
||||
* @return - ESP_OK: success
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - other: failed
|
||||
*/
|
||||
esp_err_t esp_bt_gap_set_acl_pkt_types(esp_bd_addr_t remote_bda, esp_bt_acl_pkt_type_t pkt_types);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -274,7 +274,7 @@ typedef void (* esp_hf_cb_t) (esp_hf_cb_event_t event, esp_hf_cb_param_t *param)
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: if callback is a NULL function pointer
|
||||
*
|
||||
*/
|
||||
@ -287,7 +287,7 @@ esp_err_t esp_hf_ag_register_callback(esp_hf_cb_t callback);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: if the initialization request is sent successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -300,7 +300,7 @@ esp_err_t esp_hf_ag_init(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -315,7 +315,7 @@ esp_err_t esp_hf_ag_deinit(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: connect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -330,7 +330,7 @@ esp_err_t esp_hf_ag_slc_connect(esp_bd_addr_t remote_bda);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -344,8 +344,8 @@ esp_err_t esp_hf_ag_slc_disconnect(esp_bd_addr_t remote_bda);
|
||||
* @param[in] remote_bda: remote bluetooth device address
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: audio connect request is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -359,8 +359,8 @@ esp_err_t esp_hf_ag_audio_connect(esp_bd_addr_t remote_bda);
|
||||
* @param[in] remote_bda: remote bluetooth device address
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: audio disconnect request is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -376,8 +376,8 @@ esp_err_t esp_hf_ag_audio_disconnect(esp_bd_addr_t remote_bda);
|
||||
* @param[in] value: 0 - voice recognition disabled, 1- voice recognition enabled
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: response of volume recognition is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -395,8 +395,9 @@ esp_err_t esp_hf_ag_vra_control(esp_bd_addr_t remote_bda, esp_hf_vr_state_t valu
|
||||
* @param[in] volume: gain of the speaker of microphone, ranges 0 to 15
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: volume synchronization control is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_ARG: if arguments are invalid
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -412,8 +413,8 @@ esp_err_t esp_hf_ag_volume_control(esp_bd_addr_t remote_bda, esp_hf_volume_contr
|
||||
* @param[in] unat: User AT command response to HF Client.
|
||||
* It will response "ERROR" by default if unat is NULL.
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: response of unknown AT command is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -428,8 +429,8 @@ esp_err_t esp_hf_ag_unknown_at_send(esp_bd_addr_t remote_addr, char *unat);
|
||||
* @param[in] response_code: AT command response code
|
||||
* @param[in] error_code: CME error code
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: extend error code is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -446,8 +447,9 @@ esp_err_t esp_hf_ag_cmee_send(esp_bd_addr_t remote_bda, esp_hf_at_response_code_
|
||||
* @param[in] ntk_state: network service state
|
||||
* @param[in] signal: signal strength from 0 to 5
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: device status notification is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_ARG: if arguments are invalid
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -467,8 +469,8 @@ esp_err_t esp_hf_ag_devices_status_indchange(esp_bd_addr_t remote_addr, esp_hf_c
|
||||
* @param[in] ind_type: indicator type
|
||||
* @param[in] value: indicator value
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: indicator report is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -488,8 +490,9 @@ esp_err_t esp_hf_ag_ciev_report(esp_bd_addr_t remote_addr, esp_hf_ciev_report_ty
|
||||
* @param[in] batt_lev: battery level from 0 to 5
|
||||
* @param[in] call_held_status: call held status
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: response to device individual indicators is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_ARG: if the arguments are invalid
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -507,8 +510,8 @@ esp_err_t esp_hf_ag_cind_response(esp_bd_addr_t remote_addr,
|
||||
* @param[in] remote_addr: remote bluetooth device address
|
||||
* @param[in] name: current operator name
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: reponse for AT+COPS command is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -528,8 +531,8 @@ esp_err_t esp_hf_ag_cops_response(esp_bd_addr_t remote_addr, char *name);
|
||||
* @param[in] number: current call number
|
||||
* @param[in] type: international type or unknow
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: response to AT+CLCC command is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -550,8 +553,8 @@ esp_err_t esp_hf_ag_clcc_response(esp_bd_addr_t remote_addr, int index, esp_hf_c
|
||||
* 160-175: national, but no prefix nor escape digits
|
||||
* @param[in] service_type: service type (unknown/voice/fax)
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: response for AT+CNUM command is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -565,8 +568,9 @@ esp_err_t esp_hf_ag_cnum_response(esp_bd_addr_t remote_addr, char *number, int n
|
||||
* @param[in] remote_addr: remote bluetooth device address
|
||||
* @param[in] state: in-band ring tone state
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: information of in-band ring tone is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_ARG: if arguments are invalid
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -585,8 +589,8 @@ esp_err_t esp_hf_ag_bsir(esp_bd_addr_t remote_addr, esp_hf_in_band_ring_state_t
|
||||
* @param[in] number: number of the incoming call
|
||||
* @param[in] call_addr_type: call address type
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: answer incoming call is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -607,8 +611,8 @@ esp_err_t esp_hf_ag_answer_call(esp_bd_addr_t remote_addr, int num_active, int n
|
||||
* @param[in] number: number of the incoming call
|
||||
* @param[in] call_addr_type: call address type
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: reject incoming call is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -632,8 +636,8 @@ esp_err_t esp_hf_ag_reject_call(esp_bd_addr_t remote_addr, int num_active, int n
|
||||
* @param[in] number: number of the outgoing call
|
||||
* @param[in] call_addr_type: call address type
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: a call initiation is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -654,8 +658,8 @@ esp_err_t esp_hf_ag_out_call(esp_bd_addr_t remote_addr, int num_active, int num_
|
||||
* @param[in] number: number of the call
|
||||
* @param[in] call_addr_type: call address type
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: end an ongoing call is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -672,7 +676,7 @@ esp_err_t esp_hf_ag_end_call(esp_bd_addr_t remote_addr, int num_active, int num_
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: if callback is a NULL function pointer
|
||||
*
|
||||
*/
|
||||
@ -689,7 +693,7 @@ esp_err_t esp_hf_ag_register_data_callback(esp_hf_incoming_data_cb_t recv, esp_h
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: if the request is sent successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
|
@ -313,7 +313,7 @@ typedef void (* esp_hf_client_cb_t)(esp_hf_client_cb_event_t event, esp_hf_clien
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: if callback is a NULL function pointer
|
||||
*
|
||||
*/
|
||||
@ -326,7 +326,7 @@ esp_err_t esp_hf_client_register_callback(esp_hf_client_cb_t callback);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: if the initialization request is sent successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -339,7 +339,7 @@ esp_err_t esp_hf_client_init(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -354,7 +354,7 @@ esp_err_t esp_hf_client_deinit(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: connect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -369,7 +369,7 @@ esp_err_t esp_hf_client_connect(esp_bd_addr_t remote_bda);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -382,8 +382,8 @@ esp_err_t esp_hf_client_disconnect(esp_bd_addr_t remote_bda);
|
||||
*
|
||||
* @param[in] remote_bda: remote bluetooth device address
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: connect audio request is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -396,8 +396,8 @@ esp_err_t esp_hf_client_connect_audio(esp_bd_addr_t remote_bda);
|
||||
*
|
||||
* @param[in] remote_bda: remote bluetooth device address
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: disconnect audio request is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -409,8 +409,8 @@ esp_err_t esp_hf_client_disconnect_audio(esp_bd_addr_t remote_bda);
|
||||
* As a precondition to use this API, Service Level Connection shall exist with AG.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: starting voice recognition is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -422,8 +422,8 @@ esp_err_t esp_hf_client_start_voice_recognition(void);
|
||||
* As a precondition to use this API, Service Level Connection shall exist with AG.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: stoping voice recognition is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -438,8 +438,8 @@ esp_err_t esp_hf_client_stop_voice_recognition(void);
|
||||
* @param[in] volume: gain of the speaker of microphone, ranges 0 to 15
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: volume update is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -453,8 +453,8 @@ esp_err_t esp_hf_client_volume_update(esp_hf_volume_control_target_t type, int v
|
||||
* @param[in] number: number string of the call. If NULL, the last number is called(aka re-dial)
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: a call placing is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -468,8 +468,8 @@ esp_err_t esp_hf_client_dial(const char *number);
|
||||
* @param[in] location: location of the number in the memory
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: a memory call placing is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -486,8 +486,8 @@ esp_err_t esp_hf_client_dial_memory(int location);
|
||||
* ESP_HF_CHLD_TYPE_REL_X or ESP_HF_CHLD_TYPE_PRIV_X
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: command AT+CHLD is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -501,8 +501,8 @@ esp_err_t esp_hf_client_send_chld_cmd(esp_hf_chld_type_t chld, int idx);
|
||||
* @param[in] btrh: response and hold action to send
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: command AT+BTRH is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -514,8 +514,8 @@ esp_err_t esp_hf_client_send_btrh_cmd(esp_hf_btrh_cmd_t btrh);
|
||||
* As a precondition to use this API, Service Level Connection shall exist with AG.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: a call answering is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -527,8 +527,8 @@ esp_err_t esp_hf_client_answer_call(void);
|
||||
* As a precondition to use this API, Service Level Connection shall exist with AG.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: the call rejecting is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -540,8 +540,8 @@ esp_err_t esp_hf_client_reject_call(void);
|
||||
* As a precondition to use this API, Service Level Connection shall exist with AG.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: query of current calls is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -553,8 +553,8 @@ esp_err_t esp_hf_client_query_current_calls(void);
|
||||
* As a precondition to use this API, Service Level Connection shall exist with AG.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: query of current operator name is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -566,8 +566,8 @@ esp_err_t esp_hf_client_query_current_operator_name(void);
|
||||
* As a precondition to use this API, Service Level Connection shall exist with AG
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: the retrieving of subscriber information is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -581,8 +581,8 @@ esp_err_t esp_hf_client_retrieve_subscriber_info(void);
|
||||
* @param[in] code: dtmf code, single ascii character in the set 0-9, #, *, A-D
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: the DTMF codes are sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -602,7 +602,7 @@ esp_err_t esp_hf_client_send_dtmf(char code);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: Feature enable request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -620,7 +620,7 @@ esp_err_t esp_hf_client_send_xapl(char *information, uint32_t features);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: battery level is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -632,8 +632,8 @@ esp_err_t esp_hf_client_send_iphoneaccev(uint32_t bat_level, bool docked);
|
||||
* As a precondition to use this API, Service Level Connection shall exist with AG.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: the phone number request corresponding to last voice tag recorded is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -646,7 +646,7 @@ esp_err_t esp_hf_client_request_last_voice_tag_number(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: NREC=0 request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@ -663,7 +663,7 @@ esp_err_t esp_hf_client_send_nrec(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: if callback is a NULL function pointer
|
||||
*
|
||||
*/
|
||||
@ -680,7 +680,7 @@ esp_err_t esp_hf_client_register_data_callback(esp_hf_client_incoming_data_cb_t
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: if the request is sent successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
|
@ -46,6 +46,9 @@
|
||||
#if (GAP_INCLUDED == TRUE)
|
||||
#include "stack/gap_api.h"
|
||||
#endif
|
||||
#if (BT_CONTROLLER_INCLUDED == TRUE)
|
||||
#include "esp_bt.h"
|
||||
#endif
|
||||
|
||||
static void bta_dm_inq_results_cb (tBTM_INQ_RESULTS *p_inq, UINT8 *p_eir);
|
||||
static void bta_dm_inq_cmpl_cb (void *p_result);
|
||||
@ -136,7 +139,6 @@ static void bta_dm_observe_discard_cb (uint32_t num_dis);
|
||||
static void bta_dm_delay_role_switch_cback(TIMER_LIST_ENT *p_tle);
|
||||
extern void sdpu_uuid16_to_uuid128(UINT16 uuid16, UINT8 *p_uuid128);
|
||||
static void bta_dm_disable_timer_cback(TIMER_LIST_ENT *p_tle);
|
||||
extern int bredr_txpwr_get(int *min_power_level, int *max_power_level);
|
||||
|
||||
const UINT16 bta_service_id_to_uuid_lkup_tbl [BTA_MAX_SERVICE_ID] = {
|
||||
UUID_SERVCLASS_PNP_INFORMATION, /* Reserved */
|
||||
@ -872,6 +874,28 @@ void bta_dm_get_page_timeout (tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_ReadPageTimeout(p_data->get_page_timeout.get_page_to_cb);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_set_acl_pkt_types
|
||||
**
|
||||
** Description Sets ACL packet types
|
||||
**
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_dm_set_acl_pkt_types (tBTA_DM_MSG *p_data)
|
||||
{
|
||||
if (p_data->set_acl_pkt_types.set_acl_pkt_types_cb != NULL) {
|
||||
BTM_SetAclPktTypes(p_data->set_acl_pkt_types.rmt_addr,
|
||||
p_data->set_acl_pkt_types.pkt_types,
|
||||
p_data->set_acl_pkt_types.set_acl_pkt_types_cb);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s(), the callback function can't be NULL.", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
/*******************************************************************************
|
||||
**
|
||||
@ -4313,7 +4337,14 @@ static void bta_dm_set_eir (char *local_name)
|
||||
if (p_bta_dm_eir_cfg->bta_dm_eir_included_tx_power) {
|
||||
if (free_eir_length >= 3) {
|
||||
int min_power_level, max_power_level;
|
||||
if (bredr_txpwr_get(&min_power_level, &max_power_level) == 0) {
|
||||
#if (BT_CONTROLLER_INCLUDED == TRUE)
|
||||
if (esp_bredr_tx_power_get((esp_power_level_t *)&min_power_level, (esp_power_level_t *)&max_power_level) == ESP_OK) {
|
||||
#else
|
||||
{
|
||||
min_power_level = 0;
|
||||
max_power_level = 0;
|
||||
UNUSED(min_power_level);
|
||||
#endif
|
||||
INT8 btm_tx_power[BTM_TX_POWER_LEVEL_MAX + 1] = BTM_TX_POWER;
|
||||
p_bta_dm_eir_cfg->bta_dm_eir_inq_tx_power = btm_tx_power[max_power_level];
|
||||
UINT8_TO_STREAM(p, 2); /* Length field */
|
||||
@ -5719,6 +5750,15 @@ void bta_dm_ble_gap_dtm_stop(tBTA_DM_MSG *p_data)
|
||||
BTM_BleTestEnd(p_data->dtm_stop.p_dtm_cmpl_cback);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
void bta_dm_ble_gap_dtm_enhance_tx_start(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
|
@ -341,6 +341,30 @@ void BTA_DmGetPageTimeout(tBTM_CMPL_CB *p_cb)
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmSetAclPktTypes
|
||||
**
|
||||
** Description This function sets the packet types used for ACL traffic.
|
||||
**
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_DmSetAclPktTypes(BD_ADDR remote_addr, UINT16 pkt_types, tBTM_CMPL_CB *p_cb)
|
||||
{
|
||||
tBTA_DM_API_SET_ACL_PKT_TYPES *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_SET_ACL_PKT_TYPES *) osi_malloc(sizeof(tBTA_DM_API_SET_ACL_PKT_TYPES))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_SET_ACL_PKT_TYPES_EVT;
|
||||
bdcpy(p_msg->rmt_addr, remote_addr);
|
||||
p_msg->pkt_types = pkt_types;
|
||||
p_msg->set_acl_pkt_types_cb = p_cb;
|
||||
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
#endif /// CLASSIC_BT_INCLUDED == TRUE
|
||||
|
||||
#if (SDP_INCLUDED == TRUE)
|
||||
@ -1813,6 +1837,29 @@ extern void BTA_DmBleBroadcast (BOOLEAN start, tBTA_START_STOP_ADV_CMPL_CBACK *p
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** 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
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
@ -356,7 +356,7 @@ void bta_dm_co_ble_io_req(BD_ADDR bd_addr, tBTA_IO_CAP *p_io_cap,
|
||||
*p_resp_key = bte_appl_cfg.ble_resp_key;
|
||||
}
|
||||
|
||||
if (bte_appl_cfg.ble_max_key_size > 7 && bte_appl_cfg.ble_max_key_size <= 16) {
|
||||
if (bte_appl_cfg.ble_max_key_size >= 7 && bte_appl_cfg.ble_max_key_size <= 16) {
|
||||
*p_max_key_size = bte_appl_cfg.ble_max_key_size;
|
||||
}
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
|
@ -69,6 +69,7 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
bta_dm_config_eir, /* BTA_DM_API_CONFIG_EIR_EVT */
|
||||
bta_dm_set_page_timeout, /* BTA_DM_API_PAGE_TO_SET_EVT */
|
||||
bta_dm_get_page_timeout, /* BTA_DM_API_PAGE_TO_GET_EVT */
|
||||
bta_dm_set_acl_pkt_types, /* BTA_DM_API_SET_ACL_PKT_TYPES_EVT */
|
||||
#endif
|
||||
bta_dm_set_afh_channels, /* BTA_DM_API_SET_AFH_CHANNELS_EVT */
|
||||
#if (SDP_INCLUDED == TRUE)
|
||||
@ -224,6 +225,7 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
bta_dm_ble_gap_dtm_tx_start, /* BTA_DM_API_DTM_TX_START_EVT */
|
||||
bta_dm_ble_gap_dtm_rx_start, /* BTA_DM_API_DTM_RX_START_EVT */
|
||||
bta_dm_ble_gap_dtm_stop, /* BTA_DM_API_DTM_STOP_EVT */
|
||||
bta_dm_ble_gap_clear_adv, /* BTA_DM_API_BLE_CLEAR_ADV_EVT */
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -61,6 +61,7 @@ enum {
|
||||
BTA_DM_API_CONFIG_EIR_EVT,
|
||||
BTA_DM_API_PAGE_TO_SET_EVT,
|
||||
BTA_DM_API_PAGE_TO_GET_EVT,
|
||||
BTA_DM_API_SET_ACL_PKT_TYPES_EVT,
|
||||
#endif
|
||||
BTA_DM_API_SET_AFH_CHANNELS_EVT,
|
||||
#if (SDP_INCLUDED == TRUE)
|
||||
@ -217,6 +218,7 @@ enum {
|
||||
BTA_DM_API_DTM_TX_START_EVT,
|
||||
BTA_DM_API_DTM_RX_START_EVT,
|
||||
BTA_DM_API_DTM_STOP_EVT,
|
||||
BTA_DM_API_BLE_CLEAR_ADV_EVT,
|
||||
#endif
|
||||
BTA_DM_MAX_EVT
|
||||
};
|
||||
@ -298,6 +300,14 @@ typedef struct {
|
||||
tBTM_CMPL_CB *get_page_to_cb;
|
||||
} tBTA_DM_API_PAGE_TO_GET;
|
||||
|
||||
/* data type for BTA_DM_API_SET_ACL_PKT_TYPES_EVT */
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
BD_ADDR rmt_addr;
|
||||
UINT16 pkt_types;
|
||||
tBTM_CMPL_CB *set_acl_pkt_types_cb;
|
||||
} tBTA_DM_API_SET_ACL_PKT_TYPES;
|
||||
|
||||
/* data type for BTA_DM_API_GET_REMOTE_NAME_EVT */
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
@ -896,6 +906,11 @@ typedef struct {
|
||||
tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback;
|
||||
} tBTA_DM_API_BLE_DTM_STOP;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
tBTA_CLEAR_ADV_CMPL_CBACK *p_clear_adv_cback;
|
||||
} tBTA_DM_API_CLEAR_ADV;
|
||||
|
||||
#endif /* BLE_INCLUDED */
|
||||
|
||||
/* data type for BTA_DM_API_REMOVE_ACL_EVT */
|
||||
@ -1152,6 +1167,7 @@ typedef union {
|
||||
tBTA_DM_API_SET_AFH_CHANNELS set_afh_channels;
|
||||
tBTA_DM_API_PAGE_TO_SET set_page_timeout;
|
||||
tBTA_DM_API_PAGE_TO_GET get_page_timeout;
|
||||
tBTA_DM_API_SET_ACL_PKT_TYPES set_acl_pkt_types;
|
||||
#if (SDP_INCLUDED == TRUE)
|
||||
tBTA_DM_API_GET_REMOTE_NAME get_rmt_name;
|
||||
#endif
|
||||
@ -1293,6 +1309,7 @@ typedef union {
|
||||
tBTA_DM_API_BLE_DTM_TX_START dtm_tx_start;
|
||||
tBTA_DM_API_BLE_DTM_RX_START dtm_rx_start;
|
||||
tBTA_DM_API_BLE_DTM_STOP dtm_stop;
|
||||
tBTA_DM_API_CLEAR_ADV ble_clear_adv;
|
||||
#endif
|
||||
|
||||
tBTA_DM_API_REMOVE_ACL remove_acl;
|
||||
@ -1663,6 +1680,7 @@ extern void bta_dm_cfg_coex_status(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_config_eir (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_set_page_timeout (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_get_page_timeout (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_set_acl_pkt_types (tBTA_DM_MSG *p_data);
|
||||
#endif
|
||||
extern void bta_dm_set_afh_channels (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_read_rmt_name(tBTA_DM_MSG *p_data);
|
||||
@ -1732,6 +1750,7 @@ extern void bta_dm_ble_multi_adv_enb(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_dtm_tx_start(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_dtm_rx_start(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_dtm_stop(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_clear_adv(tBTA_DM_MSG *p_data);
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
extern void bta_dm_ble_gap_dtm_enhance_tx_start(tBTA_DM_MSG *p_data);
|
||||
|
@ -932,7 +932,7 @@ tBTA_GATT_STATUS BTA_GATTC_RegisterForNotifications (tBTA_GATTC_IF client_if,
|
||||
}
|
||||
if (i == BTA_GATTC_NOTIF_REG_MAX) {
|
||||
status = BTA_GATT_NO_RESOURCES;
|
||||
APPL_TRACE_ERROR("Max Notification Reached, registration failed.");
|
||||
APPL_TRACE_ERROR("Max Notification Reached, registration failed,see CONFIG_BT_GATTC_NOTIF_REG_MAX in menuconfig");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user