forked from espressif/esp-idf
Compare commits
701 Commits
Author | SHA1 | Date | |
---|---|---|---|
7f5ecbe533 | |||
5afd0f5a3d | |||
af773c047a | |||
c83eb9dfc4 | |||
634c2c8bf1 | |||
277e4d5471 | |||
b4470860f9 | |||
5e79c3166c | |||
5f25bd8437 | |||
9e88f790ff | |||
971221f283 | |||
dd57ba77a3 | |||
9977dbe8e2 | |||
ae32582cc7 | |||
3caeaece6b | |||
3d1c15cd94 | |||
1f614bdcff | |||
592a51ae96 | |||
85661a037f | |||
c93c6317f5 | |||
69b9b0b7a6 | |||
313700e285 | |||
4c3c23562c | |||
e518e3efd3 | |||
39d2a2e0bd | |||
919b3e621e | |||
92964f0733 | |||
7f4bcc3695 | |||
f8d4bc8911 | |||
3f2f35bd5e | |||
5b0448eaed | |||
e10d97a5d2 | |||
166effd4b8 | |||
a8ef7570ca | |||
ed92569ed1 | |||
a8ebd8ad04 | |||
af81bd1b0a | |||
725eacbf16 | |||
940530c505 | |||
3305987d66 | |||
e63724adce | |||
53075e44ad | |||
79aea89853 | |||
bc225c8886 | |||
88482af17a | |||
a6d2c65fdc | |||
c35b14bb49 | |||
eb71cf38bb | |||
07d0cd15c3 | |||
eb61f5835a | |||
cbee4d4328 | |||
34bb7af431 | |||
3bc38b7ff4 | |||
20949d444f | |||
b1c856022c | |||
ad5b5ed4ed | |||
9108dcafd1 | |||
2635a18df2 | |||
237a5a0585 | |||
838abedbc8 | |||
2444d99612 | |||
a43a6809c7 | |||
78773966c3 | |||
8481fbf752 | |||
a13d5ef224 | |||
108274f6c0 | |||
0830a47b60 | |||
1af8f48a22 | |||
ba76bffb8b | |||
dbffc26bac | |||
8becd5a856 | |||
84b0254fbf | |||
9a97071501 | |||
f93304d36e | |||
333c3db233 | |||
be07eb4757 | |||
dbcf640261 | |||
e2cac5bf58 | |||
61191a5ce5 | |||
0179edb71d | |||
125ff0050e | |||
6099844644 | |||
a26c47be0f | |||
dbf8cd5b43 | |||
acb3b06ed6 | |||
f7b10c99c2 | |||
b306b48aa3 | |||
cd58bad218 | |||
9948de101d | |||
af02784331 | |||
0db5909b47 | |||
1af428dff3 | |||
2a50dd8a8f | |||
94d9c529f3 | |||
11c44c9838 | |||
12628677c5 | |||
903cb5eae8 | |||
ac7ce5bd02 | |||
46d3627e66 | |||
28f9ddee74 | |||
3314fcfdf7 | |||
c4aca02d7e | |||
9adf4dc240 | |||
792ff9ce8c | |||
79c0514f2b | |||
5c2a41d659 | |||
244ef221e3 | |||
6713c745c2 | |||
7bd5af7f1e | |||
d6ea9b9643 | |||
d1b989dae2 | |||
2209831dd2 | |||
1729c79577 | |||
dec4052ed7 | |||
65bf1ff368 | |||
ab848877a8 | |||
59f0d31dd2 | |||
871ecb8163 | |||
a9cc30e3e2 | |||
aa49bad73f | |||
0a41b9bcd8 | |||
f11cc8ca9d | |||
e2b8ebe804 | |||
6b980e526a | |||
da9a78ebfc | |||
f9e3384f49 | |||
c76ecbe682 | |||
2978de0f75 | |||
2d4f6d5b62 | |||
e302d9a976 | |||
71a0d61eae | |||
bc992d7975 | |||
e2e97a5a33 | |||
54813cc19b | |||
c5f6453586 | |||
a2de42c096 | |||
47c0db2830 | |||
baca425ce8 | |||
6508a4ee0a | |||
ee769abe19 | |||
58f725a7fd | |||
a6adac2a8b | |||
7df991f841 | |||
d3ae5ed08f | |||
09018a6af4 | |||
5ae4f34cb8 | |||
bb6e0e52b8 | |||
8d2fda5db6 | |||
ddb7036aee | |||
737cdcbaa6 | |||
ee12de9450 | |||
bb41b340b9 | |||
3eb3f9f744 | |||
a207f218ea | |||
3f3ca8bf60 | |||
548cce624c | |||
84bcd1d1f0 | |||
e9dd8a6bf5 | |||
f96e38a70d | |||
03832cceeb | |||
60ece59f04 | |||
1030bdd299 | |||
2fe4ff7031 | |||
ccb8b9d42c | |||
d70e80b7bb | |||
c740192123 | |||
b7ec10d461 | |||
d7dcb88fdc | |||
a98ecafaf2 | |||
92698b28d8 | |||
38b81d52c5 | |||
78b49a4ab6 | |||
4ba30e29ec | |||
6f69097815 | |||
fbaf50f1d9 | |||
d39da71671 | |||
1ec71ecc37 | |||
6db611ceb6 | |||
5f0bf15ad5 | |||
ce469140b5 | |||
75df40c617 | |||
6fb40068be | |||
548db6c139 | |||
ca5bc94c27 | |||
3f3c9be14c | |||
68027354ad | |||
e94ea3a02e | |||
21077eda8e | |||
1d09c78c17 | |||
3d47d8ae38 | |||
ec4dd8a3a2 | |||
719f05306f | |||
0010f4c3a8 | |||
9d7a7001ac | |||
2a20a3c33f | |||
e3f1308505 | |||
2ac7008a16 | |||
cdc92f8c01 | |||
1e0c16deaf | |||
c15f5f352c | |||
bcb9328618 | |||
7a14dc767f | |||
14ef8d56ca | |||
eb2f472069 | |||
ba8fc01327 | |||
5d58c10c3e | |||
ee0d9e03d0 | |||
9aca373bf0 | |||
4f8bd12479 | |||
3ae1c587c0 | |||
0077163813 | |||
769c6c2214 | |||
f61c51567f | |||
9ffb65f52e | |||
135927db06 | |||
0f59ffb94f | |||
c321739074 | |||
b9495f85cf | |||
a0bc7f57cc | |||
478c735fc6 | |||
096fdb8bb4 | |||
e6566deae4 | |||
e012b2b454 | |||
9fa4bb272e | |||
d5349fcc53 | |||
b8b7a0d8dd | |||
4bcf814855 | |||
870dfdf53b | |||
58afbf71ae | |||
27a9e68d2c | |||
25c2f710e1 | |||
42d3ecd3af | |||
74ceccaf62 | |||
b7ad8a150f | |||
a5c543a7a9 | |||
3112c8b954 | |||
143a572b55 | |||
b585bdd739 | |||
3c3a68513c | |||
eb7d52e18a | |||
549eb762d8 | |||
4b01f4080c | |||
75e375b257 | |||
e10025c849 | |||
c85d364720 | |||
08366a1bf0 | |||
959dd90787 | |||
2ac2077496 | |||
e1a845f7f8 | |||
89a141eea2 | |||
ddc294c79f | |||
5b4446b1d3 | |||
9f31b718c9 | |||
07c4eb8841 | |||
6360e7028d | |||
9119178f38 | |||
00beda2ef1 | |||
ebc57e14f6 | |||
0c8ac295c5 | |||
c7d1bcaf79 | |||
c3d425d21f | |||
35bb72bbfc | |||
3f5dba5eb9 | |||
03b10661b4 | |||
8d2c4e2f3f | |||
74e21fadbd | |||
aad557d70b | |||
75f3f81af9 | |||
2772806cb6 | |||
cc61509fc5 | |||
c4aa24c54e | |||
0dde7cf3f0 | |||
103a53c80a | |||
a2575d6b4d | |||
1bc252ec5c | |||
a5b0009cf8 | |||
09cc360b43 | |||
70ee85d38b | |||
5e175a4d01 | |||
05863cb267 | |||
4611e8971b | |||
43b610a429 | |||
2dc3784f49 | |||
3056fe4964 | |||
5311999ae9 | |||
5ab5672544 | |||
140b7d792b | |||
f8f3eb27c1 | |||
581b228d04 | |||
1313574c89 | |||
72b2de9dab | |||
42a5b33e19 | |||
1944b4bdb3 | |||
89dc570faf | |||
21a15ad172 | |||
154dffb14f | |||
3358969263 | |||
c111b94057 | |||
fdb2550da0 | |||
7221510205 | |||
77b8aadbb4 | |||
3f9b12d62a | |||
bc9e2f198f | |||
393bbbc851 | |||
71c962e332 | |||
99173d5629 | |||
d66d0f6b8d | |||
2a66480347 | |||
64d9852e1f | |||
643bea7aed | |||
434966f7b1 | |||
b333c1a9f1 | |||
0401aedd0c | |||
b1387fb7cb | |||
4a58b810dd | |||
116c5980c2 | |||
2e897c2e74 | |||
860232bdaf | |||
b8f682a11b | |||
fc43fed8ea | |||
829340d654 | |||
c9130e4859 | |||
22093dda21 | |||
1ffbee27e7 | |||
e40b83c16f | |||
70f90b7160 | |||
ba224e0fd9 | |||
8acb8bbd76 | |||
72e2fb2da1 | |||
d5175dacd2 | |||
dc6c01920c | |||
63a4298509 | |||
1dc350dc64 | |||
6f872f4088 | |||
362f1a778e | |||
1164a5a52f | |||
726a73c076 | |||
fabe42b090 | |||
3412140480 | |||
99953d4069 | |||
6f11f2ab13 | |||
45d1aa0145 | |||
ff09089137 | |||
e15818c71b | |||
2f7c293573 | |||
1e841ae802 | |||
7c3de76692 | |||
3cc3455ca6 | |||
eea8629fa1 | |||
622bfa3e28 | |||
9f4e1babf9 | |||
9c2ae8305a | |||
73d00170d6 | |||
d75037cc57 | |||
ca445ed99f | |||
8f674f5952 | |||
e69f473198 | |||
c8585267ab | |||
f30eab33a1 | |||
cb508c7d6a | |||
8f6cad1a93 | |||
5f86aaafdb | |||
3be0bae9d8 | |||
50059115a5 | |||
08c16af86d | |||
907c46ac0d | |||
43b1c0c875 | |||
e122778d35 | |||
2564bcb8d2 | |||
15d4079e5b | |||
658adc75de | |||
bcee30f78e | |||
d89922249d | |||
3017b65d4d | |||
7568139778 | |||
0147bd6b0d | |||
f46fba1904 | |||
1148e4e77f | |||
501c688941 | |||
f954caecf0 | |||
7d983baced | |||
71f7796da7 | |||
213cb1e424 | |||
b4daffd3ca | |||
51f82123a1 | |||
d836d8cf35 | |||
0f0baa5bb4 | |||
4729f75b41 | |||
dc010b701b | |||
ebb04bbdfe | |||
615bc28836 | |||
3056d6e53d | |||
9f3e341ccd | |||
4ffafc3aa6 | |||
1b8f3e096a | |||
d1c61d29d3 | |||
40c1529b4b | |||
78a38c8940 | |||
2f99d2e37f | |||
607400a048 | |||
f26d10118c | |||
f41931e5f6 | |||
caabf04af5 | |||
3955a85a47 | |||
6f4e857ae8 | |||
587aab3720 | |||
30d81f76b4 | |||
72de8349a6 | |||
a43850ca17 | |||
acd5850cad | |||
b6ec98535d | |||
9f40e41421 | |||
67fb17c939 | |||
372ab1468b | |||
8b3f916d1a | |||
7caafb2542 | |||
3b783f4d2d | |||
6ebd5381fb | |||
47bf0ef212 | |||
9747c3a8d6 | |||
4532e6e0b2 | |||
02bedfac62 | |||
9bb565b85c | |||
f8ed093684 | |||
91002fef86 | |||
7f4fa696e1 | |||
139ec8667c | |||
c88b27f285 | |||
958fce8571 | |||
c1fa7ad652 | |||
f2424e9b93 | |||
34230426a6 | |||
39c47cb6d8 | |||
9dcf03a17e | |||
7eee999b59 | |||
1608dad219 | |||
502d47fa44 | |||
1d15a41e4a | |||
db69ae2787 | |||
16e961a336 | |||
0ddeb8c47c | |||
7098e639ca | |||
656c6a3e86 | |||
e95afaee58 | |||
5c72fff43b | |||
ca313c8d28 | |||
81c0328817 | |||
06cdc0ee4f | |||
cbecb2e944 | |||
69be3b6955 | |||
5e1b0b97b5 | |||
5fc7c5aaed | |||
8aa90e4fb1 | |||
41e8d71349 | |||
469f66fc9d | |||
0b58bbd29b | |||
ea4ebc473b | |||
3229698d19 | |||
331f2d5277 | |||
9993e7714b | |||
29ae238845 | |||
64e0ee573d | |||
acbf7af80a | |||
dca90987d7 | |||
cb34db63fd | |||
74091777e6 | |||
078e179ed2 | |||
d7580183a6 | |||
889f2e47e2 | |||
5f7a98c13e | |||
7dcf576659 | |||
d38036b978 | |||
be19c10f53 | |||
44d626a596 | |||
0c60328953 | |||
51cbbe486c | |||
aecc46df64 | |||
ca19d23952 | |||
fd689630ff | |||
c011cdce1c | |||
6197871ba0 | |||
bfdf5ddcbd | |||
87c93cef31 | |||
2dc9aa9983 | |||
46df25cc8b | |||
319bf4e333 | |||
aa412b9359 | |||
450510cdb8 | |||
6d37f012e1 | |||
1a5baac621 | |||
c9b1b8bf81 | |||
d6a74e4141 | |||
73a4b80a87 | |||
40ca58496b | |||
b316ff3661 | |||
2ab4ce4bb1 | |||
209545db6a | |||
d5785d1968 | |||
69be7c4cc2 | |||
ec15b7798b | |||
5bd962cba7 | |||
1dd7c7a480 | |||
a816ccf888 | |||
5545b3790f | |||
972c531b6d | |||
4b02b56f77 | |||
c9124823ef | |||
bf74c6e89a | |||
c05c1a2e11 | |||
de9fd87a42 | |||
76207273fd | |||
7dda317028 | |||
d6822770cd | |||
270ed8d056 | |||
9cd98fbd4a | |||
ccd9d0f8ce | |||
1c1a3845ba | |||
c6d3708558 | |||
877848460d | |||
43876cb31b | |||
b32151f43a | |||
81424d9659 | |||
9b6d1b91c0 | |||
052ef42e0a | |||
0dd55387ea | |||
f8d94d6a4e | |||
d899ef0c80 | |||
d609f5fb35 | |||
b28454dd43 | |||
1fdf242750 | |||
81007ee4ed | |||
382fd801c7 | |||
b88c6f0951 | |||
da5a5b52c8 | |||
a57b0446b6 | |||
4a68f9e064 | |||
4a5fc3989d | |||
492e66b210 | |||
38ac62e704 | |||
cd61a77cd6 | |||
343acd7f88 | |||
26a4803048 | |||
280a241792 | |||
b84f9dd5cc | |||
214ebb4adb | |||
d194a449f4 | |||
e970ec5bf5 | |||
b2469bcaaa | |||
60253ed3f3 | |||
cd5e85aa19 | |||
40addb8faa | |||
ddaf57892c | |||
6ed15178b6 | |||
18e9879908 | |||
8bbaa77830 | |||
a202ec2caf | |||
361634c96b | |||
d7b33debc5 | |||
67cef89b23 | |||
e9269e5d17 | |||
3460f5bc8a | |||
050818181f | |||
b621017865 | |||
2d2e1190fe | |||
676a1d6eb1 | |||
6eb6bb071d | |||
8696dc15f1 | |||
26a897039e | |||
5920ffc1a9 | |||
a74b48c14a | |||
3c6fcb2b60 | |||
047eac2f25 | |||
481c295bc2 | |||
6db74398fe | |||
d34a91cace | |||
70ab635dd0 | |||
3144c870a6 | |||
238d48edbc | |||
07f860d7e1 | |||
5524c772e6 | |||
338b283fb9 | |||
0dc965d211 | |||
b910828a14 | |||
7e3e0fbbac | |||
5a9cfbbb28 | |||
df8390075b | |||
50ff1b0efd | |||
c8b634ecfe | |||
55458447fb | |||
d8c2f67d63 | |||
5020fbce1c | |||
4701d95052 | |||
6820c9decc | |||
88ee33bf4c | |||
b2efd94109 | |||
998451c60a | |||
c514009e6d | |||
7e36ba9a9d | |||
3bffe43cdc | |||
d0dd61c59a | |||
fdc839494f | |||
bf622042b7 | |||
691f9caa14 | |||
91c89a14f6 | |||
5a14a10aef | |||
3dc89437cc | |||
8d417c25cb | |||
d562d9f841 | |||
ed3841eb53 | |||
d3d1d4e1df | |||
7243032123 | |||
d47d2a210d | |||
65d35b0b45 | |||
09a8f171f2 | |||
6d1f1eccfb | |||
518ace6bb5 | |||
4ba5515dc0 | |||
3d64788a2d | |||
5e32649ae9 | |||
927af9cfbc | |||
0514906eba | |||
8e02b560a2 | |||
9ac257fd4e | |||
e9fd79b284 | |||
5bb61dfe2f | |||
241c38b5c0 | |||
9e44ecee4c | |||
698b11334f | |||
58642bd5dd | |||
d9c997af8c | |||
fe6e7d25f1 | |||
e9b037375a | |||
6903d32a9d | |||
7491cd7a9d | |||
bc09a70071 | |||
b9a667b9f8 | |||
b2a6403b40 | |||
555d72c90a | |||
ebca41b3ca | |||
b8b7dcc159 | |||
56c78fbbf7 | |||
378c54e273 | |||
8fb2a7a162 | |||
86d1425346 | |||
a2b60946ac | |||
6cc5e4aa3a | |||
ccdeb43cc7 | |||
452139ebc7 | |||
6dd6ac57e8 | |||
1ae3768321 | |||
82f63485ad | |||
ac63ec27d7 | |||
4385a5c626 | |||
a0a969c971 | |||
a02a84d8a5 | |||
18356cd124 | |||
73a1d3b1bf | |||
44bbfa4fb8 | |||
6655d1dad8 | |||
5607d2c918 | |||
c5292cae2e | |||
a200091546 | |||
c4912c0add | |||
aa25d83787 | |||
1fded0234c | |||
2ba26785d4 | |||
e15b3b8b9d | |||
b42b8b007a | |||
52af572bd5 | |||
e260a04f22 | |||
7a8ebdc409 | |||
7a8023e54c | |||
0a33ec0d1c | |||
b4650fcc16 | |||
83b1dd1c11 | |||
c577919284 | |||
41679c5c3d | |||
089312c46d | |||
5090955250 | |||
7b5870d4b8 | |||
a3b987b44c | |||
09b2aa5d5a | |||
036872789c | |||
db7c4e4938 | |||
922008a7e6 | |||
5172b6a89c | |||
000e2bbdc6 | |||
edb78e8196 | |||
2313663c2e | |||
85664aa637 | |||
d3940a6fe0 | |||
a29b415749 | |||
d3a7d21d0c | |||
8347f80287 | |||
7a02c7ddd8 | |||
b7b4fd44be | |||
19331b46ec | |||
9c3a57eafa | |||
8cd7c30bc7 | |||
3652792f9d | |||
2be35e400a |
2
.flake8
2
.flake8
@ -146,10 +146,8 @@ exclude =
|
||||
components/json/cJSON,
|
||||
components/mbedtls/mbedtls,
|
||||
components/openthread/openthread,
|
||||
components/tinyusb,
|
||||
components/unity/unity,
|
||||
components/spiffs/spiffs,
|
||||
examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib,
|
||||
# autogenerated scripts
|
||||
components/protocomm/python/constants_pb2.py,
|
||||
components/protocomm/python/sec0_pb2.py,
|
||||
|
182
.gitlab-ci.yml
182
.gitlab-ci.yml
@ -57,28 +57,27 @@ variables:
|
||||
PYTHON_VER: 3.7.10
|
||||
|
||||
CLANG_TIDY_RUNNER_PROJ: 2107 # idf/clang-tidy-runner
|
||||
IDF_BUILD_APPS_PROJ: 2818 # fuhanxi/idf-build-apps
|
||||
IDF_BUILD_APPS_PROJ: 2818 # espressif/idf-build-apps
|
||||
|
||||
# Docker images
|
||||
BOT_DOCKER_IMAGE_TAG: ":latest"
|
||||
|
||||
ESP_IDF_DOC_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.0:2-3"
|
||||
ESP_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-env-v5.0:2"
|
||||
AFL_FUZZER_TEST_IMAGE: "$CI_DOCKER_REGISTRY/afl-fuzzer-test-v5.0:2-1"
|
||||
CLANG_STATIC_ANALYSIS_IMAGE: "${CI_DOCKER_REGISTRY}/clang-static-analysis-v5.0:2-1"
|
||||
TARGET_TEST_ENV_IMAGE: "$CI_DOCKER_REGISTRY/target-test-env-v5.0:2"
|
||||
QEMU_IMAGE: "${CI_DOCKER_REGISTRY}/qemu-v5.0:2-20210826"
|
||||
ESP_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-env-v5.0:4"
|
||||
AFL_FUZZER_TEST_IMAGE: "$CI_DOCKER_REGISTRY/afl-fuzzer-test-v5.0:4-2"
|
||||
CLANG_STATIC_ANALYSIS_IMAGE: "${CI_DOCKER_REGISTRY}/clang-static-analysis-v5.0:4-2"
|
||||
ESP_IDF_DOC_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.0:4-4"
|
||||
QEMU_IMAGE: "${CI_DOCKER_REGISTRY}/qemu-v5.0:4-20220802"
|
||||
TARGET_TEST_ENV_IMAGE: "$CI_DOCKER_REGISTRY/target-test-env-v5.0:3"
|
||||
|
||||
SONARQUBE_SCANNER_IMAGE: "${CI_DOCKER_REGISTRY}/sonarqube-scanner:3"
|
||||
LINUX_SHELL_IMAGE: "${CI_DOCKER_REGISTRY}/linux-shells-v5.0:2"
|
||||
|
||||
PRE_COMMIT_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-pre-commit:1"
|
||||
|
||||
# target test config file, used by assign test job
|
||||
CI_TARGET_TEST_CONFIG_FILE: "$CI_PROJECT_DIR/.gitlab/ci/target-test.yml"
|
||||
|
||||
# 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"
|
||||
CI_AUTO_TEST_SCRIPT_REPO_URL: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/qa/auto_test_script.git"
|
||||
CI_AUTO_TEST_SCRIPT_REPO_BRANCH: "ci/v4.1"
|
||||
|
||||
# cache python dependencies
|
||||
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
||||
@ -112,140 +111,101 @@ cache:
|
||||
- .cache/submodule_archives
|
||||
policy: pull
|
||||
|
||||
.setup_tools_unless_target_test: &setup_tools_unless_target_test |
|
||||
.common_before_scripts: &common-before_scripts |
|
||||
source tools/ci/utils.sh
|
||||
is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
|
||||
|
||||
if [[ -n "$IDF_DONT_USE_MIRRORS" ]]; then
|
||||
export IDF_MIRROR_PREFIX_MAP=
|
||||
fi
|
||||
if [[ "$SETUP_TOOLS" == "1" || "$CI_JOB_STAGE" != "target_test" ]]; then
|
||||
tools/idf_tools.py --non-interactive install ${SETUP_TOOLS_LIST:-} && eval "$(tools/idf_tools.py --non-interactive export)" || exit 1
|
||||
if [[ ! -z "$OOCD_DISTRO_URL" && "$CI_JOB_STAGE" == "target_test" ]]; then
|
||||
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
|
||||
wget $OOCD_DISTRO_URL
|
||||
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
|
||||
tar -x -f $ARCH_NAME
|
||||
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
|
||||
export PATH=$PWD/openocd-esp32/bin:$PATH
|
||||
fi
|
||||
export IDF_MIRROR_PREFIX_MAP=
|
||||
fi
|
||||
|
||||
.download_test_python_contraint_file: &download_test_python_contraint_file |
|
||||
if echo "$CI_MERGE_REQUEST_LABELS" | egrep "^([^,\n\r]+,)*include_nightly_run(,[^,\n\r]+)*$"; then
|
||||
export INCLUDE_NIGHTLY_RUN="1"
|
||||
fi
|
||||
|
||||
# configure cmake related flags
|
||||
source tools/ci/configure_ci_environment.sh
|
||||
|
||||
# add extra python packages
|
||||
export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/esp_app_trace:$IDF_PATH/components/partition_table:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
|
||||
|
||||
.setup_tools_and_idf_python_venv: &setup_tools_and_idf_python_venv |
|
||||
# must use after setup_tools_except_target_test
|
||||
# otherwise the export.sh won't work properly
|
||||
|
||||
# download constraint file for dev
|
||||
if [[ -n "$CI_PYTHON_CONSTRAINT_BRANCH" ]]; then
|
||||
wget -O /tmp/constraint.txt --header="Authorization:Bearer ${ESPCI_TOKEN}" ${GITLAB_HTTP_SERVER}/api/v4/projects/2581/repository/files/${CI_PYTHON_CONSTRAINT_FILE}/raw?ref=${CI_PYTHON_CONSTRAINT_BRANCH}
|
||||
mkdir -p ~/.espressif
|
||||
mv /tmp/constraint.txt ~/.espressif/${CI_PYTHON_CONSTRAINT_FILE}
|
||||
fi
|
||||
|
||||
.download_test_python_tool: &download_test_python_tool |
|
||||
# Mirror
|
||||
if [[ -n "$IDF_DONT_USE_MIRRORS" ]]; then
|
||||
export IDF_MIRROR_PREFIX_MAP=
|
||||
fi
|
||||
|
||||
# install latest python packages
|
||||
# target test jobs
|
||||
if [[ "${CI_JOB_STAGE}" == "target_test" ]]; then
|
||||
# ttfw jobs
|
||||
if ! echo "${CI_JOB_NAME}" | egrep ".+_pytest_.+"; then
|
||||
run_cmd bash install.sh --enable-ci --enable-ttfw
|
||||
else
|
||||
run_cmd bash install.sh --enable-ci --enable-pytest
|
||||
fi
|
||||
elif [[ "${CI_JOB_STAGE}" == "build_doc" ]]; then
|
||||
run_cmd bash install.sh --enable-ci --enable-docs
|
||||
elif [[ "${CI_JOB_STAGE}" == "build" ]]; then
|
||||
run_cmd bash install.sh --enable-ci --enable-pytest
|
||||
else
|
||||
run_cmd bash install.sh --enable-ci
|
||||
fi
|
||||
|
||||
source ./export.sh
|
||||
|
||||
# Custom OpenOCD
|
||||
if [[ ! -z "$OOCD_DISTRO_URL" && "$CI_JOB_STAGE" == "target_test" ]]; then
|
||||
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
|
||||
wget $OOCD_DISTRO_URL
|
||||
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
|
||||
tar -x -f $ARCH_NAME
|
||||
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
|
||||
export PATH=$PWD/openocd-esp32/bin:$PATH
|
||||
fi
|
||||
|
||||
if [[ -n "$CI_PYTHON_TOOL_REPO" ]]; then
|
||||
git clone --quiet --depth=1 -b ${CI_PYTHON_TOOL_BRANCH} https://gitlab-ci-token:${ESPCI_TOKEN}@${GITLAB_HTTPS_HOST}/espressif/${CI_PYTHON_TOOL_REPO}.git
|
||||
pip install ./${CI_PYTHON_TOOL_REPO}
|
||||
rm -rf ${CI_PYTHON_TOOL_REPO}
|
||||
fi
|
||||
|
||||
.set_include_nightly_run: &set_include_nightly_run |
|
||||
if echo "$CI_MERGE_REQUEST_LABELS" | egrep "^([^,\n\r]+,)*include_nightly_run(,[^,\n\r]+)*$"; then
|
||||
export INCLUDE_NIGHTLY_RUN="1"
|
||||
fi
|
||||
|
||||
before_script:
|
||||
- source tools/ci/utils.sh
|
||||
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
|
||||
- *set_include_nightly_run
|
||||
- source tools/ci/setup_python.sh
|
||||
- *common-before_scripts
|
||||
- *setup_tools_and_idf_python_venv
|
||||
- add_gitlab_ssh_keys
|
||||
- source tools/ci/configure_ci_environment.sh
|
||||
- *setup_tools_unless_target_test
|
||||
- fetch_submodules
|
||||
- *download_test_python_contraint_file
|
||||
- $IDF_PATH/tools/idf_tools.py install-python-env
|
||||
# install esptool globally, TODO: remove this, IDFCI-1207
|
||||
- pip install esptool -c ~/.espressif/${CI_PYTHON_CONSTRAINT_FILE}
|
||||
- *download_test_python_tool
|
||||
|
||||
# used for check scripts which we want to run unconditionally
|
||||
.before_script_no_sync_submodule:
|
||||
before_script:
|
||||
- echo "Not setting up GitLab key, not fetching submodules"
|
||||
- source tools/ci/utils.sh
|
||||
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
|
||||
- *set_include_nightly_run
|
||||
- source tools/ci/setup_python.sh
|
||||
- source tools/ci/configure_ci_environment.sh
|
||||
- *download_test_python_contraint_file
|
||||
- $IDF_PATH/tools/idf_tools.py install-python-env
|
||||
|
||||
.before_script_minimal:
|
||||
before_script:
|
||||
- echo "Only load utils.sh"
|
||||
- source tools/ci/utils.sh
|
||||
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
|
||||
- *set_include_nightly_run
|
||||
|
||||
.before_script_integration_test:
|
||||
before_script:
|
||||
# need to install esptool, needn't install idf python env
|
||||
- source tools/ci/utils.sh
|
||||
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
|
||||
- *set_include_nightly_run
|
||||
- source tools/ci/setup_python.sh
|
||||
- add_gitlab_ssh_keys
|
||||
- fetch_submodules
|
||||
# download the constraint file manually
|
||||
- mkdir -p ~/.espressif
|
||||
- wget -O ~/.espressif/${CI_PYTHON_CONSTRAINT_FILE} --header="Authorization:Bearer ${ESPCI_TOKEN}" ${GITLAB_HTTP_SERVER}/api/v4/projects/2581/repository/files/${CI_PYTHON_CONSTRAINT_FILE}/raw
|
||||
- *download_test_python_contraint_file
|
||||
# TODO: remove this, IDFCI-1207
|
||||
- pip install esptool -c ~/.espressif/${CI_PYTHON_CONSTRAINT_FILE}
|
||||
- *download_test_python_tool
|
||||
- *common-before_scripts
|
||||
|
||||
.before_script_macos:
|
||||
before_script:
|
||||
- source tools/ci/utils.sh
|
||||
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
|
||||
- *set_include_nightly_run
|
||||
- export IDF_TOOLS_PATH="${HOME}/.espressif_runner_${CI_RUNNER_ID}_${CI_CONCURRENT_ID}"
|
||||
- *download_test_python_contraint_file
|
||||
- $IDF_PATH/tools/idf_tools.py install-python-env
|
||||
- *common-before_scripts
|
||||
# On macOS, these tools need to be installed
|
||||
- export IDF_TOOLS_PATH="${HOME}/.espressif_runner_${CI_RUNNER_ID}_${CI_CONCURRENT_ID}"
|
||||
- $IDF_PATH/tools/idf_tools.py --non-interactive install cmake ninja
|
||||
# This adds tools (compilers) and the version-specific Python environment to PATH
|
||||
- *setup_tools_unless_target_test
|
||||
# Install packages required by CI scripts into IDF Python environment
|
||||
- pip install -r $IDF_PATH/tools/requirements/requirements.ci.txt
|
||||
- source tools/ci/configure_ci_environment.sh
|
||||
# Part of tools/ci/setup_python.sh; we don't use pyenv on macOS, so can't run the rest of the script.
|
||||
- export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
|
||||
- *setup_tools_and_idf_python_venv
|
||||
- fetch_submodules
|
||||
|
||||
.before_script_pytest:
|
||||
before_script:
|
||||
- source tools/ci/utils.sh
|
||||
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
|
||||
- *set_include_nightly_run
|
||||
- source tools/ci/setup_python.sh
|
||||
- add_gitlab_ssh_keys
|
||||
- source tools/ci/configure_ci_environment.sh
|
||||
- *setup_tools_unless_target_test
|
||||
- fetch_submodules
|
||||
- *download_test_python_contraint_file
|
||||
# only need ci and pytest related packages, ttfw requirements would be mocked if not installed
|
||||
- $IDF_PATH/tools/idf_tools.py install-python-env --features pytest,ci
|
||||
- eval "$($IDF_PATH/tools/idf_tools.py export)" # use idf venv instead
|
||||
|
||||
.before_script_build_jobs:
|
||||
before_script:
|
||||
- source tools/ci/utils.sh
|
||||
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
|
||||
- *set_include_nightly_run
|
||||
- source tools/ci/setup_python.sh
|
||||
- *common-before_scripts
|
||||
- *setup_tools_and_idf_python_venv
|
||||
- add_gitlab_ssh_keys
|
||||
- source tools/ci/configure_ci_environment.sh
|
||||
- *setup_tools_unless_target_test
|
||||
- fetch_submodules
|
||||
- *download_test_python_contraint_file
|
||||
# only need ci and pytest related packages, ttfw requirements would be mocked if not installed
|
||||
- $IDF_PATH/tools/idf_tools.py install-python-env --features pytest,ci
|
||||
- eval "$($IDF_PATH/tools/idf_tools.py export)" # use idf venv instead
|
||||
- export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
|
||||
- export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}
|
||||
|
||||
|
@ -2,208 +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/workflows/ @esp-idf-codeowners/ci
|
||||
/.gitlab-ci.yml @esp-idf-codeowners/ci
|
||||
/.gitlab/ci/ @esp-idf-codeowners/ci
|
||||
/.pre-commit-config.yaml @esp-idf-codeowners/ci
|
||||
/.readthedocs.yml @esp-idf-codeowners/docs
|
||||
/CMakeLists.txt @esp-idf-codeowners/build-config
|
||||
/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/tools
|
||||
/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_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/tools
|
||||
/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_netif/ @esp-idf-codeowners/network
|
||||
/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
|
||||
/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_serial_slave_link/ @esp-idf-codeowners/peripherals
|
||||
/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/tools
|
||||
/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/tools
|
||||
/components/nvs_flash/ @esp-idf-codeowners/storage
|
||||
/components/openthread/ @esp-idf-codeowners/ieee802154
|
||||
/components/partition_table/ @esp-idf-codeowners/system
|
||||
/components/perfmon/ @esp-idf-codeowners/tools
|
||||
/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/tinyusb/ @esp-idf-codeowners/peripherals/usb
|
||||
/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
|
||||
/components/xtensa/ @esp-idf-codeowners/system
|
||||
|
||||
/docs/ @esp-idf-codeowners/docs
|
||||
/docs/**/api-reference/bluetooth/ @esp-idf-codeowners/bluetooth
|
||||
/docs/**/api-reference/network/ @esp-idf-codeowners/network
|
||||
/docs/**/api-reference/peripherals/ @esp-idf-codeowners/peripherals
|
||||
/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
|
||||
/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/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/esp_prov/ @esp-idf-codeowners/app-utilities
|
||||
/tools/idf_size_yaml/ @esp-idf-codeowners/peripherals
|
||||
/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/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/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
|
||||
|
@ -116,7 +116,7 @@ curl -X POST --header "PRIVATE-TOKEN: [YOUR PERSONAL ACCESS TOKEN]" [GITLAB_SERV
|
||||
```yaml
|
||||
check_docs_lang_sync:
|
||||
extends:
|
||||
- .pre_check_job_template
|
||||
- .pre_check_template
|
||||
- .rules:build:docs
|
||||
script:
|
||||
- cd docs
|
||||
|
@ -85,6 +85,8 @@ assign_integration_test:
|
||||
extends:
|
||||
- .assign_test_template
|
||||
- .rules:test:integration_test
|
||||
- .before_script_minimal
|
||||
image: ${CI_INTEGRATION_TEST_ENV_IMAGE}
|
||||
needs:
|
||||
- build_ssc_esp32
|
||||
- build_ssc_esp32c3
|
||||
@ -98,12 +100,13 @@ assign_integration_test:
|
||||
INTEGRATION_TEST_CASE_PATH: "${CI_PROJECT_DIR}/auto_test_script/TestCaseFiles"
|
||||
ASSIGN_TEST_CASE_SCRIPT: "${CI_PROJECT_DIR}/auto_test_script/bin/CIAssignTestCases.py"
|
||||
PYTHONPATH: ${CI_PROJECT_DIR}/auto_test_script/packages
|
||||
PYTHON_VER: 3.7.7
|
||||
GIT_LFS_SKIP_SMUDGE: 1
|
||||
script:
|
||||
- add_gitlab_ssh_keys
|
||||
# clone test script to assign tests
|
||||
# can not retry if downing git lfs files failed, so using empty_branch first.
|
||||
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} -b empty_branch
|
||||
- retry_failed git -C auto_test_script checkout -f ${CI_AUTO_TEST_SCRIPT_REPO_BRANCH}
|
||||
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script --customized_only
|
||||
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} auto_test_script
|
||||
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script
|
||||
- cd auto_test_script
|
||||
- ./tools/ci/setup_idfci.sh
|
||||
# assign integration test cases
|
||||
- python ${ASSIGN_TEST_CASE_SCRIPT} -t ${INTEGRATION_TEST_CASE_PATH} -c $CI_TARGET_TEST_CONFIG_FILE -b ${BUILD_DIR} -o $TEST_DIR/test_configs
|
||||
|
@ -77,45 +77,6 @@ build:integration_test:
|
||||
included_in:
|
||||
- build:target_test
|
||||
|
||||
# -------------
|
||||
# Special Cases
|
||||
# -------------
|
||||
"build:{0}-esp32s3":
|
||||
matrix:
|
||||
- *target_test
|
||||
labels:
|
||||
- build
|
||||
- "{0}"
|
||||
- target_test
|
||||
patterns:
|
||||
- build_components
|
||||
- build_system
|
||||
- build_target_test
|
||||
- "{0}"
|
||||
- "build-{0}"
|
||||
included_in:
|
||||
- "build:{0}"
|
||||
- build:target_test
|
||||
|
||||
"build:component_ut-esp32s3":
|
||||
matrix:
|
||||
- *target_test
|
||||
labels:
|
||||
- build
|
||||
- component_ut
|
||||
- unit_test
|
||||
- target_test
|
||||
patterns:
|
||||
- build_components
|
||||
- build_system
|
||||
- build_target_test
|
||||
- component_ut
|
||||
- unit_test
|
||||
- build-component_ut
|
||||
- build-unit_test
|
||||
included_in:
|
||||
- "build:{0}"
|
||||
- build:target_test
|
||||
|
||||
####################
|
||||
# Target Test Jobs #
|
||||
@ -167,6 +128,7 @@ build:integration_test:
|
||||
- wifi # example_test_002, example_test*wifi*
|
||||
- ethernet # example_test*ethernet*
|
||||
- sdio # UT_044, UT_045
|
||||
- adc # component_ut_pytest_esp32x_adc
|
||||
patterns:
|
||||
- "{0}-{1}-{2}"
|
||||
- "{0}-{2}"
|
||||
@ -214,27 +176,6 @@ build:integration_test:
|
||||
- "build:component_ut-esp32c2"
|
||||
- build:target_test
|
||||
|
||||
# due to the lack of runners, s3 tests will only be triggered by label
|
||||
"test:{0}-esp32s3":
|
||||
matrix:
|
||||
- *target_test
|
||||
labels:
|
||||
- "{0}_esp32s3"
|
||||
included_in:
|
||||
- "build:{0}"
|
||||
- "build:{0}-esp32s3"
|
||||
- build:target_test
|
||||
|
||||
# overwrite the esp32s3 component ut again
|
||||
"test:component_ut-esp32s3": # component_ut will trigger by unit_test as well, since now we have 2 kinds of UT
|
||||
labels:
|
||||
- "component_ut_esp32s3"
|
||||
- "unit_test_esp32s3"
|
||||
included_in:
|
||||
- build:component_ut
|
||||
- "build:component_ut-esp32s3"
|
||||
- build:target_test
|
||||
|
||||
"test:integration_test":
|
||||
labels:
|
||||
- integration_test
|
||||
|
@ -1,5 +1,4 @@
|
||||
.deploy_job_template:
|
||||
extends: .before_script_no_sync_submodule
|
||||
stage: deploy
|
||||
image: $ESP_ENV_IMAGE
|
||||
tags:
|
||||
|
@ -41,7 +41,7 @@
|
||||
# stage: pre_check
|
||||
check_readme_links:
|
||||
extends:
|
||||
- .pre_check_job_template
|
||||
- .pre_check_template
|
||||
tags: ["build", "amd64", "internet"]
|
||||
allow_failure: true
|
||||
script:
|
||||
@ -49,7 +49,7 @@ check_readme_links:
|
||||
|
||||
check_docs_lang_sync:
|
||||
extends:
|
||||
- .pre_check_job_template
|
||||
- .pre_check_template
|
||||
- .doc-rules:build:docs
|
||||
script:
|
||||
- cd docs
|
||||
@ -62,7 +62,6 @@ check_docs_lang_sync:
|
||||
dependencies: []
|
||||
script:
|
||||
- cd docs
|
||||
- pip install -U -r $IDF_PATH/tools/requirements/requirements.docs.txt
|
||||
- build-docs -t $DOCTGT -bs $DOC_BUILDERS -l $DOCLANG build
|
||||
parallel:
|
||||
matrix:
|
||||
@ -72,11 +71,10 @@ check_docs_lang_sync:
|
||||
check_docs_gh_links:
|
||||
image: $ESP_IDF_DOC_ENV_IMAGE
|
||||
extends:
|
||||
- .pre_check_job_template
|
||||
- .pre_check_template
|
||||
- .doc-rules:build:docs
|
||||
script:
|
||||
- cd docs
|
||||
- pip install -U -r $IDF_PATH/tools/requirements/requirements.docs.txt
|
||||
- build-docs gh-linkcheck
|
||||
|
||||
# stage: build_doc
|
||||
@ -148,8 +146,6 @@ build_docs_pdf:
|
||||
DOC_BUILDERS: "latex"
|
||||
|
||||
.deploy_docs_template:
|
||||
extends:
|
||||
- .before_script_no_sync_submodule
|
||||
image: $ESP_IDF_DOC_ENV_IMAGE
|
||||
variables:
|
||||
DOCS_BUILD_DIR: "${IDF_PATH}/docs/_build/"
|
||||
@ -161,7 +157,6 @@ build_docs_pdf:
|
||||
script:
|
||||
- add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
|
||||
- export GIT_VER=$(git describe --always ${PIPELINE_COMMIT_SHA} --)
|
||||
- pip install -U -r $IDF_PATH/tools/requirements/requirements.docs.txt
|
||||
- deploy-docs
|
||||
|
||||
# stage: test_deploy
|
||||
@ -227,5 +222,4 @@ check_doc_links:
|
||||
allow_failure: true
|
||||
script:
|
||||
- cd docs
|
||||
- pip install -U -r $IDF_PATH/tools/requirements/requirements.docs.txt
|
||||
- build-docs -t $DOCTGT -l $DOCLANG linkcheck
|
||||
|
@ -204,19 +204,26 @@ test_idf_py:
|
||||
- cd ${IDF_PATH}/tools/test_idf_py
|
||||
- ./test_idf_py.py
|
||||
|
||||
# Test for create virtualenv. It must be invoked from Python, not from virtualenv.
|
||||
# Use docker image system python without any extra dependencies
|
||||
test_idf_tools:
|
||||
extends: .host_test_template
|
||||
extends:
|
||||
- .host_test_template
|
||||
- .before_script_minimal
|
||||
artifacts:
|
||||
when: on_failure
|
||||
paths:
|
||||
- tools/tools.new.json
|
||||
expire_in: 1 week
|
||||
image:
|
||||
name: $ESP_ENV_IMAGE
|
||||
entrypoint: [""] # use system python3. no extra pip package installed
|
||||
script:
|
||||
# Remove Xtensa and ULP toolchains from the PATH, tests will expect a clean environment
|
||||
- export PATH=$(p=$(echo $PATH | tr ":" "\n" | grep -v "/root/.espressif/tools\|/opt/espressif" | tr "\n" ":"); echo ${p%:})
|
||||
# Tools must be downloaded for testing
|
||||
- python3 ${IDF_PATH}/tools/idf_tools.py download
|
||||
- cd ${IDF_PATH}/tools/test_idf_tools
|
||||
- ./test_idf_tools.py
|
||||
# Test for create virtualenv. It must be invoked from Python, not from virtualenv.
|
||||
- python3 -m pip install jsonschema
|
||||
- python3 ./test_idf_tools.py
|
||||
- python3 ./test_idf_tools_python_env.py
|
||||
|
||||
.test_efuse_table_on_host_template:
|
||||
@ -268,7 +275,7 @@ test_espcoredump:
|
||||
expire_in: 1 week
|
||||
variables:
|
||||
IDF_COREDUMP_ELF_REPO: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/idf/idf-coredump-elf.git"
|
||||
IDF_COREDUMP_ELF_TAG: idf-20210915
|
||||
IDF_COREDUMP_ELF_TAG: idf-20220928
|
||||
# install CMake version specified in tools.json
|
||||
SETUP_TOOLS_LIST: "all"
|
||||
script:
|
||||
@ -316,8 +323,8 @@ test_mkuf2:
|
||||
- ./test_mkuf2.py
|
||||
|
||||
test_autocomplete:
|
||||
extends: .host_test_template
|
||||
image: $LINUX_SHELL_IMAGE
|
||||
extends:
|
||||
- .host_test_template
|
||||
artifacts:
|
||||
when: on_failure
|
||||
paths:
|
||||
@ -327,8 +334,8 @@ test_autocomplete:
|
||||
- ${IDF_PATH}/tools/ci/test_autocomplete.py
|
||||
|
||||
test_detect_python:
|
||||
extends: .host_test_template
|
||||
image: $LINUX_SHELL_IMAGE
|
||||
extends:
|
||||
- .host_test_template
|
||||
script:
|
||||
- cd ${IDF_PATH}
|
||||
- shellcheck -s sh tools/detect_python.sh
|
||||
@ -430,6 +437,14 @@ test_linux_example:
|
||||
- timeout 5 ./build/linux_host_app.elf >test.log || true
|
||||
- grep "Restarting" test.log
|
||||
|
||||
test_partition_api_host:
|
||||
extends: .host_test_template
|
||||
script:
|
||||
- cd ${IDF_PATH}/components/esp_partition/host_test/partition_api_test
|
||||
- idf.py build
|
||||
- timeout 5 ./build/partition_api_test.elf >test.log
|
||||
- grep " 0 Failures" test.log
|
||||
|
||||
test_gen_soc_caps_kconfig:
|
||||
extends: .host_test_template
|
||||
script:
|
||||
|
@ -1,21 +1,15 @@
|
||||
.pre_check_base_template:
|
||||
.pre_check_template:
|
||||
stage: pre_check
|
||||
image: $ESP_ENV_IMAGE
|
||||
tags:
|
||||
- host_test
|
||||
dependencies: []
|
||||
|
||||
.pre_check_job_template:
|
||||
extends:
|
||||
- .pre_check_base_template
|
||||
- .before_script_no_sync_submodule
|
||||
|
||||
.check_pre_commit_template:
|
||||
extends: .pre_check_job_template
|
||||
image: "$CI_DOCKER_REGISTRY/esp-idf-pre-commit:1"
|
||||
before_script:
|
||||
- source tools/ci/utils.sh
|
||||
- export PYTHONPATH="$CI_PROJECT_DIR/tools:$CI_PROJECT_DIR/tools/ci/python_packages:$PYTHONPATH"
|
||||
extends:
|
||||
- .pre_check_template
|
||||
- .before_script_minimal
|
||||
image: $PRE_COMMIT_IMAGE
|
||||
|
||||
check_pre_commit_master_release:
|
||||
extends:
|
||||
@ -35,32 +29,20 @@ check_version:
|
||||
# Don't run this for feature/bugfix branches, so that it is possible to modify
|
||||
# esp_idf_version.h in a branch before tagging the next version.
|
||||
extends:
|
||||
- .pre_check_job_template
|
||||
- .pre_check_template
|
||||
- .rules:protected
|
||||
script:
|
||||
- export IDF_PATH=$PWD
|
||||
- tools/ci/check_idf_version.sh
|
||||
|
||||
check_rom_api_header:
|
||||
extends: .pre_check_job_template
|
||||
extends: .pre_check_template
|
||||
script:
|
||||
- tools/ci/check_examples_rom_header.sh
|
||||
- tools/ci/check_api_violation.sh
|
||||
|
||||
check_python_style:
|
||||
extends:
|
||||
- .pre_check_base_template
|
||||
- .rules:patterns:python-files
|
||||
artifacts:
|
||||
when: on_failure
|
||||
paths:
|
||||
- flake8_output.txt
|
||||
expire_in: 1 week
|
||||
script:
|
||||
- python -m flake8 --config=$IDF_PATH/.flake8 --output-file=flake8_output.txt --tee --benchmark $IDF_PATH
|
||||
|
||||
test_check_kconfigs:
|
||||
extends: .pre_check_job_template
|
||||
extends: .pre_check_template
|
||||
artifacts:
|
||||
when: on_failure
|
||||
paths:
|
||||
@ -75,7 +57,7 @@ test_check_kconfigs:
|
||||
- python ${IDF_PATH}/tools/ci/test_check_kconfigs.py
|
||||
|
||||
check_blobs:
|
||||
extends: .pre_check_base_template
|
||||
extends: .pre_check_template
|
||||
tags:
|
||||
- build
|
||||
variables:
|
||||
@ -90,7 +72,7 @@ check_blobs:
|
||||
- bash $IDF_PATH/tools/ci/check_blobs.sh
|
||||
|
||||
check_fuzzer_compilation:
|
||||
extends: .pre_check_base_template
|
||||
extends: .pre_check_template
|
||||
image: $AFL_FUZZER_TEST_IMAGE
|
||||
script:
|
||||
- cd ${IDF_PATH}/components/lwip/test_afl_host
|
||||
@ -100,7 +82,7 @@ check_fuzzer_compilation:
|
||||
|
||||
check_public_headers:
|
||||
extends:
|
||||
- .pre_check_base_template
|
||||
- .pre_check_template
|
||||
- .rules:build
|
||||
tags:
|
||||
- build
|
||||
@ -113,7 +95,7 @@ check_public_headers:
|
||||
|
||||
check_chip_support_components:
|
||||
extends:
|
||||
- .pre_check_base_template
|
||||
- .pre_check_template
|
||||
- .rules:build
|
||||
tags:
|
||||
- build
|
||||
@ -130,7 +112,7 @@ check_chip_support_components:
|
||||
|
||||
check_esp_err_to_name:
|
||||
extends:
|
||||
- .pre_check_base_template
|
||||
- .pre_check_template
|
||||
- .rules:build
|
||||
tags:
|
||||
- build
|
||||
@ -146,7 +128,7 @@ check_esp_err_to_name:
|
||||
|
||||
check_esp_system:
|
||||
extends:
|
||||
- .pre_check_base_template
|
||||
- .pre_check_template
|
||||
- .rules:build
|
||||
tags:
|
||||
- build
|
||||
@ -157,19 +139,19 @@ check_esp_system:
|
||||
# the version returned by 'git describe'
|
||||
check_version_tag:
|
||||
extends:
|
||||
- .pre_check_job_template
|
||||
- .pre_check_template
|
||||
- .rules:tag:release
|
||||
script:
|
||||
- (git cat-file -t $CI_COMMIT_REF_NAME | grep tag) || (echo "ESP-IDF versions must be annotated tags." && exit 1)
|
||||
|
||||
check_artifacts_expire_time:
|
||||
extends: .pre_check_job_template
|
||||
extends: .pre_check_template
|
||||
script:
|
||||
# check if we have set expire time for all artifacts
|
||||
- python tools/ci/check_artifacts_expire_time.py
|
||||
|
||||
check_commit_msg:
|
||||
extends: .pre_check_job_template
|
||||
extends: .pre_check_template
|
||||
script:
|
||||
- git status
|
||||
- git log -n10 --oneline ${PIPELINE_COMMIT_SHA}
|
||||
@ -178,7 +160,7 @@ check_commit_msg:
|
||||
|
||||
check_test_scripts_build_test_rules:
|
||||
extends:
|
||||
- .pre_check_job_template
|
||||
- .pre_check_template
|
||||
- .before_script_build_jobs
|
||||
script:
|
||||
- python tools/ci/check_build_test_rules.py check-test-scripts examples/ tools/test_apps components
|
||||
|
@ -170,9 +170,8 @@
|
||||
- "components/openthread/openthread"
|
||||
- "components/protobuf-c/protobuf-c"
|
||||
- "components/spiffs/spiffs"
|
||||
- "components/tinyusb/tinyusb"
|
||||
- "components/unity/unity"
|
||||
- "examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib"
|
||||
- "components/heap/tlsf"
|
||||
- ".gitmodules"
|
||||
|
||||
# for jobs: example_test*flash_encryption_wifi_high_traffic
|
||||
@ -220,6 +219,13 @@
|
||||
- "components/driver/**/*"
|
||||
- "components/sdmmc/**/*"
|
||||
|
||||
# for jobs: component_ut_pytest_esp32x_adc:
|
||||
.patterns-component_ut-adc: &patterns-component_ut-adc
|
||||
- "components/esp_adc/**/*"
|
||||
- "components/driver/**/*"
|
||||
- "components/hal/**/*"
|
||||
- "components/esp_hw_support/**/*"
|
||||
- "components/efuse/**/*"
|
||||
|
||||
##############
|
||||
# if anchors #
|
||||
@ -499,7 +505,7 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-unit_test
|
||||
changes: *patterns-component_ut-adc
|
||||
|
||||
.rules:build:component_ut-esp32:
|
||||
rules:
|
||||
@ -519,6 +525,8 @@
|
||||
changes: *patterns-build_system
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut-adc
|
||||
|
||||
.rules:build:component_ut-esp32c2:
|
||||
rules:
|
||||
@ -534,6 +542,8 @@
|
||||
changes: *patterns-build_components
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-build_system
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut-adc
|
||||
|
||||
.rules:build:component_ut-esp32c3:
|
||||
rules:
|
||||
@ -552,6 +562,8 @@
|
||||
changes: *patterns-build_system
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut-adc
|
||||
|
||||
.rules:build:component_ut-esp32h2:
|
||||
rules:
|
||||
@ -570,6 +582,8 @@
|
||||
changes: *patterns-build_system
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut-adc
|
||||
|
||||
.rules:build:component_ut-esp32s2:
|
||||
rules:
|
||||
@ -588,6 +602,8 @@
|
||||
changes: *patterns-build_system
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut-adc
|
||||
|
||||
.rules:build:component_ut-esp32s3:
|
||||
rules:
|
||||
@ -607,7 +623,7 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-unit_test
|
||||
changes: *patterns-component_ut-adc
|
||||
|
||||
.rules:build:custom_test:
|
||||
rules:
|
||||
@ -984,6 +1000,8 @@
|
||||
changes: *patterns-build_system
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut-adc
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-custom_test
|
||||
- <<: *if-dev-push
|
||||
@ -1191,6 +1209,19 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut
|
||||
|
||||
.rules:test:component_ut-esp32-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-component_ut
|
||||
- <<: *if-label-component_ut_esp32
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut-adc
|
||||
|
||||
.rules:test:component_ut-esp32-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -1245,6 +1276,19 @@
|
||||
- <<: *if-label-component_ut_esp32c2
|
||||
- <<: *if-label-unit_test_esp32c2
|
||||
|
||||
.rules:test:component_ut-esp32c2-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-component_ut
|
||||
- <<: *if-label-component_ut_esp32c2
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut-adc
|
||||
|
||||
.rules:test:component_ut-esp32c2-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -1304,6 +1348,19 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut
|
||||
|
||||
.rules:test:component_ut-esp32c3-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-component_ut
|
||||
- <<: *if-label-component_ut_esp32c3
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut-adc
|
||||
|
||||
.rules:test:component_ut-esp32c3-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -1363,6 +1420,19 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut
|
||||
|
||||
.rules:test:component_ut-esp32h2-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-component_ut
|
||||
- <<: *if-label-component_ut_esp32h2
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut-adc
|
||||
|
||||
.rules:test:component_ut-esp32h2-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -1422,6 +1492,19 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut
|
||||
|
||||
.rules:test:component_ut-esp32s2-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-component_ut
|
||||
- <<: *if-label-component_ut_esp32s2
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut-adc
|
||||
|
||||
.rules:test:component_ut-esp32s2-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -1473,8 +1556,26 @@
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-component_ut
|
||||
- <<: *if-label-component_ut_esp32s3
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-label-unit_test
|
||||
- <<: *if-label-unit_test_esp32s3
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut
|
||||
|
||||
.rules:test:component_ut-esp32s3-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-component_ut
|
||||
- <<: *if-label-component_ut_esp32s3
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-component_ut-adc
|
||||
|
||||
.rules:test:component_ut-esp32s3-bt:
|
||||
rules:
|
||||
@ -1533,6 +1634,17 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-custom_test
|
||||
|
||||
.rules:test:custom_test-esp32-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-custom_test
|
||||
- <<: *if-label-custom_test_esp32
|
||||
- <<: *if-label-target_test
|
||||
|
||||
.rules:test:custom_test-esp32-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -1586,6 +1698,17 @@
|
||||
when: never
|
||||
- <<: *if-label-custom_test_esp32c2
|
||||
|
||||
.rules:test:custom_test-esp32c2-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-custom_test
|
||||
- <<: *if-label-custom_test_esp32c2
|
||||
- <<: *if-label-target_test
|
||||
|
||||
.rules:test:custom_test-esp32c2-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -1643,6 +1766,17 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-custom_test
|
||||
|
||||
.rules:test:custom_test-esp32c3-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-custom_test
|
||||
- <<: *if-label-custom_test_esp32c3
|
||||
- <<: *if-label-target_test
|
||||
|
||||
.rules:test:custom_test-esp32c3-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -1700,6 +1834,17 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-custom_test
|
||||
|
||||
.rules:test:custom_test-esp32h2-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-custom_test
|
||||
- <<: *if-label-custom_test_esp32h2
|
||||
- <<: *if-label-target_test
|
||||
|
||||
.rules:test:custom_test-esp32h2-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -1757,6 +1902,17 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-custom_test
|
||||
|
||||
.rules:test:custom_test-esp32s2-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-custom_test
|
||||
- <<: *if-label-custom_test_esp32s2
|
||||
- <<: *if-label-target_test
|
||||
|
||||
.rules:test:custom_test-esp32s2-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -1808,7 +1964,22 @@
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-custom_test
|
||||
- <<: *if-label-custom_test_esp32s3
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-custom_test
|
||||
|
||||
.rules:test:custom_test-esp32s3-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-custom_test
|
||||
- <<: *if-label-custom_test_esp32s3
|
||||
- <<: *if-label-target_test
|
||||
|
||||
.rules:test:custom_test-esp32s3-bt:
|
||||
rules:
|
||||
@ -1869,6 +2040,17 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-example_test
|
||||
|
||||
.rules:test:example_test-esp32-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-example_test
|
||||
- <<: *if-label-example_test_esp32
|
||||
- <<: *if-label-target_test
|
||||
|
||||
.rules:test:example_test-esp32-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -1937,6 +2119,17 @@
|
||||
when: never
|
||||
- <<: *if-label-example_test_esp32c2
|
||||
|
||||
.rules:test:example_test-esp32c2-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-example_test
|
||||
- <<: *if-label-example_test_esp32c2
|
||||
- <<: *if-label-target_test
|
||||
|
||||
.rules:test:example_test-esp32c2-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -2002,6 +2195,17 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-example_test
|
||||
|
||||
.rules:test:example_test-esp32c3-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-example_test
|
||||
- <<: *if-label-example_test_esp32c3
|
||||
- <<: *if-label-target_test
|
||||
|
||||
.rules:test:example_test-esp32c3-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -2076,6 +2280,17 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-example_test
|
||||
|
||||
.rules:test:example_test-esp32h2-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-example_test
|
||||
- <<: *if-label-example_test_esp32h2
|
||||
- <<: *if-label-target_test
|
||||
|
||||
.rules:test:example_test-esp32h2-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -2141,6 +2356,17 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-example_test
|
||||
|
||||
.rules:test:example_test-esp32s2-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-example_test
|
||||
- <<: *if-label-example_test_esp32s2
|
||||
- <<: *if-label-target_test
|
||||
|
||||
.rules:test:example_test-esp32s2-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -2198,7 +2424,24 @@
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-example_test
|
||||
- <<: *if-label-example_test_esp32s3
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-build-example_test
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-example_test
|
||||
|
||||
.rules:test:example_test-esp32s3-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-example_test
|
||||
- <<: *if-label-example_test_esp32s3
|
||||
- <<: *if-label-target_test
|
||||
|
||||
.rules:test:example_test-esp32s3-bt:
|
||||
rules:
|
||||
@ -2297,6 +2540,17 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-unit_test
|
||||
|
||||
.rules:test:unit_test-esp32-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-label-unit_test
|
||||
- <<: *if-label-unit_test_esp32
|
||||
|
||||
.rules:test:unit_test-esp32-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -2352,6 +2606,17 @@
|
||||
when: never
|
||||
- <<: *if-label-unit_test_esp32c2
|
||||
|
||||
.rules:test:unit_test-esp32c2-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-label-unit_test
|
||||
- <<: *if-label-unit_test_esp32c2
|
||||
|
||||
.rules:test:unit_test-esp32c2-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -2411,6 +2676,17 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-unit_test
|
||||
|
||||
.rules:test:unit_test-esp32c3-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-label-unit_test
|
||||
- <<: *if-label-unit_test_esp32c3
|
||||
|
||||
.rules:test:unit_test-esp32c3-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -2470,6 +2746,17 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-unit_test
|
||||
|
||||
.rules:test:unit_test-esp32h2-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-label-unit_test
|
||||
- <<: *if-label-unit_test_esp32h2
|
||||
|
||||
.rules:test:unit_test-esp32h2-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -2529,6 +2816,17 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-unit_test
|
||||
|
||||
.rules:test:unit_test-esp32s2-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-label-unit_test
|
||||
- <<: *if-label-unit_test_esp32s2
|
||||
|
||||
.rules:test:unit_test-esp32s2-bt:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@ -2582,6 +2880,21 @@
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-label-unit_test
|
||||
- <<: *if-label-unit_test_esp32s3
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-unit_test
|
||||
|
||||
.rules:test:unit_test-esp32s3-adc:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-label-unit_test
|
||||
- <<: *if-label-unit_test_esp32s3
|
||||
|
||||
.rules:test:unit_test-esp32s3-bt:
|
||||
|
@ -1,7 +1,7 @@
|
||||
# pre_check stage
|
||||
clang_tidy_check:
|
||||
extends:
|
||||
- .pre_check_base_template
|
||||
- .pre_check_template
|
||||
- .rules:patterns:clang_tidy
|
||||
image: ${CLANG_STATIC_ANALYSIS_IMAGE}
|
||||
artifacts:
|
||||
@ -14,7 +14,6 @@ clang_tidy_check:
|
||||
RULES_FILE: ${CI_PROJECT_DIR}/tools/ci/static-analysis-rules.yml
|
||||
OUTPUT_DIR: ${CI_PROJECT_DIR}/clang_tidy_reports
|
||||
script:
|
||||
- python -m pip install -U pip
|
||||
- internal_pip_install $CLANG_TIDY_RUNNER_PROJ pyclang
|
||||
- export PATH=$PATH:$(python -c "import sys; print(sys.executable.rsplit('/', 1)[0])")
|
||||
- dirs=$(cat ${CLANG_TIDY_DIRS_TXT} | while read line; do echo ${CI_PROJECT_DIR}/${line}; done | xargs)
|
||||
@ -26,7 +25,7 @@ clang_tidy_check:
|
||||
|
||||
check_pylint:
|
||||
extends:
|
||||
- .pre_check_base_template
|
||||
- .pre_check_template
|
||||
- .rules:patterns:python-files
|
||||
- .before_script_minimal
|
||||
image: $SONARQUBE_SCANNER_IMAGE
|
||||
|
@ -15,7 +15,6 @@
|
||||
.pytest_template:
|
||||
extends:
|
||||
- .target_test_template
|
||||
- .before_script_pytest
|
||||
artifacts:
|
||||
when: always
|
||||
paths:
|
||||
@ -221,6 +220,14 @@ component_ut_pytest_esp32_generic:
|
||||
- build_pytest_components_esp32
|
||||
tags: [ esp32, generic ]
|
||||
|
||||
component_ut_pytest_esp32_adc:
|
||||
extends:
|
||||
- .pytest_components_dir_template
|
||||
- .rules:test:component_ut-esp32-adc
|
||||
needs:
|
||||
- build_pytest_components_esp32
|
||||
tags: [ esp32, adc ]
|
||||
|
||||
component_ut_pytest_esp32_ip101:
|
||||
extends:
|
||||
- .pytest_components_dir_template
|
||||
@ -253,6 +260,14 @@ component_ut_pytest_esp32s2_generic:
|
||||
- build_pytest_components_esp32s2
|
||||
tags: [ esp32s2, generic ]
|
||||
|
||||
component_ut_pytest_esp32s2_adc:
|
||||
extends:
|
||||
- .pytest_components_dir_template
|
||||
- .rules:test:component_ut-esp32s2-adc
|
||||
needs:
|
||||
- build_pytest_components_esp32s2
|
||||
tags: [ esp32s2, adc ]
|
||||
|
||||
component_ut_pytest_esp32s3_generic:
|
||||
extends:
|
||||
- .pytest_components_dir_template
|
||||
@ -261,6 +276,14 @@ component_ut_pytest_esp32s3_generic:
|
||||
- build_pytest_components_esp32s3
|
||||
tags: [ esp32s3, generic ]
|
||||
|
||||
component_ut_pytest_esp32s3_adc:
|
||||
extends:
|
||||
- .pytest_components_dir_template
|
||||
- .rules:test:component_ut-esp32s3-adc
|
||||
needs:
|
||||
- build_pytest_components_esp32s3
|
||||
tags: [ esp32s3, adc ]
|
||||
|
||||
component_ut_pytest_esp32s3_octal_psram:
|
||||
extends:
|
||||
- .pytest_components_dir_template
|
||||
@ -293,6 +316,14 @@ component_ut_pytest_esp32c2_generic:
|
||||
- build_pytest_components_esp32c2
|
||||
tags: [ esp32c2, generic, xtal_40mhz ]
|
||||
|
||||
component_ut_pytest_esp32c2_adc:
|
||||
extends:
|
||||
- .pytest_components_dir_template
|
||||
- .rules:test:component_ut-esp32c2-adc
|
||||
needs:
|
||||
- build_pytest_components_esp32c2
|
||||
tags: [ esp32c2, adc ]
|
||||
|
||||
component_ut_pytest_esp32c2_xtal_26mhz:
|
||||
extends:
|
||||
- .pytest_components_dir_template
|
||||
@ -309,6 +340,14 @@ component_ut_pytest_esp32c3_generic:
|
||||
- build_pytest_components_esp32c3
|
||||
tags: [ esp32c3, generic ]
|
||||
|
||||
component_ut_pytest_esp32c3_adc:
|
||||
extends:
|
||||
- .pytest_components_dir_template
|
||||
- .rules:test:component_ut-esp32c3-adc
|
||||
needs:
|
||||
- build_pytest_components_esp32c3
|
||||
tags: [ esp32c3, adc ]
|
||||
|
||||
component_ut_pytest_esp32c3_flash_encryption:
|
||||
extends:
|
||||
- .pytest_components_dir_template
|
||||
@ -374,14 +413,6 @@ test_app_test_pytest_esp32c3_generic:
|
||||
- build_pytest_test_apps_esp32c3
|
||||
tags: [ esp32c3, generic ]
|
||||
|
||||
test_app_test_pytest_esp32s2_usb_host:
|
||||
extends:
|
||||
- .pytest_test_apps_dir_template
|
||||
- .rules:test:custom_test-esp32s2
|
||||
needs:
|
||||
- build_pytest_test_apps_esp32s2
|
||||
tags: [ esp32s2, usb_host ]
|
||||
|
||||
test_app_test_pytest_esp32s3_mspi_f8r8:
|
||||
extends:
|
||||
- .pytest_test_apps_dir_template
|
||||
@ -613,6 +644,12 @@ example_test_C3_GENERIC:
|
||||
- ESP32C3
|
||||
- Example_GENERIC
|
||||
|
||||
example_test_C2_GENERIC:
|
||||
extends: .example_test_esp32c2_template
|
||||
tags:
|
||||
- ESP32C2
|
||||
- Example_GENERIC
|
||||
|
||||
example_test_ESP32_SDSPI:
|
||||
extends: .example_test_esp32_template
|
||||
tags:
|
||||
@ -1026,8 +1063,9 @@ UT_S3_FLASH:
|
||||
extends:
|
||||
- .target_test_job_template
|
||||
- .rules:test:integration_test
|
||||
# needn't install idf python env
|
||||
- .before_script_integration_test
|
||||
- .before_script_minimal
|
||||
image: ${CI_INTEGRATION_TEST_ENV_IMAGE}
|
||||
cache: []
|
||||
needs: # the assign already needs all the build jobs
|
||||
- assign_integration_test
|
||||
variables:
|
||||
@ -1038,22 +1076,23 @@ UT_S3_FLASH:
|
||||
KNOWN_ISSUE_FILE: "${CI_PROJECT_DIR}/tools/ci/integration_test/KnownIssues"
|
||||
CI_RUNNER_SCRIPT: "${CI_PROJECT_DIR}/auto_test_script/bin/CIRunner.py"
|
||||
PREPARE_TEST_BIN_SCRIPT: "${CI_PROJECT_DIR}/tools/ci/integration_test/prepare_test_bins.py"
|
||||
PYTHONPATH: "${CI_PROJECT_DIR}/auto_test_script/packages:${PYTHONPATH}"
|
||||
PYTHONPATH: "${CI_PROJECT_DIR}/auto_test_script/packages:${CI_PROJECT_DIR}/tools/ci/python_packages:${PYTHONPATH}"
|
||||
INITIAL_CONDITION_RETRY_COUNT: "1"
|
||||
# auto_test_script only supports python 3.7.x
|
||||
PYTHON_VER: 3.7.7
|
||||
GIT_LFS_SKIP_SMUDGE: 1
|
||||
script:
|
||||
- *define_config_file_name
|
||||
# first test if config file exists, if not exist, exit 0
|
||||
- test -e $CONFIG_FILE || exit 0
|
||||
# clone local test env configs
|
||||
- add_gitlab_ssh_keys
|
||||
- retry_failed git clone $TEST_ENV_CONFIG_REPO
|
||||
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs
|
||||
# clone test bench
|
||||
# can not retry if downing git lfs files failed, so using empty_branch first.
|
||||
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} -b empty_branch
|
||||
- retry_failed git -C auto_test_script checkout -f ${CI_AUTO_TEST_SCRIPT_REPO_BRANCH}
|
||||
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script --customized_only
|
||||
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} auto_test_script
|
||||
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script
|
||||
- cd auto_test_script
|
||||
- ./tools/ci/setup_idfci.sh
|
||||
# Merge known issues
|
||||
- cat ${KNOWN_ISSUE_FILE} >> ${TEST_CASE_FILE_PATH}/KnownIssues
|
||||
# run test
|
||||
- python ${PREPARE_TEST_BIN_SCRIPT} $CONFIG_FILE
|
||||
@ -1080,20 +1119,16 @@ nvs_compatible_test:
|
||||
- *define_config_file_name
|
||||
# first test if config file exists, if not exist, exit 0
|
||||
- test -e $CONFIG_FILE || exit 0
|
||||
# prepare test utilities
|
||||
- source tools/ci/setup_python.sh
|
||||
- add_gitlab_ssh_keys
|
||||
- fetch_submodules
|
||||
# clone local test env configs
|
||||
- add_gitlab_ssh_keys
|
||||
- retry_failed git clone $TEST_ENV_CONFIG_REPO
|
||||
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs
|
||||
# clone test bench
|
||||
# can not retry if downing git lfs files failed, so using empty_branch first.
|
||||
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} -b empty_branch
|
||||
- retry_failed git -C auto_test_script checkout -f ${CI_AUTO_TEST_SCRIPT_REPO_BRANCH}
|
||||
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script --customized_only
|
||||
# prepare nvs bins
|
||||
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} auto_test_script
|
||||
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script
|
||||
- cd auto_test_script
|
||||
- ./tools/ci/setup_idfci.sh
|
||||
# prepare nvs bins
|
||||
- ./tools/prepare_nvs_bin.sh
|
||||
# run test
|
||||
- python ${PREPARE_TEST_BIN_SCRIPT} $CONFIG_FILE
|
||||
|
@ -9,6 +9,7 @@
|
||||
upload-pip-cache:
|
||||
extends:
|
||||
- .upload_cache_template
|
||||
- .before_script_minimal
|
||||
- .rules:patterns:python-cache
|
||||
tags:
|
||||
- $GEO
|
||||
@ -18,13 +19,9 @@ upload-pip-cache:
|
||||
paths:
|
||||
- .cache/pip
|
||||
policy: push
|
||||
before_script: []
|
||||
script:
|
||||
- source tools/ci/utils.sh
|
||||
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
|
||||
- source tools/ci/setup_python.sh
|
||||
- rm -rf .cache/pip # clear old packages
|
||||
- $IDF_PATH/tools/idf_tools.py install-python-env --features pytest,ci
|
||||
- bash install.sh --enable-ci --enable-pytest
|
||||
parallel:
|
||||
matrix:
|
||||
- GEO: [ 'shiny', 'brew' ]
|
||||
@ -32,6 +29,7 @@ upload-pip-cache:
|
||||
upload-submodules-cache:
|
||||
extends:
|
||||
- .upload_cache_template
|
||||
- .before_script_minimal
|
||||
- .rules:patterns:submodule
|
||||
tags:
|
||||
- $GEO
|
||||
@ -41,12 +39,11 @@ upload-submodules-cache:
|
||||
paths:
|
||||
- .cache/submodule_archives
|
||||
policy: push
|
||||
before_script: []
|
||||
script:
|
||||
- source tools/ci/utils.sh
|
||||
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
|
||||
- source tools/ci/setup_python.sh
|
||||
# use the default gitlab server
|
||||
- unset LOCAL_GITLAB_HTTPS_HOST
|
||||
- rm -rf .cache/submodule_archives # clear old submodule archives
|
||||
- add_gitlab_ssh_keys
|
||||
- fetch_submodules
|
||||
parallel:
|
||||
matrix:
|
||||
|
12
.gitmodules
vendored
12
.gitmodules
vendored
@ -47,14 +47,6 @@
|
||||
path = components/esp_wifi/lib
|
||||
url = ../../espressif/esp32-wifi-lib.git
|
||||
|
||||
[submodule "components/tinyusb/tinyusb"]
|
||||
path = components/tinyusb/tinyusb
|
||||
url = ../../espressif/tinyusb.git
|
||||
|
||||
[submodule "examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib"]
|
||||
path = examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib
|
||||
url = ../../espressif/esp-cryptoauthlib.git
|
||||
|
||||
[submodule "components/cmock/CMock"]
|
||||
path = components/cmock/CMock
|
||||
url = ../../ThrowTheSwitch/CMock.git
|
||||
@ -86,3 +78,7 @@
|
||||
[submodule "components/bt/controller/lib_esp32c2/esp32c2-bt-lib"]
|
||||
path = components/bt/controller/lib_esp32c2/esp32c2-bt-lib
|
||||
url = ../../espressif/esp32c2-bt-lib.git
|
||||
|
||||
[submodule "components/heap/tlsf"]
|
||||
path = components/heap/tlsf
|
||||
url = ../../espressif/tlsf.git
|
||||
|
@ -21,7 +21,8 @@ repos:
|
||||
.+test_idf_monitor\/tests\/.+|
|
||||
.*_pb2.py|
|
||||
.*.pb-c.h|
|
||||
.*.pb-c.c
|
||||
.*.pb-c.c|
|
||||
.*.yuv
|
||||
)$
|
||||
- id: end-of-file-fixer
|
||||
exclude: *whitespace_excludes
|
||||
@ -29,8 +30,8 @@ repos:
|
||||
- id: mixed-line-ending
|
||||
args: ['-f=lf']
|
||||
- id: double-quote-string-fixer
|
||||
- repo: https://gitlab.com/pycqa/flake8
|
||||
rev: 3.9.2
|
||||
- repo: https://github.com/PyCQA/flake8
|
||||
rev: 5.0.4
|
||||
hooks:
|
||||
- id: flake8
|
||||
args: ['--config=.flake8', '--tee', '--benchmark']
|
||||
|
1
Kconfig
1
Kconfig
@ -82,7 +82,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
||||
config IDF_TARGET_ESP32H2_BETA_VERSION_2
|
||||
bool
|
||||
prompt "ESP32-H2 beta2"
|
||||
select ESPTOOLPY_NO_STUB # TODO: IDF-4288
|
||||
endchoice
|
||||
|
||||
config IDF_TARGET_ESP32C2
|
||||
|
@ -42,7 +42,7 @@ This can also contain files provided by the architecture vendor.
|
||||
Example:
|
||||
|
||||
- `xt_set_exception_handler`
|
||||
- `riscv_global_interrupts_enable`
|
||||
- `rv_utils_intr_enable`
|
||||
- `ERI_PERFMON_MAX`
|
||||
|
||||
#### `esp_common`
|
||||
|
@ -1,30 +1,7 @@
|
||||
idf_component_register(SRCS "esp_ota_ops.c"
|
||||
"esp_app_desc.c"
|
||||
idf_component_register(SRCS "esp_ota_ops.c" "esp_ota_app_desc.c"
|
||||
INCLUDE_DIRS "include"
|
||||
REQUIRES spi_flash partition_table bootloader_support
|
||||
PRIV_REQUIRES esptool_py efuse)
|
||||
|
||||
# esp_app_desc structure is added as an undefined symbol because otherwise the
|
||||
# linker will ignore this structure as it has no other files depending on it.
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u esp_app_desc")
|
||||
|
||||
if(CONFIG_APP_PROJECT_VER_FROM_CONFIG)
|
||||
# Ignore current PROJECT_VER (which was set in __project_get_revision()).
|
||||
# Gets the version from the CONFIG_APP_PROJECT_VER.
|
||||
idf_build_set_property(PROJECT_VER "${CONFIG_APP_PROJECT_VER}")
|
||||
endif()
|
||||
|
||||
# cut PROJECT_VER and PROJECT_NAME to required 32 characters.
|
||||
idf_build_get_property(project_ver PROJECT_VER)
|
||||
idf_build_get_property(project_name PROJECT_NAME)
|
||||
string(SUBSTRING "${project_ver}" 0 31 PROJECT_VER_CUT)
|
||||
string(SUBSTRING "${project_name}" 0 31 PROJECT_NAME_CUT)
|
||||
message(STATUS "App \"${PROJECT_NAME_CUT}\" version: ${PROJECT_VER_CUT}")
|
||||
|
||||
set_source_files_properties(
|
||||
SOURCE "esp_app_desc.c"
|
||||
PROPERTIES COMPILE_DEFINITIONS
|
||||
"PROJECT_VER=\"${PROJECT_VER_CUT}\"; PROJECT_NAME=\"${PROJECT_NAME_CUT}\"")
|
||||
REQUIRES partition_table bootloader_support esp_app_format esp_partition
|
||||
PRIV_REQUIRES esptool_py efuse spi_flash)
|
||||
|
||||
if(NOT BOOTLOADER_BUILD)
|
||||
partition_table_get_partition_info(otadata_offset "--partition-type data --partition-subtype ota" "offset")
|
||||
|
21
components/app_update/esp_ota_app_desc.c
Normal file
21
components/app_update/esp_ota_app_desc.c
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <sys/param.h>
|
||||
#include "esp_ota_ops.h"
|
||||
#include "esp_attr.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
const esp_app_desc_t *esp_ota_get_app_description(void)
|
||||
{
|
||||
return esp_app_get_description();
|
||||
}
|
||||
|
||||
int IRAM_ATTR esp_ota_get_app_elf_sha256(char* dst, size_t size)
|
||||
{
|
||||
return esp_app_get_elf_sha256(dst, size);
|
||||
}
|
@ -14,7 +14,6 @@
|
||||
|
||||
#include "esp_err.h"
|
||||
#include "esp_partition.h"
|
||||
#include "spi_flash_mmap.h"
|
||||
#include "esp_image_format.h"
|
||||
#include "esp_secure_boot.h"
|
||||
#include "esp_flash_encrypt.h"
|
||||
@ -84,16 +83,16 @@ static const esp_partition_t *read_otadata(esp_ota_select_entry_t *two_otadata)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
spi_flash_mmap_handle_t ota_data_map;
|
||||
esp_partition_mmap_handle_t ota_data_map;
|
||||
const void *result = NULL;
|
||||
esp_err_t err = esp_partition_mmap(otadata_partition, 0, otadata_partition->size, SPI_FLASH_MMAP_DATA, &result, &ota_data_map);
|
||||
esp_err_t err = esp_partition_mmap(otadata_partition, 0, otadata_partition->size, ESP_PARTITION_MMAP_DATA, &result, &ota_data_map);
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "mmap otadata filed. Err=0x%8x", err);
|
||||
return NULL;
|
||||
} else {
|
||||
memcpy(&two_otadata[0], result, sizeof(esp_ota_select_entry_t));
|
||||
memcpy(&two_otadata[1], result + SPI_FLASH_SEC_SIZE, sizeof(esp_ota_select_entry_t));
|
||||
spi_flash_munmap(ota_data_map);
|
||||
esp_partition_munmap(ota_data_map);
|
||||
}
|
||||
return otadata_partition;
|
||||
}
|
||||
@ -651,8 +650,14 @@ esp_err_t esp_ota_get_partition_description(const esp_partition_t *partition, es
|
||||
|
||||
#ifdef CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK
|
||||
static esp_err_t esp_ota_set_anti_rollback(void) {
|
||||
const esp_app_desc_t *app_desc = esp_ota_get_app_description();
|
||||
return esp_efuse_update_secure_version(app_desc->secure_version);
|
||||
const esp_partition_t* partition = esp_ota_get_running_partition();
|
||||
esp_app_desc_t app_desc = {0};
|
||||
|
||||
esp_err_t err = esp_ota_get_partition_description(partition, &app_desc);
|
||||
if (err == ESP_OK) {
|
||||
return esp_efuse_update_secure_version(app_desc.secure_version);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <stddef.h>
|
||||
#include "esp_err.h"
|
||||
#include "esp_partition.h"
|
||||
#include "esp_image_format.h"
|
||||
#include "esp_app_desc.h"
|
||||
#include "esp_flash_partitions.h"
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
@ -44,20 +44,27 @@ typedef uint32_t esp_ota_handle_t;
|
||||
/**
|
||||
* @brief Return esp_app_desc structure. This structure includes app version.
|
||||
*
|
||||
* @note This API is present for backward compatibility reasons. Alternative function
|
||||
* with the same functionality is `esp_app_get_description`
|
||||
*
|
||||
* Return description for running app.
|
||||
* @return Pointer to esp_app_desc structure.
|
||||
*/
|
||||
const esp_app_desc_t *esp_ota_get_app_description(void);
|
||||
const esp_app_desc_t *esp_ota_get_app_description(void) __attribute__((deprecated("Please use esp_app_get_description instead")));
|
||||
|
||||
/**
|
||||
* @brief Fill the provided buffer with SHA256 of the ELF file, formatted as hexadecimal, null-terminated.
|
||||
* If the buffer size is not sufficient to fit the entire SHA256 in hex plus a null terminator,
|
||||
* the largest possible number of bytes will be written followed by a null.
|
||||
*
|
||||
* @note This API is present for backward compatibility reasons. Alternative function
|
||||
* with the same functionality is `esp_app_get_elf_sha256`
|
||||
*
|
||||
* @param dst Destination buffer
|
||||
* @param size Size of the buffer
|
||||
* @return Number of bytes written to dst (including null terminator)
|
||||
*/
|
||||
int esp_ota_get_app_elf_sha256(char* dst, size_t size);
|
||||
int esp_ota_get_app_elf_sha256(char* dst, size_t size) __attribute__((deprecated("Please use esp_app_get_elf_sha256 instead")));
|
||||
|
||||
/**
|
||||
* @brief Commence an OTA update writing to the specified partition.
|
||||
|
@ -1,5 +1,5 @@
|
||||
idf_component_register(SRC_DIRS "."
|
||||
PRIV_INCLUDE_DIRS "."
|
||||
PRIV_REQUIRES cmock test_utils app_update bootloader_support nvs_flash driver
|
||||
PRIV_REQUIRES cmock test_utils app_update bootloader_support nvs_flash driver spi_flash
|
||||
)
|
||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -13,7 +13,6 @@
|
||||
#include <unity.h>
|
||||
#include <test_utils.h>
|
||||
#include <esp_ota_ops.h>
|
||||
#include "bootloader_common.h"
|
||||
|
||||
/* These OTA tests currently don't assume an OTA partition exists
|
||||
on the device, so they're a bit limited
|
||||
@ -91,6 +90,8 @@ TEST_CASE("esp_ota_get_next_update_partition logic", "[ota]")
|
||||
|
||||
TEST_CASE("esp_ota_get_partition_description", "[ota]")
|
||||
{
|
||||
extern esp_err_t bootloader_common_get_partition_description(const esp_partition_pos_t *partition, esp_app_desc_t *app_desc);
|
||||
|
||||
const esp_partition_t *running = esp_ota_get_running_partition();
|
||||
TEST_ASSERT_NOT_NULL(running);
|
||||
esp_app_desc_t app_desc1, app_desc2;
|
||||
|
@ -366,7 +366,7 @@ menu "Bootloader config"
|
||||
# only available if both Secure Boot and Check Signature on Boot are disabled
|
||||
depends on !SECURE_SIGNED_ON_BOOT
|
||||
default n
|
||||
select BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP
|
||||
select BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP if SOC_RTC_FAST_MEM_SUPPORTED
|
||||
select BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON
|
||||
help
|
||||
Selecting this option prevents the bootloader from ever validating the app image before
|
||||
|
@ -19,7 +19,7 @@ set(srcs
|
||||
if(BOOTLOADER_BUILD)
|
||||
set(include_dirs "include" "bootloader_flash/include"
|
||||
"private_include")
|
||||
set(priv_requires micro-ecc spi_flash efuse)
|
||||
set(priv_requires micro-ecc spi_flash efuse esp_app_format)
|
||||
list(APPEND srcs
|
||||
"src/bootloader_init.c"
|
||||
"src/bootloader_clock_loader.c"
|
||||
@ -37,7 +37,7 @@ else()
|
||||
set(include_dirs "include" "bootloader_flash/include")
|
||||
set(priv_include_dirs "private_include")
|
||||
# heap is required for `heap_memory_layout.h` header
|
||||
set(priv_requires spi_flash mbedtls efuse app_update heap)
|
||||
set(priv_requires spi_flash mbedtls efuse heap esp_app_format)
|
||||
endif()
|
||||
|
||||
if(BOOTLOADER_BUILD)
|
||||
@ -86,6 +86,15 @@ idf_component_register(SRCS "${srcs}"
|
||||
REQUIRES "${requires}"
|
||||
PRIV_REQUIRES "${priv_requires}")
|
||||
|
||||
if(NOT BOOTLOADER_BUILD)
|
||||
if(CONFIG_SECURE_SIGNED_ON_UPDATE)
|
||||
if(CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME OR CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME OR
|
||||
CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME)
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE idf::app_update)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_SECURE_SIGNED_APPS AND (CONFIG_SECURE_BOOT_V1_ENABLED OR CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME))
|
||||
if(BOOTLOADER_BUILD)
|
||||
# Whether CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES or not, we need verification key to embed
|
||||
|
@ -7,7 +7,6 @@
|
||||
#pragma once
|
||||
#include "esp_flash_partitions.h"
|
||||
#include "esp_image_format.h"
|
||||
#include "esp_app_format.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -151,20 +150,6 @@ int bootloader_common_get_active_otadata(esp_ota_select_entry_t *two_otadata);
|
||||
*/
|
||||
int bootloader_common_select_otadata(const esp_ota_select_entry_t *two_otadata, bool *valid_two_otadata, bool max);
|
||||
|
||||
/**
|
||||
* @brief Returns esp_app_desc structure for app partition. This structure includes app version.
|
||||
*
|
||||
* Returns a description for the requested app partition.
|
||||
* @param[in] partition App partition description.
|
||||
* @param[out] app_desc Structure of info about app.
|
||||
* @return
|
||||
* - ESP_OK: Successful.
|
||||
* - ESP_ERR_INVALID_ARG: The arguments passed are not valid.
|
||||
* - ESP_ERR_NOT_FOUND: app_desc structure is not found. Magic word is incorrect.
|
||||
* - ESP_FAIL: mapping is fail.
|
||||
*/
|
||||
esp_err_t bootloader_common_get_partition_description(const esp_partition_pos_t *partition, esp_app_desc_t *app_desc);
|
||||
|
||||
/**
|
||||
* @brief Get chip package
|
||||
*
|
||||
|
@ -106,25 +106,3 @@ typedef struct {
|
||||
} esp_image_segment_header_t;
|
||||
|
||||
#define ESP_IMAGE_MAX_SEGMENTS 16 /*!< Max count of segments in the image. */
|
||||
|
||||
#define ESP_APP_DESC_MAGIC_WORD 0xABCD5432 /*!< The magic word for the esp_app_desc structure that is in DROM. */
|
||||
|
||||
/**
|
||||
* @brief Description about application.
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t magic_word; /*!< Magic word ESP_APP_DESC_MAGIC_WORD */
|
||||
uint32_t secure_version; /*!< Secure version */
|
||||
uint32_t reserv1[2]; /*!< reserv1 */
|
||||
char version[32]; /*!< Application version */
|
||||
char project_name[32]; /*!< Project name */
|
||||
char time[16]; /*!< Compile time */
|
||||
char date[16]; /*!< Compile date*/
|
||||
char idf_ver[32]; /*!< Version IDF */
|
||||
uint8_t app_elf_sha256[32]; /*!< sha256 of elf file */
|
||||
uint32_t reserv2[20]; /*!< reserv2 */
|
||||
} esp_app_desc_t;
|
||||
|
||||
/** @cond */
|
||||
_Static_assert(sizeof(esp_app_desc_t) == 256, "esp_app_desc_t should be 256 bytes");
|
||||
/** @endcond */
|
||||
|
@ -42,13 +42,6 @@ __attribute__((weak)) void bootloader_clock_configure(void)
|
||||
|
||||
if (esp_rom_get_reset_reason(0) != RESET_REASON_CPU0_SW || rtc_clk_apb_freq_get() < APB_CLK_FREQ) {
|
||||
rtc_clk_config_t clk_cfg = RTC_CLK_CONFIG_DEFAULT();
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
clk_cfg.xtal_freq = CONFIG_ESP32_XTAL_FREQ;
|
||||
#endif
|
||||
#if CONFIG_IDF_TARGET_ESP32C2
|
||||
clk_cfg.xtal_freq = CONFIG_ESP32C2_XTAL_FREQ;
|
||||
#endif
|
||||
/* For other chips, there is no XTAL_FREQ choice */
|
||||
clk_cfg.cpu_freq_mhz = cpu_freq_mhz;
|
||||
clk_cfg.slow_clk_src = rtc_clk_slow_src_get();
|
||||
if (clk_cfg.slow_clk_src == SOC_RTC_SLOW_CLK_SRC_INVALID) {
|
||||
|
@ -112,30 +112,6 @@ int bootloader_common_select_otadata(const esp_ota_select_entry_t *two_otadata,
|
||||
return active_otadata;
|
||||
}
|
||||
|
||||
esp_err_t bootloader_common_get_partition_description(const esp_partition_pos_t *partition, esp_app_desc_t *app_desc)
|
||||
{
|
||||
if (partition == NULL || app_desc == NULL || partition->offset == 0) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
const uint32_t app_desc_offset = sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t);
|
||||
const uint32_t mmap_size = app_desc_offset + sizeof(esp_app_desc_t);
|
||||
const uint8_t *image = bootloader_mmap(partition->offset, mmap_size);
|
||||
if (image == NULL) {
|
||||
ESP_LOGE(TAG, "bootloader_mmap(0x%x, 0x%x) failed", partition->offset, mmap_size);
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
memcpy(app_desc, image + app_desc_offset, sizeof(esp_app_desc_t));
|
||||
bootloader_munmap(image);
|
||||
|
||||
if (app_desc->magic_word != ESP_APP_DESC_MAGIC_WORD) {
|
||||
return ESP_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
#if defined( CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP ) || defined( CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC )
|
||||
|
||||
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_HIGH - sizeof(rtc_retain_mem_t))
|
||||
@ -162,7 +138,7 @@ static void update_rtc_retain_mem_crc(void)
|
||||
rtc_retain_mem->crc = esp_rom_crc32_le(UINT32_MAX, (uint8_t*)rtc_retain_mem, sizeof(rtc_retain_mem_t) - sizeof(rtc_retain_mem->crc));
|
||||
}
|
||||
|
||||
void bootloader_common_reset_rtc_retain_mem(void)
|
||||
NOINLINE_ATTR void bootloader_common_reset_rtc_retain_mem(void)
|
||||
{
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
|
@ -41,7 +41,10 @@ esp_err_t bootloader_read_bootloader_header(void)
|
||||
|
||||
esp_err_t bootloader_check_bootloader_validity(void)
|
||||
{
|
||||
ESP_LOGI(TAG, "chip revision: V%03d", efuse_hal_chip_revision());
|
||||
unsigned int revision = efuse_hal_chip_revision();
|
||||
unsigned int major = revision / 100;
|
||||
unsigned int minor = revision % 100;
|
||||
ESP_LOGI(TAG, "chip revision: v%d.%d", major, minor);
|
||||
/* compare with the one set in bootloader image header */
|
||||
if (bootloader_common_check_chip_validity(&bootloader_image_hdr, ESP_IMAGE_BOOTLOADER) != ESP_OK) {
|
||||
return ESP_FAIL;
|
||||
|
@ -12,7 +12,11 @@
|
||||
|
||||
void __assert_func(const char *file, int line, const char *func, const char *expr)
|
||||
{
|
||||
|
||||
#if !CONFIG_OPTIMIZATION_ASSERTIONS_SILENT
|
||||
esp_rom_printf("Assert failed in %s, %s:%d (%s)\r\n", func, file, line, expr);
|
||||
#endif
|
||||
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
@ -60,6 +60,7 @@
|
||||
|
||||
#include "esp_cpu.h"
|
||||
#include "esp_image_format.h"
|
||||
#include "esp_app_desc.h"
|
||||
#include "esp_secure_boot.h"
|
||||
#include "esp_flash_encrypt.h"
|
||||
#include "esp_flash_partitions.h"
|
||||
@ -119,6 +120,31 @@ static esp_err_t read_otadata(const esp_partition_pos_t *ota_info, esp_ota_selec
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t bootloader_common_get_partition_description(const esp_partition_pos_t *partition, esp_app_desc_t *app_desc)
|
||||
{
|
||||
if (partition == NULL || app_desc == NULL || partition->offset == 0) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
const uint32_t app_desc_offset = sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t);
|
||||
const uint32_t mmap_size = app_desc_offset + sizeof(esp_app_desc_t);
|
||||
const uint8_t *image = bootloader_mmap(partition->offset, mmap_size);
|
||||
if (image == NULL) {
|
||||
ESP_LOGE(TAG, "bootloader_mmap(0x%x, 0x%x) failed", partition->offset, mmap_size);
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
memcpy(app_desc, image + app_desc_offset, sizeof(esp_app_desc_t));
|
||||
bootloader_munmap(image);
|
||||
|
||||
if (app_desc->magic_word != ESP_APP_DESC_MAGIC_WORD) {
|
||||
return ESP_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
|
||||
bool bootloader_utility_load_partition_table(bootloader_state_t *bs)
|
||||
{
|
||||
const esp_partition_info_t *partitions;
|
||||
|
@ -36,6 +36,8 @@
|
||||
#include "esp32c2/rom/secure_boot.h"
|
||||
#endif
|
||||
|
||||
#define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1))
|
||||
|
||||
/* Checking signatures as part of verifying images is necessary:
|
||||
- Always if secure boot is enabled
|
||||
- Differently in bootloader and/or app, depending on kconfig
|
||||
@ -107,7 +109,7 @@ static esp_err_t verify_segment_header(int index, const esp_image_segment_header
|
||||
while(0)
|
||||
|
||||
static esp_err_t process_image_header(esp_image_metadata_t *data, uint32_t part_offset, bootloader_sha256_handle_t *sha_handle, bool do_verify, bool silent);
|
||||
static esp_err_t process_appended_hash(esp_image_metadata_t *data, uint32_t part_len, bool do_verify, bool silent);
|
||||
static esp_err_t process_appended_hash_and_sig(esp_image_metadata_t *data, uint32_t part_offset, uint32_t part_len, bool do_verify, bool silent);
|
||||
static esp_err_t process_checksum(bootloader_sha256_handle_t sha_handle, uint32_t checksum_word, esp_image_metadata_t *data, bool silent, bool skip_check_checksum);
|
||||
|
||||
static esp_err_t __attribute__((unused)) verify_secure_boot_signature(bootloader_sha256_handle_t sha_handle, esp_image_metadata_t *data, uint8_t *image_digest, uint8_t *verified_digest);
|
||||
@ -159,7 +161,7 @@ static esp_err_t image_load(esp_image_load_mode_t mode, const esp_partition_pos_
|
||||
CHECK_ERR(process_segments(data, silent, do_load, sha_handle, checksum));
|
||||
bool skip_check_checksum = !do_verify || esp_cpu_dbgr_is_attached();
|
||||
CHECK_ERR(process_checksum(sha_handle, checksum_word, data, silent, skip_check_checksum));
|
||||
CHECK_ERR(process_appended_hash(data, part->size, do_verify, silent));
|
||||
CHECK_ERR(process_appended_hash_and_sig(data, part->offset, part->size, do_verify, silent));
|
||||
if (verify_sha) {
|
||||
#if (SECURE_BOOT_CHECK_SIGNATURE == 1)
|
||||
// secure boot images have a signature appended
|
||||
@ -299,7 +301,7 @@ esp_err_t esp_image_get_metadata(const esp_partition_pos_t *part, esp_image_meta
|
||||
CHECK_ERR(process_segments(metadata, silent, do_load, NULL, NULL));
|
||||
bool skip_check_checksum = true;
|
||||
CHECK_ERR(process_checksum(NULL, 0, metadata, silent, skip_check_checksum));
|
||||
CHECK_ERR(process_appended_hash(metadata, part->size, true, silent));
|
||||
CHECK_ERR(process_appended_hash_and_sig(metadata, part->offset, part->size, true, silent));
|
||||
return ESP_OK;
|
||||
err:
|
||||
return err;
|
||||
@ -762,7 +764,7 @@ esp_err_t esp_image_verify_bootloader_data(esp_image_metadata_t *data)
|
||||
data);
|
||||
}
|
||||
|
||||
static esp_err_t process_appended_hash(esp_image_metadata_t *data, uint32_t part_len, bool do_verify, bool silent)
|
||||
static esp_err_t process_appended_hash_and_sig(esp_image_metadata_t *data, uint32_t part_offset, uint32_t part_len, bool do_verify, bool silent)
|
||||
{
|
||||
esp_err_t err = ESP_OK;
|
||||
if (data->image.hash_appended) {
|
||||
@ -773,8 +775,34 @@ static esp_err_t process_appended_hash(esp_image_metadata_t *data, uint32_t part
|
||||
data->image_len += HASH_LEN;
|
||||
}
|
||||
|
||||
if (data->image_len > part_len) {
|
||||
FAIL_LOAD("Image length %d doesn't fit in partition length %d", data->image_len, part_len);
|
||||
uint32_t sig_block_len = 0;
|
||||
const uint32_t end = data->image_len;
|
||||
#if CONFIG_SECURE_BOOT || CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT
|
||||
|
||||
// Case I: Bootloader part
|
||||
if (part_offset == ESP_BOOTLOADER_OFFSET) {
|
||||
// For bootloader with secure boot v1, signature stays in an independant flash
|
||||
// sector (offset 0x0) and does not get appended to the image.
|
||||
#if CONFIG_SECURE_BOOT_V2_ENABLED
|
||||
// Sanity check - secure boot v2 signature block starts on 4K boundary
|
||||
sig_block_len = ALIGN_UP(end, FLASH_SECTOR_SIZE) - end;
|
||||
sig_block_len += sizeof(ets_secure_boot_signature_t);
|
||||
#endif
|
||||
} else {
|
||||
// Case II: Application part
|
||||
#if CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME
|
||||
sig_block_len = sizeof(esp_secure_boot_sig_block_t);
|
||||
#else
|
||||
// Sanity check - secure boot v2 signature block starts on 4K boundary
|
||||
sig_block_len = ALIGN_UP(end, FLASH_SECTOR_SIZE) - end;
|
||||
sig_block_len += sizeof(ets_secure_boot_signature_t);
|
||||
#endif
|
||||
}
|
||||
#endif // CONFIG_SECURE_BOOT || CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT
|
||||
|
||||
const uint32_t full_image_len = end + sig_block_len;
|
||||
if (full_image_len > part_len) {
|
||||
FAIL_LOAD("Image length %d doesn't fit in partition length %d", full_image_len, part_len);
|
||||
}
|
||||
return err;
|
||||
err:
|
||||
@ -835,7 +863,7 @@ static esp_err_t verify_secure_boot_signature(bootloader_sha256_handle_t sha_han
|
||||
#if CONFIG_SECURE_BOOT_V2_ENABLED
|
||||
// End of the image needs to be padded all the way to a 4KB boundary, after the simple hash
|
||||
// (for apps they are usually already padded due to --secure-pad-v2, only a problem if this option was not used.)
|
||||
uint32_t padded_end = (end + FLASH_SECTOR_SIZE - 1) & ~(FLASH_SECTOR_SIZE-1);
|
||||
uint32_t padded_end = ALIGN_UP(end, FLASH_SECTOR_SIZE);
|
||||
if (padded_end > end) {
|
||||
const void *padding = bootloader_mmap(end, padded_end - end);
|
||||
bootloader_sha256_data(sha_handle, padding, padded_end - end);
|
||||
|
@ -218,16 +218,7 @@ static void btc_thread_handler(void *arg)
|
||||
|
||||
static bt_status_t btc_task_post(btc_msg_t *msg, uint32_t timeout)
|
||||
{
|
||||
btc_msg_t *lmsg;
|
||||
|
||||
lmsg = (btc_msg_t *)osi_malloc(sizeof(btc_msg_t));
|
||||
if (lmsg == NULL) {
|
||||
return BT_STATUS_NOMEM;
|
||||
}
|
||||
|
||||
memcpy(lmsg, msg, sizeof(btc_msg_t));
|
||||
|
||||
if (osi_thread_post(btc_thread, btc_thread_handler, lmsg, 0, timeout) == false) {
|
||||
if (osi_thread_post(btc_thread, btc_thread_handler, msg, 0, timeout) == false) {
|
||||
return BT_STATUS_BUSY;
|
||||
}
|
||||
|
||||
@ -245,30 +236,37 @@ static bt_status_t btc_task_post(btc_msg_t *msg, uint32_t timeout)
|
||||
*/
|
||||
bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg_deep_copy_t copy_func)
|
||||
{
|
||||
btc_msg_t lmsg;
|
||||
btc_msg_t* lmsg;
|
||||
|
||||
if (msg == NULL) {
|
||||
// arg XOR arg_len
|
||||
if ((msg == NULL) || ((arg == NULL) == !(arg_len == 0))) {
|
||||
return BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
|
||||
BTC_TRACE_DEBUG("%s msg %u %u %u %p\n", __func__, msg->sig, msg->pid, msg->act, arg);
|
||||
|
||||
memcpy(&lmsg, msg, sizeof(btc_msg_t));
|
||||
if (arg) {
|
||||
lmsg.arg = (void *)osi_malloc(arg_len);
|
||||
if (lmsg.arg == NULL) {
|
||||
return BT_STATUS_NOMEM;
|
||||
}
|
||||
memset(lmsg.arg, 0x00, arg_len); //important, avoid arg which have no length
|
||||
memcpy(lmsg.arg, arg, arg_len);
|
||||
if (copy_func) {
|
||||
copy_func(&lmsg, lmsg.arg, arg);
|
||||
}
|
||||
} else {
|
||||
lmsg.arg = NULL;
|
||||
lmsg = (btc_msg_t *)osi_malloc(sizeof(btc_msg_t));
|
||||
if (lmsg == NULL) {
|
||||
return BT_STATUS_NOMEM;
|
||||
}
|
||||
|
||||
return btc_task_post(&lmsg, OSI_THREAD_MAX_TIMEOUT);
|
||||
memcpy(lmsg, msg, sizeof(btc_msg_t));
|
||||
if (arg) {
|
||||
lmsg->arg = (void *)osi_malloc(arg_len);
|
||||
if (lmsg->arg == NULL) {
|
||||
osi_free(lmsg);
|
||||
return BT_STATUS_NOMEM;
|
||||
}
|
||||
memset(lmsg->arg, 0x00, arg_len); //important, avoid arg which have no length
|
||||
memcpy(lmsg->arg, arg, arg_len);
|
||||
if (copy_func) {
|
||||
copy_func(lmsg, lmsg->arg, arg);
|
||||
}
|
||||
} else {
|
||||
lmsg->arg = NULL;
|
||||
}
|
||||
|
||||
return btc_task_post(lmsg, OSI_THREAD_MAX_TIMEOUT);
|
||||
|
||||
}
|
||||
|
||||
|
@ -61,6 +61,13 @@
|
||||
#define EXT_FUNC_VERSION 0x20220125
|
||||
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
|
||||
|
||||
#define BT_ASSERT_PRINT ets_printf
|
||||
|
||||
#ifdef CONFIG_BT_BLUEDROID_ENABLED
|
||||
/* ACL_DATA_MBUF_LEADINGSPCAE: The leadingspace in user info header for ACL data */
|
||||
#define ACL_DATA_MBUF_LEADINGSPCAE 4
|
||||
#endif
|
||||
|
||||
/* Types definition
|
||||
************************************************************************
|
||||
*/
|
||||
@ -125,6 +132,8 @@ extern int ble_sm_alg_gen_dhkey(const uint8_t *peer_pub_key_x,
|
||||
const uint8_t *peer_pub_key_y,
|
||||
const uint8_t *our_priv_key, uint8_t *out_dhkey);
|
||||
extern int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv);
|
||||
extern int ble_txpwr_set(esp_ble_enhanced_power_type_t power_type, uint16_t handle, int power_level);
|
||||
extern int ble_txpwr_get(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
|
||||
|
||||
/* Local Function Declaration
|
||||
*********************************************************************
|
||||
@ -163,6 +172,8 @@ static DRAM_ATTR bool s_btdm_allow_light_sleep;
|
||||
// pm_lock to prevent light sleep when using main crystal as Bluetooth low power clock
|
||||
static DRAM_ATTR esp_pm_lock_handle_t s_light_sleep_pm_lock;
|
||||
#define BTDM_MIN_TIMER_UNCERTAINTY_US (200)
|
||||
#else
|
||||
static bool s_bt_phy_enabled = false;
|
||||
#endif /* #ifdef CONFIG_PM_ENABLE */
|
||||
|
||||
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
|
||||
@ -175,6 +186,7 @@ static void btdm_slp_tmr_callback(void *arg);
|
||||
static DRAM_ATTR esp_timer_handle_t s_btdm_slp_tmr = NULL;
|
||||
#endif
|
||||
|
||||
|
||||
static const struct osi_coex_funcs_t s_osi_coex_funcs_ro = {
|
||||
._magic = OSI_COEX_MAGIC_VALUE,
|
||||
._version = OSI_COEX_VERSION,
|
||||
@ -215,7 +227,7 @@ static void IRAM_ATTR esp_reset_rpa_moudle(void)
|
||||
|
||||
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2)
|
||||
{
|
||||
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "BLE assert: line %d in function %s, param: 0x%x, 0x%x", ln, fn, param1, param2);
|
||||
BT_ASSERT_PRINT("BLE assert: line %d in function %s, param: 0x%x, 0x%x", ln, fn, param1, param2);
|
||||
assert(0);
|
||||
}
|
||||
|
||||
@ -238,6 +250,7 @@ static void coex_schm_status_bit_clear_wrapper(uint32_t type, uint32_t status)
|
||||
#endif
|
||||
}
|
||||
#ifdef CONFIG_BT_BLUEDROID_ENABLED
|
||||
|
||||
bool esp_vhci_host_check_send_available(void)
|
||||
{
|
||||
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
|
||||
@ -295,11 +308,9 @@ void esp_vhci_host_send_packet(uint8_t *data, uint16_t len)
|
||||
}
|
||||
|
||||
if (*(data) == DATA_TYPE_ACL) {
|
||||
struct os_mbuf *om = os_msys_get_pkthdr(0, 0);
|
||||
struct os_mbuf *om = os_msys_get_pkthdr(len, ACL_DATA_MBUF_LEADINGSPCAE);
|
||||
assert(om);
|
||||
memcpy(om->om_data, &data[1], len - 1);
|
||||
om->om_len = len - 1;
|
||||
OS_MBUF_PKTHDR(om)->omp_len = len - 1;
|
||||
os_mbuf_append(om, &data[1], len - 1);
|
||||
ble_hci_trans_hs_acl_tx(om);
|
||||
}
|
||||
|
||||
@ -421,7 +432,8 @@ IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
|
||||
esp_pm_lock_release(s_pm_lock);
|
||||
s_pm_lock_acquired = false;
|
||||
}
|
||||
|
||||
#else
|
||||
s_bt_phy_enabled = false;
|
||||
#endif // CONFIG_PM_ENABLE
|
||||
}
|
||||
|
||||
@ -435,6 +447,8 @@ IRAM_ATTR void controller_wakeup_cb(void *arg)
|
||||
s_pm_lock_acquired = true;
|
||||
esp_pm_lock_acquire(s_pm_lock);
|
||||
}
|
||||
#else
|
||||
s_bt_phy_enabled = true;
|
||||
#endif //CONFIG_PM_ENABLE
|
||||
}
|
||||
|
||||
@ -458,6 +472,8 @@ void controller_sleep_init(void)
|
||||
|
||||
#ifdef CONFIG_PM_ENABLE
|
||||
s_btdm_allow_light_sleep = false;
|
||||
#else
|
||||
s_bt_phy_enabled = true;
|
||||
#endif // CONFIG_PM_ENABLE
|
||||
|
||||
#ifdef CONFIG_BT_LE_SLEEP_ENABLE
|
||||
@ -540,8 +556,21 @@ void controller_sleep_deinit(void)
|
||||
#ifdef CONFIG_PM_ENABLE
|
||||
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
|
||||
r_ble_rtc_wake_up_state_clr();
|
||||
esp_sleep_disable_bt_wakeup();
|
||||
#endif
|
||||
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_AUTO);
|
||||
|
||||
/*lock should release first and then delete*/
|
||||
if (s_pm_lock_acquired) {
|
||||
if (s_light_sleep_pm_lock != NULL) {
|
||||
esp_pm_lock_release(s_light_sleep_pm_lock);
|
||||
}
|
||||
|
||||
if (s_pm_lock != NULL) {
|
||||
esp_pm_lock_release(s_pm_lock);
|
||||
}
|
||||
}
|
||||
|
||||
if (!s_btdm_allow_light_sleep) {
|
||||
if (s_light_sleep_pm_lock != NULL) {
|
||||
esp_pm_lock_delete(s_light_sleep_pm_lock);
|
||||
@ -559,7 +588,15 @@ void controller_sleep_deinit(void)
|
||||
s_btdm_slp_tmr = NULL;
|
||||
}
|
||||
#endif
|
||||
s_pm_lock_acquired = false;
|
||||
if (s_pm_lock_acquired) {
|
||||
esp_phy_disable();
|
||||
s_pm_lock_acquired = false;
|
||||
}
|
||||
#else
|
||||
if (s_bt_phy_enabled) {
|
||||
esp_phy_disable();
|
||||
s_bt_phy_enabled = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
@ -576,13 +613,13 @@ void ble_rtc_clk_init(void)
|
||||
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 0, MODEM_CLKRST_LP_TIMER_SEL_8M_S);
|
||||
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 0, MODEM_CLKRST_LP_TIMER_SEL_RTC_SLOW_S);
|
||||
|
||||
#ifdef CONFIG_ESP32C2_XTAL_FREQ_26
|
||||
#ifdef CONFIG_XTAL_FREQ_26
|
||||
// LP_TIMER_CLK_DIV_NUM -> 130
|
||||
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM, 129, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM_S);
|
||||
#else
|
||||
// LP_TIMER_CLK_DIV_NUM -> 250
|
||||
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM, 249, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM_S);
|
||||
#endif // CONFIG_ESP32C2_XTAL_FREQ_26
|
||||
#endif // CONFIG_XTAL_FREQ_26
|
||||
|
||||
// MODEM_CLKRST_ETM_CLK_ACTIVE -> 1
|
||||
// MODEM_CLKRST_ETM_CLK_SEL -> 0
|
||||
@ -708,7 +745,6 @@ esp_err_t esp_bt_controller_deinit(void)
|
||||
|
||||
npl_freertos_mempool_deinit();
|
||||
|
||||
esp_phy_disable();
|
||||
esp_phy_pd_mem_deinit();
|
||||
|
||||
ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
|
||||
@ -770,16 +806,120 @@ esp_bt_controller_status_t esp_bt_controller_get_status(void)
|
||||
/* extra functions */
|
||||
esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_t power_level)
|
||||
{
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "%s not implemented, return OK", __func__);
|
||||
return ESP_OK;
|
||||
esp_err_t stat = ESP_FAIL;
|
||||
|
||||
switch (power_type) {
|
||||
case ESP_BLE_PWR_TYPE_DEFAULT:
|
||||
case ESP_BLE_PWR_TYPE_ADV:
|
||||
case ESP_BLE_PWR_TYPE_SCAN:
|
||||
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
|
||||
stat = ESP_OK;
|
||||
}
|
||||
break;
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL0:
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL1:
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL2:
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL3:
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL4:
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL5:
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL6:
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL7:
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL8:
|
||||
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_CONN, power_type, power_level) == 0) {
|
||||
stat = ESP_OK;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
stat = ESP_ERR_NOT_SUPPORTED;
|
||||
break;
|
||||
}
|
||||
|
||||
return stat;
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle, esp_power_level_t power_level)
|
||||
{
|
||||
esp_err_t stat = ESP_FAIL;
|
||||
switch (power_type) {
|
||||
case ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT:
|
||||
case ESP_BLE_ENHANCED_PWR_TYPE_SCAN:
|
||||
case ESP_BLE_ENHANCED_PWR_TYPE_INIT:
|
||||
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
|
||||
stat = ESP_OK;
|
||||
}
|
||||
break;
|
||||
case ESP_BLE_ENHANCED_PWR_TYPE_ADV:
|
||||
case ESP_BLE_ENHANCED_PWR_TYPE_CONN:
|
||||
if (ble_txpwr_set(power_type, handle, power_level) == 0) {
|
||||
stat = ESP_OK;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
stat = ESP_ERR_NOT_SUPPORTED;
|
||||
break;
|
||||
}
|
||||
|
||||
return stat;
|
||||
}
|
||||
|
||||
esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type)
|
||||
{
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "%s not implemented, return OK", __func__);
|
||||
return ESP_PWR_LVL_N0;
|
||||
int tx_level = 0;
|
||||
|
||||
switch (power_type) {
|
||||
case ESP_BLE_PWR_TYPE_ADV:
|
||||
case ESP_BLE_PWR_TYPE_SCAN:
|
||||
case ESP_BLE_PWR_TYPE_DEFAULT:
|
||||
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
|
||||
break;
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL0:
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL1:
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL2:
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL3:
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL4:
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL5:
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL6:
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL7:
|
||||
case ESP_BLE_PWR_TYPE_CONN_HDL8:
|
||||
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_CONN, power_type);
|
||||
break;
|
||||
default:
|
||||
return ESP_PWR_LVL_INVALID;
|
||||
}
|
||||
|
||||
if (tx_level < 0) {
|
||||
return ESP_PWR_LVL_INVALID;
|
||||
}
|
||||
|
||||
return (esp_power_level_t)tx_level;
|
||||
}
|
||||
|
||||
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle)
|
||||
{
|
||||
int tx_level = 0;
|
||||
|
||||
switch (power_type) {
|
||||
case ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT:
|
||||
case ESP_BLE_ENHANCED_PWR_TYPE_SCAN:
|
||||
case ESP_BLE_ENHANCED_PWR_TYPE_INIT:
|
||||
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
|
||||
break;
|
||||
case ESP_BLE_ENHANCED_PWR_TYPE_ADV:
|
||||
case ESP_BLE_ENHANCED_PWR_TYPE_CONN:
|
||||
tx_level = ble_txpwr_get(power_type, handle);
|
||||
break;
|
||||
default:
|
||||
return ESP_PWR_LVL_INVALID;
|
||||
}
|
||||
|
||||
if (tx_level < 0) {
|
||||
return ESP_PWR_LVL_INVALID;
|
||||
}
|
||||
|
||||
return (esp_power_level_t)tx_level;
|
||||
}
|
||||
|
||||
|
||||
#if (!CONFIG_BT_NIMBLE_ENABLED) && (CONFIG_BT_CONTROLLER_ENABLED == true)
|
||||
|
||||
#define BLE_SM_KEY_ERR 0x17
|
||||
|
@ -138,8 +138,6 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL
|
||||
help
|
||||
Specify default Tx power level
|
||||
|
||||
config BT_CTRL_DFT_TX_POWER_LEVEL_N27
|
||||
bool "-27dBm"
|
||||
config BT_CTRL_DFT_TX_POWER_LEVEL_N24
|
||||
bool "-24dBm"
|
||||
config BT_CTRL_DFT_TX_POWER_LEVEL_N21
|
||||
@ -170,26 +168,28 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL
|
||||
bool "+15dBm"
|
||||
config BT_CTRL_DFT_TX_POWER_LEVEL_P18
|
||||
bool "+18dBm"
|
||||
config BT_CTRL_DFT_TX_POWER_LEVEL_P21
|
||||
bool "+21dBm"
|
||||
endchoice
|
||||
|
||||
config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
|
||||
int
|
||||
default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N27
|
||||
default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N24
|
||||
default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N21
|
||||
default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N18
|
||||
default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N15
|
||||
default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N12
|
||||
default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N9
|
||||
default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N6
|
||||
default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N3
|
||||
default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_N0
|
||||
default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P3
|
||||
default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P6
|
||||
default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P9
|
||||
default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P12
|
||||
default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P15
|
||||
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P18
|
||||
default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N24
|
||||
default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N21
|
||||
default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N18
|
||||
default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N15
|
||||
default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N12
|
||||
default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N9
|
||||
default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N6
|
||||
default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N3
|
||||
default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N0
|
||||
default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_P3
|
||||
default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P6
|
||||
default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P9
|
||||
default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P12
|
||||
default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P15
|
||||
default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P18
|
||||
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P21
|
||||
default 0
|
||||
|
||||
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
|
||||
@ -351,9 +351,9 @@ menu "MODEM SLEEP Options"
|
||||
bool "Main crystal"
|
||||
help
|
||||
Main crystal can be used as low power clock for bluetooth modem sleep. If this option is
|
||||
selected, bluetooth modem sleep can work under Dynamic Frequency Scaling(DFS) enabled, but
|
||||
cannot work when light sleep is enabled. Main crystal has a relatively better performance than
|
||||
other bluetooth low power clock sources.
|
||||
selected, bluetooth modem sleep can work under Dynamic Frequency Scaling(DFS) enabled, and
|
||||
bluetooth can work under light sleep enabled. Main crystal has a relatively better performance
|
||||
than other bluetooth low power clock sources.
|
||||
config BT_CTRL_LPCLK_SEL_EXT_32K_XTAL
|
||||
bool "External 32kHz crystal"
|
||||
depends on RTC_CLK_SRC_EXT_CRYS
|
||||
@ -368,9 +368,18 @@ menu "MODEM SLEEP Options"
|
||||
help
|
||||
Internal 150kHz RC oscillator. The accuracy of this clock is a lot larger than 500ppm which is required
|
||||
in Bluetooth communication, so don't select this option in scenarios such as BLE connection state.
|
||||
|
||||
|
||||
endchoice
|
||||
|
||||
config BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
|
||||
bool "power up main XTAL during light sleep"
|
||||
depends on (BT_CTRL_LPCLK_SEL_MAIN_XTAL || BT_CTRL_LPCLK_SEL_EXT_32K_XTAL) && FREERTOS_USE_TICKLESS_IDLE
|
||||
default n
|
||||
help
|
||||
If this option is selected, the main crystal will power up during light sleep when the low power clock
|
||||
selects an external 32kHz crystal but the external 32kHz crystal does not exist or the low power clock
|
||||
selects the main crystal.
|
||||
|
||||
|
||||
endmenu
|
||||
|
||||
config BT_CTRL_SLEEP_MODE_EFF
|
||||
|
@ -72,7 +72,8 @@ typedef union {
|
||||
uint32_t mac_bb_pd : 1; // whether hardware(MAC, BB) force-power-down is required during sleep
|
||||
uint32_t wakeup_timer_required : 1; // whether system timer is needed
|
||||
uint32_t no_light_sleep : 1; // do not allow system to enter light sleep after bluetooth is enabled
|
||||
uint32_t reserved : 26; // reserved
|
||||
uint32_t main_xtal_pu : 1; // power up main XTAL
|
||||
uint32_t reserved : 25; // reserved
|
||||
};
|
||||
uint32_t val;
|
||||
} btdm_lpcntl_t;
|
||||
@ -1003,12 +1004,13 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
// set default values for global states or resources
|
||||
s_lp_stat.val = 0;
|
||||
s_lp_cntl.val = 0;
|
||||
s_lp_cntl.main_xtal_pu = 0;
|
||||
s_wakeup_req_sem = NULL;
|
||||
s_btdm_slp_tmr = NULL;
|
||||
|
||||
// configure and initialize resources
|
||||
s_lp_cntl.enable = (cfg->sleep_mode == ESP_BT_SLEEP_MODE_1) ? 1 : 0;
|
||||
s_lp_cntl.no_light_sleep = 1;
|
||||
s_lp_cntl.no_light_sleep = 0;
|
||||
|
||||
if (s_lp_cntl.enable) {
|
||||
#if CONFIG_MAC_BB_PD
|
||||
@ -1051,33 +1053,41 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
// check whether or not EXT_CRYS is working
|
||||
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_XTAL32K) {
|
||||
s_lp_cntl.lpclk_sel = BTDM_LPCLK_SEL_XTAL32K; // External 32 kHz XTAL
|
||||
s_lp_cntl.no_light_sleep = 0;
|
||||
} else {
|
||||
ESP_LOGW(BTDM_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock\n"
|
||||
"light sleep mode will not be able to apply when bluetooth is enabled");
|
||||
ESP_LOGW(BTDM_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock.");
|
||||
#if !CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
|
||||
s_lp_cntl.no_light_sleep = 1;
|
||||
#endif
|
||||
}
|
||||
#elif CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW
|
||||
// check whether or not EXT_CRYS is working
|
||||
#elif (CONFIG_BT_CTRL_LPCLK_SEL_MAIN_XTAL)
|
||||
ESP_LOGI(BTDM_LOG_TAG, "Bluetooth will use main XTAL as Bluetooth sleep clock.");
|
||||
#if !CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
|
||||
s_lp_cntl.no_light_sleep = 1;
|
||||
#endif
|
||||
#elif (CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW)
|
||||
// check whether or not internal 150 kHz RC oscillator is working
|
||||
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_RC_SLOW) {
|
||||
s_lp_cntl.lpclk_sel = BTDM_LPCLK_SEL_RTC_SLOW; // Internal 150 kHz RC oscillator
|
||||
ESP_LOGW(BTDM_LOG_TAG, "Internal 150kHz RC osciallator. The accuracy of this clock is a lot larger than 500ppm which is "
|
||||
"required in Bluetooth communication, so don't select this option in scenarios such as BLE connection state.");
|
||||
} else {
|
||||
ESP_LOGW(BT_LOG_TAG, "Internal 150kHz RC oscillator not detected.");
|
||||
ESP_LOGW(BTDM_LOG_TAG, "Internal 150kHz RC oscillator not detected.");
|
||||
assert(0);
|
||||
}
|
||||
#else
|
||||
s_lp_cntl.no_light_sleep = 1;
|
||||
#endif
|
||||
|
||||
bool select_src_ret __attribute__((unused));
|
||||
bool set_div_ret __attribute__((unused));
|
||||
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
|
||||
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
|
||||
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_ON));
|
||||
s_lp_cntl.main_xtal_pu = 1;
|
||||
#endif
|
||||
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL);
|
||||
set_div_ret = btdm_lpclk_set_div(esp_clk_xtal_freq() * 2 / MHZ);
|
||||
set_div_ret = btdm_lpclk_set_div(esp_clk_xtal_freq() / MHZ);
|
||||
assert(select_src_ret && set_div_ret);
|
||||
btdm_lpcycle_us_frac = RTC_CLK_CAL_FRACT;
|
||||
btdm_lpcycle_us = 2 << (btdm_lpcycle_us_frac);
|
||||
btdm_lpcycle_us = 1 << (btdm_lpcycle_us_frac);
|
||||
} else if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL32K) {
|
||||
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL32K);
|
||||
set_div_ret = btdm_lpclk_set_div(0);
|
||||
@ -1096,6 +1106,9 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
err = ESP_ERR_INVALID_ARG;
|
||||
goto error;
|
||||
}
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_update_lpclk_interval();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM_ENABLE
|
||||
if (s_lp_cntl.no_light_sleep) {
|
||||
@ -1103,6 +1116,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
err = ESP_ERR_NO_MEM;
|
||||
goto error;
|
||||
}
|
||||
ESP_LOGW(BTDM_LOG_TAG, "Light sleep mode will not be able to apply when bluetooth is enabled.");
|
||||
}
|
||||
if ((err = esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "bt", &s_pm_lock)) != ESP_OK) {
|
||||
err = ESP_ERR_NO_MEM;
|
||||
@ -1173,6 +1187,22 @@ error:
|
||||
s_wakeup_req_sem = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
|
||||
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
|
||||
if (s_lp_cntl.main_xtal_pu) {
|
||||
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_OFF));
|
||||
s_lp_cntl.main_xtal_pu = 0;
|
||||
}
|
||||
#endif
|
||||
btdm_lpclk_select_src(BTDM_LPCLK_SEL_RTC_SLOW);
|
||||
btdm_lpclk_set_div(0);
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_update_lpclk_interval();
|
||||
#endif
|
||||
}
|
||||
|
||||
btdm_lpcycle_us = 0;
|
||||
} while (0);
|
||||
|
||||
#if CONFIG_MAC_BB_PD
|
||||
@ -1235,6 +1265,21 @@ esp_err_t esp_bt_controller_deinit(void)
|
||||
semphr_delete_wrapper(s_wakeup_req_sem);
|
||||
s_wakeup_req_sem = NULL;
|
||||
}
|
||||
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
|
||||
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
|
||||
if (s_lp_cntl.main_xtal_pu) {
|
||||
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_OFF));
|
||||
s_lp_cntl.main_xtal_pu = 0;
|
||||
}
|
||||
#endif
|
||||
btdm_lpclk_select_src(BTDM_LPCLK_SEL_RTC_SLOW);
|
||||
btdm_lpclk_set_div(0);
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_update_lpclk_interval();
|
||||
#endif
|
||||
}
|
||||
|
||||
btdm_lpcycle_us = 0;
|
||||
} while (0);
|
||||
|
||||
#if CONFIG_MAC_BB_PD
|
||||
@ -1257,7 +1302,6 @@ esp_err_t esp_bt_controller_deinit(void)
|
||||
osi_funcs_p = NULL;
|
||||
|
||||
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
|
||||
btdm_lpcycle_us = 0;
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
|
@ -153,8 +153,6 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL
|
||||
help
|
||||
Specify default Tx power level
|
||||
|
||||
config BT_CTRL_DFT_TX_POWER_LEVEL_N27
|
||||
bool "-27dBm"
|
||||
config BT_CTRL_DFT_TX_POWER_LEVEL_N24
|
||||
bool "-24dBm"
|
||||
config BT_CTRL_DFT_TX_POWER_LEVEL_N21
|
||||
@ -185,27 +183,29 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL
|
||||
bool "+15dBm"
|
||||
config BT_CTRL_DFT_TX_POWER_LEVEL_P18
|
||||
bool "+18dBm"
|
||||
config BT_CTRL_DFT_TX_POWER_LEVEL_P18
|
||||
bool "+21dBm"
|
||||
|
||||
endchoice
|
||||
|
||||
config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
|
||||
int
|
||||
default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N27
|
||||
default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N24
|
||||
default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N21
|
||||
default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N18
|
||||
default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N15
|
||||
default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N12
|
||||
default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N9
|
||||
default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N6
|
||||
default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N3
|
||||
default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_N0
|
||||
default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P3
|
||||
default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P6
|
||||
default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P9
|
||||
default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P12
|
||||
default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P15
|
||||
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P18
|
||||
default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N24
|
||||
default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N21
|
||||
default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N18
|
||||
default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N15
|
||||
default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N12
|
||||
default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N9
|
||||
default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N6
|
||||
default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N3
|
||||
default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N0
|
||||
default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_P3
|
||||
default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P6
|
||||
default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P9
|
||||
default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P12
|
||||
default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P15
|
||||
default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P18
|
||||
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P21
|
||||
|
||||
default 0
|
||||
|
||||
@ -368,9 +368,9 @@ menu "MODEM SLEEP Options"
|
||||
bool "Main crystal"
|
||||
help
|
||||
Main crystal can be used as low power clock for bluetooth modem sleep. If this option is
|
||||
selected, bluetooth modem sleep can work under Dynamic Frequency Scaling(DFS) enabled, but
|
||||
cannot work when light sleep is enabled. Main crystal has a relatively better performance than
|
||||
other bluetooth low power clock sources.
|
||||
selected, bluetooth modem sleep can work under Dynamic Frequency Scaling(DFS) enabled, and
|
||||
bluetooth can work under light sleep enabled. Main crystal has a relatively better performance
|
||||
than other bluetooth low power clock sources.
|
||||
config BT_CTRL_LPCLK_SEL_EXT_32K_XTAL
|
||||
bool "External 32kHz crystal"
|
||||
depends on RTC_CLK_SRC_EXT_CRYS
|
||||
@ -385,9 +385,17 @@ menu "MODEM SLEEP Options"
|
||||
help
|
||||
Internal 150kHz RC oscillator. The accuracy of this clock is a lot larger than 500ppm which is required
|
||||
in Bluetooth communication, so don't select this option in scenarios such as BLE connection state.
|
||||
|
||||
|
||||
endchoice
|
||||
|
||||
config BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
|
||||
bool "power up main XTAL during light sleep"
|
||||
depends on (BT_CTRL_LPCLK_SEL_MAIN_XTAL || BT_CTRL_LPCLK_SEL_EXT_32K_XTAL) && FREERTOS_USE_TICKLESS_IDLE
|
||||
default n
|
||||
help
|
||||
If this option is selected, the main crystal will power up during light sleep when the low power clock
|
||||
selects an external 32kHz crystal but the external 32kHz crystal does not exist or the low power clock
|
||||
selects the main crystal.
|
||||
|
||||
endmenu
|
||||
|
||||
config BT_CTRL_SLEEP_MODE_EFF
|
||||
|
@ -72,7 +72,8 @@ typedef union {
|
||||
uint32_t mac_bb_pd : 1; // whether hardware(MAC, BB) force-power-down is required during sleep
|
||||
uint32_t wakeup_timer_required : 1; // whether system timer is needed
|
||||
uint32_t no_light_sleep : 1; // do not allow system to enter light sleep after bluetooth is enabled
|
||||
uint32_t reserved : 26; // reserved
|
||||
uint32_t main_xtal_pu : 1; // power up main XTAL
|
||||
uint32_t reserved : 25; // reserved
|
||||
};
|
||||
uint32_t val;
|
||||
} btdm_lpcntl_t;
|
||||
@ -1035,12 +1036,13 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
// set default values for global states or resources
|
||||
s_lp_stat.val = 0;
|
||||
s_lp_cntl.val = 0;
|
||||
s_lp_cntl.main_xtal_pu = 0;
|
||||
s_wakeup_req_sem = NULL;
|
||||
s_btdm_slp_tmr = NULL;
|
||||
|
||||
// configure and initialize resources
|
||||
s_lp_cntl.enable = (cfg->sleep_mode == ESP_BT_SLEEP_MODE_1) ? 1 : 0;
|
||||
s_lp_cntl.no_light_sleep = 1;
|
||||
s_lp_cntl.no_light_sleep = 0;
|
||||
|
||||
if (s_lp_cntl.enable) {
|
||||
#if CONFIG_MAC_BB_PD
|
||||
@ -1083,33 +1085,41 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
// check whether or not EXT_CRYS is working
|
||||
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_XTAL32K) {
|
||||
s_lp_cntl.lpclk_sel = BTDM_LPCLK_SEL_XTAL32K; // External 32 kHz XTAL
|
||||
s_lp_cntl.no_light_sleep = 0;
|
||||
} else {
|
||||
ESP_LOGW(BT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock\n"
|
||||
"light sleep mode will not be able to apply when bluetooth is enabled");
|
||||
ESP_LOGW(BT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
|
||||
#if !CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
|
||||
s_lp_cntl.no_light_sleep = 1;
|
||||
#endif
|
||||
}
|
||||
#elif CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW
|
||||
// check whether or not EXT_CRYS is working
|
||||
#elif (CONFIG_BT_CTRL_LPCLK_SEL_MAIN_XTAL)
|
||||
ESP_LOGI(BT_LOG_TAG, "Bluetooth will use main XTAL as Bluetooth sleep clock.");
|
||||
#if !CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
|
||||
s_lp_cntl.no_light_sleep = 1;
|
||||
#endif
|
||||
#elif (CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW)
|
||||
// check whether or not internal 150 kHz RC oscillator is working
|
||||
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_RC_SLOW) {
|
||||
s_lp_cntl.lpclk_sel = BTDM_LPCLK_SEL_RTC_SLOW; // Internal 150 kHz RC oscillator
|
||||
ESP_LOGW(BTDM_LOG_TAG, "Internal 150kHz RC osciallator. The accuracy of this clock is a lot larger than 500ppm which is "
|
||||
ESP_LOGW(BT_LOG_TAG, "Internal 150kHz RC osciallator. The accuracy of this clock is a lot larger than 500ppm which is "
|
||||
"required in Bluetooth communication, so don't select this option in scenarios such as BLE connection state.");
|
||||
} else {
|
||||
ESP_LOGW(BT_LOG_TAG, "Internal 150kHz RC oscillator not detected.");
|
||||
assert(0);
|
||||
}
|
||||
#else
|
||||
s_lp_cntl.no_light_sleep = 1;
|
||||
#endif
|
||||
|
||||
bool select_src_ret __attribute__((unused));
|
||||
bool set_div_ret __attribute__((unused));
|
||||
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
|
||||
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
|
||||
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_ON));
|
||||
s_lp_cntl.main_xtal_pu = 1;
|
||||
#endif
|
||||
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL);
|
||||
set_div_ret = btdm_lpclk_set_div(esp_clk_xtal_freq() * 2 / MHZ);
|
||||
set_div_ret = btdm_lpclk_set_div(esp_clk_xtal_freq() / MHZ);
|
||||
assert(select_src_ret && set_div_ret);
|
||||
btdm_lpcycle_us_frac = RTC_CLK_CAL_FRACT;
|
||||
btdm_lpcycle_us = 2 << (btdm_lpcycle_us_frac);
|
||||
btdm_lpcycle_us = 1 << (btdm_lpcycle_us_frac);
|
||||
} else if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL32K) {
|
||||
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL32K);
|
||||
set_div_ret = btdm_lpclk_set_div(0);
|
||||
@ -1128,6 +1138,9 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
err = ESP_ERR_INVALID_ARG;
|
||||
goto error;
|
||||
}
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_update_lpclk_interval();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM_ENABLE
|
||||
if (s_lp_cntl.no_light_sleep) {
|
||||
@ -1135,6 +1148,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
err = ESP_ERR_NO_MEM;
|
||||
goto error;
|
||||
}
|
||||
ESP_LOGW(BT_LOG_TAG, "light sleep mode will not be able to apply when bluetooth is enabled.");
|
||||
}
|
||||
if ((err = esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "bt", &s_pm_lock)) != ESP_OK) {
|
||||
err = ESP_ERR_NO_MEM;
|
||||
@ -1205,6 +1219,22 @@ error:
|
||||
s_wakeup_req_sem = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
|
||||
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
|
||||
if (s_lp_cntl.main_xtal_pu) {
|
||||
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_OFF));
|
||||
s_lp_cntl.main_xtal_pu = 0;
|
||||
}
|
||||
#endif
|
||||
btdm_lpclk_select_src(BTDM_LPCLK_SEL_RTC_SLOW);
|
||||
btdm_lpclk_set_div(0);
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_update_lpclk_interval();
|
||||
#endif
|
||||
}
|
||||
|
||||
btdm_lpcycle_us = 0;
|
||||
} while (0);
|
||||
|
||||
#if CONFIG_MAC_BB_PD
|
||||
@ -1267,6 +1297,22 @@ esp_err_t esp_bt_controller_deinit(void)
|
||||
semphr_delete_wrapper(s_wakeup_req_sem);
|
||||
s_wakeup_req_sem = NULL;
|
||||
}
|
||||
|
||||
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
|
||||
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
|
||||
if (s_lp_cntl.main_xtal_pu) {
|
||||
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_OFF));
|
||||
s_lp_cntl.main_xtal_pu = 0;
|
||||
}
|
||||
#endif
|
||||
btdm_lpclk_select_src(BTDM_LPCLK_SEL_RTC_SLOW);
|
||||
btdm_lpclk_set_div(0);
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_update_lpclk_interval();
|
||||
#endif
|
||||
}
|
||||
|
||||
btdm_lpcycle_us = 0;
|
||||
} while (0);
|
||||
|
||||
#if CONFIG_MAC_BB_PD
|
||||
@ -1284,7 +1330,6 @@ esp_err_t esp_bt_controller_deinit(void)
|
||||
osi_funcs_p = NULL;
|
||||
|
||||
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
|
||||
btdm_lpcycle_us = 0;
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
|
Submodule components/bt/controller/lib_esp32 updated: c98341759b...dbaeb136ca
Submodule components/bt/controller/lib_esp32c2/esp32c2-bt-lib updated: bdab852aa2...c1f0e3be6c
Submodule components/bt/controller/lib_esp32c3_family updated: d1c2082e56...4dd1838c81
@ -803,6 +803,13 @@ if BLE_MESH
|
||||
help
|
||||
Maximum number of groups to which the LPN can subscribe.
|
||||
|
||||
config BLE_MESH_LPN_SUB_ALL_NODES_ADDR
|
||||
bool "Automatically subscribe all nodes address"
|
||||
default n
|
||||
help
|
||||
Automatically subscribe all nodes address when friendship
|
||||
established.
|
||||
|
||||
endif # BLE_MESH_LOW_POWER
|
||||
|
||||
config BLE_MESH_FRIEND
|
||||
|
@ -82,7 +82,7 @@ static void btc_ble_mesh_ble_callback(esp_ble_mesh_ble_cb_param_t *cb_params, ui
|
||||
msg.pid = BTC_PID_BLE_MESH_BLE_COEX;
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_ble_cb_param_t),
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_ble_cb_param_t),
|
||||
btc_ble_mesh_ble_copy_req_data);
|
||||
}
|
||||
|
||||
|
@ -298,7 +298,7 @@ static void btc_ble_mesh_config_client_callback(esp_ble_mesh_cfg_client_cb_param
|
||||
msg.pid = BTC_PID_CONFIG_CLIENT;
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_cfg_client_cb_param_t),
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_cfg_client_cb_param_t),
|
||||
btc_ble_mesh_config_client_copy_req_data);
|
||||
}
|
||||
|
||||
@ -702,7 +702,7 @@ static void btc_ble_mesh_config_server_callback(esp_ble_mesh_cfg_server_cb_param
|
||||
msg.pid = BTC_PID_CONFIG_SERVER;
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_cfg_server_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_cfg_server_cb_param_t), NULL);
|
||||
}
|
||||
|
||||
void bt_mesh_config_server_cb_evt_to_btc(uint8_t evt_type, struct bt_mesh_model *model,
|
||||
|
@ -368,7 +368,7 @@ static void btc_ble_mesh_generic_client_callback(esp_ble_mesh_generic_client_cb_
|
||||
msg.pid = BTC_PID_GENERIC_CLIENT;
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_generic_client_cb_param_t),
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_generic_client_cb_param_t),
|
||||
btc_ble_mesh_generic_client_copy_req_data);
|
||||
}
|
||||
|
||||
@ -685,7 +685,7 @@ static void btc_ble_mesh_generic_server_callback(esp_ble_mesh_generic_server_cb_
|
||||
msg.pid = BTC_PID_GENERIC_SERVER;
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_generic_server_cb_param_t),
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_generic_server_cb_param_t),
|
||||
btc_ble_mesh_generic_server_copy_req_data);
|
||||
}
|
||||
|
||||
|
@ -231,7 +231,7 @@ static void btc_ble_mesh_health_client_callback(esp_ble_mesh_health_client_cb_pa
|
||||
msg.pid = BTC_PID_HEALTH_CLIENT;
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_health_client_cb_param_t),
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_health_client_cb_param_t),
|
||||
btc_ble_mesh_health_client_copy_req_data);
|
||||
}
|
||||
|
||||
@ -542,7 +542,7 @@ static void btc_ble_mesh_health_server_callback(esp_ble_mesh_health_server_cb_pa
|
||||
msg.pid = BTC_PID_HEALTH_SERVER;
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_health_server_cb_param_t),
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_health_server_cb_param_t),
|
||||
btc_ble_mesh_health_server_copy_req_data);
|
||||
}
|
||||
|
||||
|
@ -212,7 +212,7 @@ static void btc_ble_mesh_lighting_client_callback(esp_ble_mesh_light_client_cb_p
|
||||
msg.pid = BTC_PID_LIGHTING_CLIENT;
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_light_client_cb_param_t),
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_light_client_cb_param_t),
|
||||
btc_ble_mesh_lighting_client_copy_req_data);
|
||||
}
|
||||
|
||||
@ -497,7 +497,7 @@ static void btc_ble_mesh_lighting_server_callback(esp_ble_mesh_lighting_server_c
|
||||
msg.pid = BTC_PID_LIGHTING_SERVER;
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_lighting_server_cb_param_t),
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_lighting_server_cb_param_t),
|
||||
btc_ble_mesh_lighting_server_copy_req_data);
|
||||
}
|
||||
|
||||
|
@ -368,7 +368,7 @@ static bt_status_t btc_ble_mesh_model_callback(esp_ble_mesh_model_cb_param_t *pa
|
||||
msg.pid = BTC_PID_MODEL;
|
||||
msg.act = act;
|
||||
|
||||
ret = btc_transfer_context(&msg, param, sizeof(esp_ble_mesh_model_cb_param_t),
|
||||
ret = btc_transfer_context(&msg, param, param == NULL ? 0 : sizeof(esp_ble_mesh_model_cb_param_t),
|
||||
btc_ble_mesh_model_copy_req_data);
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
BT_ERR("btc_transfer_context failed");
|
||||
@ -528,7 +528,7 @@ static bt_status_t btc_ble_mesh_prov_callback(esp_ble_mesh_prov_cb_param_t *para
|
||||
msg.pid = BTC_PID_PROV;
|
||||
msg.act = act;
|
||||
|
||||
ret = btc_transfer_context(&msg, param, sizeof(esp_ble_mesh_prov_cb_param_t), NULL);
|
||||
ret = btc_transfer_context(&msg, param, param == NULL ? 0 : sizeof(esp_ble_mesh_prov_cb_param_t), NULL);
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
BT_ERR("btc_transfer_context failed");
|
||||
}
|
||||
|
@ -450,7 +450,7 @@ static void btc_ble_mesh_sensor_client_callback(esp_ble_mesh_sensor_client_cb_pa
|
||||
msg.pid = BTC_PID_SENSOR_CLIENT;
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_sensor_client_cb_param_t),
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_sensor_client_cb_param_t),
|
||||
btc_ble_mesh_sensor_client_copy_req_data);
|
||||
}
|
||||
|
||||
@ -817,7 +817,7 @@ static void btc_ble_mesh_sensor_server_callback(esp_ble_mesh_sensor_server_cb_pa
|
||||
msg.pid = BTC_PID_SENSOR_SERVER;
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_sensor_server_cb_param_t),
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_sensor_server_cb_param_t),
|
||||
btc_ble_mesh_sensor_server_copy_req_data);
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ static void btc_ble_mesh_time_scene_client_callback(esp_ble_mesh_time_scene_clie
|
||||
msg.pid = BTC_PID_TIME_SCENE_CLIENT;
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_time_scene_client_cb_param_t),
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_time_scene_client_cb_param_t),
|
||||
btc_ble_mesh_time_scene_client_copy_req_data);
|
||||
}
|
||||
|
||||
@ -401,7 +401,7 @@ static void btc_ble_mesh_time_scene_server_callback(esp_ble_mesh_time_scene_serv
|
||||
msg.pid = BTC_PID_TIME_SCENE_SERVER;
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_time_scene_server_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_time_scene_server_cb_param_t), NULL);
|
||||
}
|
||||
|
||||
void bt_mesh_time_scene_server_cb_evt_to_btc(uint8_t evt_type, struct bt_mesh_model *model,
|
||||
|
@ -374,9 +374,19 @@ static void secure_beacon_recv(struct net_buf_simple *buf)
|
||||
|
||||
cache_add(data, sub);
|
||||
|
||||
/* If we have NetKey0 accept initiation only from it */
|
||||
/* Spec v1.0.1, Section 3.8.4:
|
||||
* If a node on a primary subnet receives an update on
|
||||
* the primary subnet, it shall propagate the IV update
|
||||
* to all other subnets. If a node on a primary subnet
|
||||
* receives an IV update on any other subnet, the update
|
||||
* shall be ignored.
|
||||
* If a node on a primary subnet receives an key update
|
||||
* on any other subnet, the update shall not be ignored.
|
||||
*/
|
||||
if (bt_mesh_primary_subnet_exist() &&
|
||||
sub->net_idx != BLE_MESH_KEY_PRIMARY) {
|
||||
sub->net_idx != BLE_MESH_KEY_PRIMARY &&
|
||||
BLE_MESH_IV_UPDATE(flags) &&
|
||||
!BLE_MESH_KEY_REFRESH(flags)) {
|
||||
BT_WARN("Ignoring secure beacon on non-primary subnet");
|
||||
goto update_stats;
|
||||
}
|
||||
@ -390,7 +400,15 @@ static void secure_beacon_recv(struct net_buf_simple *buf)
|
||||
bt_mesh_beacon_ivu_initiator(false);
|
||||
}
|
||||
|
||||
iv_change = bt_mesh_net_iv_update(iv_index, BLE_MESH_IV_UPDATE(flags));
|
||||
/* If a node on a primary subnet receives an IV update on any other subnet,
|
||||
* the IV update shall be ignored. And if a node on a non-primary subnet
|
||||
* receives an IV update on primary subnet, the IV update shall be ignored,
|
||||
* because it doesn't have a primary network key.
|
||||
*/
|
||||
if ((bt_mesh_primary_subnet_exist() && sub->net_idx == BLE_MESH_KEY_PRIMARY) ||
|
||||
(!bt_mesh_primary_subnet_exist() && sub->net_idx != BLE_MESH_KEY_PRIMARY)) {
|
||||
iv_change = bt_mesh_net_iv_update(iv_index, BLE_MESH_IV_UPDATE(flags));
|
||||
}
|
||||
|
||||
kr_change = bt_mesh_kr_update(sub, BLE_MESH_KEY_REFRESH(flags), new_key);
|
||||
if (kr_change) {
|
||||
|
@ -197,6 +197,21 @@ static bool app_key_is_valid(uint16_t app_idx)
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool mod_pub_app_key_bound(struct bt_mesh_model *model,
|
||||
uint16_t app_idx)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(model->keys); i++) {
|
||||
if (model->keys[i] == app_idx) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
BT_ERR("Appkey(0x%02x) not bound to this model.", app_idx);
|
||||
return false;
|
||||
}
|
||||
|
||||
static uint8_t _mod_pub_set(struct bt_mesh_model *model, uint16_t pub_addr,
|
||||
uint16_t app_idx, uint8_t cred_flag, uint8_t ttl, uint8_t period,
|
||||
uint8_t retransmit, bool store)
|
||||
@ -237,7 +252,11 @@ static uint8_t _mod_pub_set(struct bt_mesh_model *model, uint16_t pub_addr,
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (!bt_mesh_app_key_find(app_idx)) {
|
||||
/* For case MESH/NODE/CFG/MP/BI-03-C, need to check if appkey
|
||||
* is bound to model identified by the ModelIdentifier.
|
||||
*/
|
||||
if (!bt_mesh_app_key_find(app_idx) ||
|
||||
!mod_pub_app_key_bound(model, app_idx)) {
|
||||
return STATUS_INVALID_APPKEY;
|
||||
}
|
||||
|
||||
@ -3049,7 +3068,7 @@ static void heartbeat_pub_set(struct bt_mesh_model *model,
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if (param->period_log > 0x10) {
|
||||
if (param->period_log > 0x11) {
|
||||
status = STATUS_CANNOT_SET;
|
||||
goto failed;
|
||||
}
|
||||
@ -3202,19 +3221,18 @@ static void heartbeat_sub_set(struct bt_mesh_model *model,
|
||||
}
|
||||
|
||||
if (sub_src == BLE_MESH_ADDR_UNASSIGNED ||
|
||||
sub_dst == BLE_MESH_ADDR_UNASSIGNED ||
|
||||
sub_period == 0x00) {
|
||||
sub_dst == BLE_MESH_ADDR_UNASSIGNED ||
|
||||
sub_period == 0x00) {
|
||||
/* Only an explicit address change to unassigned should
|
||||
* trigger clearing of the values according to
|
||||
* MESH/NODE/CFG/HBS/BV-02-C.
|
||||
*/
|
||||
if (sub_src == BLE_MESH_ADDR_UNASSIGNED ||
|
||||
sub_dst == BLE_MESH_ADDR_UNASSIGNED) {
|
||||
sub_dst == BLE_MESH_ADDR_UNASSIGNED) {
|
||||
cfg->hb_sub.src = BLE_MESH_ADDR_UNASSIGNED;
|
||||
cfg->hb_sub.dst = BLE_MESH_ADDR_UNASSIGNED;
|
||||
cfg->hb_sub.min_hops = BLE_MESH_TTL_MAX;
|
||||
cfg->hb_sub.max_hops = 0U;
|
||||
cfg->hb_sub.count = 0U;
|
||||
}
|
||||
|
||||
period_ms = 0;
|
||||
@ -3240,6 +3258,11 @@ static void heartbeat_sub_set(struct bt_mesh_model *model,
|
||||
|
||||
hb_sub_send_status(model, ctx, STATUS_SUCCESS);
|
||||
|
||||
/* For case MESH/NODE/CFG/HBS/BV-02-C, set count_log to 0
|
||||
* when Heartbeat Subscription Status message is sent.
|
||||
*/
|
||||
cfg->hb_sub.count = 0U;
|
||||
|
||||
/* MESH/NODE/CFG/HBS/BV-01-C expects the MinHops to be 0x7f after
|
||||
* disabling subscription, but 0x00 for subsequent Get requests.
|
||||
*/
|
||||
|
@ -64,6 +64,7 @@ enum {
|
||||
};
|
||||
|
||||
static void (*friend_cb)(bool establish, uint16_t lpn_addr, uint8_t reason);
|
||||
static void enqueue_update(struct bt_mesh_friend *frnd, uint8_t md);
|
||||
|
||||
static bool friend_init = false;
|
||||
|
||||
@ -233,7 +234,23 @@ void bt_mesh_friend_sec_update(uint16_t net_idx)
|
||||
}
|
||||
|
||||
if (net_idx == BLE_MESH_KEY_ANY || frnd->net_idx == net_idx) {
|
||||
frnd->sec_update = 1U;
|
||||
/* For case MESH/NODE/FRND/FN/BV-20-C.
|
||||
* A situation is:
|
||||
* The friend node may receive more than one different secure updates
|
||||
* consecutively. And using the previous approach will cause only the
|
||||
* latest Friend Update message been enqueued.
|
||||
* So we update the implementation here to enqueue the Friend Update
|
||||
* message immediately once a different secure beacon is received.
|
||||
*
|
||||
* A disadvantage of the change is:
|
||||
* A friend node may receive different secure beacons. Then the
|
||||
* beacon_cache mechanism will not work. This will cause the friend
|
||||
* message queue been full of these secure beacons. So before enqueuing
|
||||
* the secure updates, we should check if the currently received one
|
||||
* is already exists in the message queue. Or enhance the beacon cache
|
||||
* filtering mechanism.
|
||||
*/
|
||||
enqueue_update(frnd, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -699,7 +716,6 @@ static void enqueue_update(struct bt_mesh_friend *frnd, uint8_t md)
|
||||
return;
|
||||
}
|
||||
|
||||
frnd->sec_update = 0U;
|
||||
enqueue_buf(frnd, buf);
|
||||
}
|
||||
|
||||
@ -1116,10 +1132,6 @@ static void enqueue_friend_pdu(struct bt_mesh_friend *frnd,
|
||||
BT_DBG("type %u", type);
|
||||
|
||||
if (type == BLE_MESH_FRIEND_PDU_SINGLE) {
|
||||
if (frnd->sec_update) {
|
||||
enqueue_update(frnd, 1);
|
||||
}
|
||||
|
||||
enqueue_buf(frnd, buf);
|
||||
return;
|
||||
}
|
||||
@ -1136,10 +1148,6 @@ static void enqueue_friend_pdu(struct bt_mesh_friend *frnd,
|
||||
net_buf_slist_put(&seg->queue, buf);
|
||||
|
||||
if (type == BLE_MESH_FRIEND_PDU_COMPLETE) {
|
||||
if (frnd->sec_update) {
|
||||
enqueue_update(frnd, 1);
|
||||
}
|
||||
|
||||
sys_slist_merge_slist(&frnd->queue, &seg->queue);
|
||||
|
||||
frnd->queue_size += seg->seg_count;
|
||||
|
@ -78,6 +78,11 @@ int bt_mesh_provision(const uint8_t net_key[16], uint16_t net_idx,
|
||||
|
||||
memcpy(bt_mesh.dev_key, dev_key, 16);
|
||||
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_LOW_POWER) &&
|
||||
IS_ENABLED(CONFIG_BLE_MESH_LPN_SUB_ALL_NODES_ADDR)) {
|
||||
bt_mesh_lpn_group_add(BLE_MESH_ADDR_ALL_NODES);
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_SETTINGS)) {
|
||||
BT_DBG("Storing network information persistently");
|
||||
bt_mesh_store_net();
|
||||
@ -110,6 +115,12 @@ void bt_mesh_node_reset(void)
|
||||
bt_mesh_tx_reset();
|
||||
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_LOW_POWER)) {
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_LPN_SUB_ALL_NODES_ADDR)) {
|
||||
uint16_t group = BLE_MESH_ADDR_ALL_NODES;
|
||||
|
||||
bt_mesh_lpn_group_del(&group, 1);
|
||||
}
|
||||
|
||||
bt_mesh_lpn_disable(true);
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ extern "C" {
|
||||
#define BLE_MESH_KEY_ANY 0xffff
|
||||
|
||||
#define BLE_MESH_ADDR_IS_UNICAST(addr) ((addr) && (addr) < 0x8000)
|
||||
#define BLE_MESH_ADDR_IS_GROUP(addr) ((addr) >= 0xc000 && (addr) <= 0xff00)
|
||||
#define BLE_MESH_ADDR_IS_GROUP(addr) ((addr) >= 0xc000 && (addr) < 0xff00)
|
||||
#define BLE_MESH_ADDR_IS_VIRTUAL(addr) ((addr) >= 0x8000 && (addr) < 0xc000)
|
||||
#define BLE_MESH_ADDR_IS_RFU(addr) ((addr) >= 0xff00 && (addr) <= 0xfffb)
|
||||
|
||||
|
@ -1220,6 +1220,7 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
|
||||
}
|
||||
|
||||
if (rx->net_if == BLE_MESH_NET_IF_ADV &&
|
||||
!rx->friend_cred &&
|
||||
bt_mesh_relay_get() != BLE_MESH_RELAY_ENABLED &&
|
||||
bt_mesh_gatt_proxy_get() != BLE_MESH_GATT_PROXY_ENABLED) {
|
||||
return;
|
||||
@ -1232,7 +1233,7 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
|
||||
* Anything else (like GATT to adv, or locally originated packets)
|
||||
* use the Network Transmit state.
|
||||
*/
|
||||
if (rx->net_if == BLE_MESH_NET_IF_ADV) {
|
||||
if (rx->net_if == BLE_MESH_NET_IF_ADV && !rx->friend_cred) {
|
||||
transmit = bt_mesh_relay_retransmit_get();
|
||||
} else {
|
||||
transmit = bt_mesh_net_transmit_get();
|
||||
@ -1302,6 +1303,7 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
|
||||
*/
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_SERVER) &&
|
||||
(bt_mesh_gatt_proxy_get() == BLE_MESH_GATT_PROXY_ENABLED ||
|
||||
rx->friend_cred ||
|
||||
rx->net_if == BLE_MESH_NET_IF_LOCAL)) {
|
||||
if (bt_mesh_proxy_server_relay(&buf->b, rx->ctx.recv_dst) &&
|
||||
BLE_MESH_ADDR_IS_UNICAST(rx->ctx.recv_dst)) {
|
||||
@ -1309,7 +1311,7 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
|
||||
}
|
||||
}
|
||||
|
||||
if (relay_to_adv(rx->net_if)) {
|
||||
if (relay_to_adv(rx->net_if) || rx->friend_cred) {
|
||||
#if !defined(CONFIG_BLE_MESH_RELAY_ADV_BUF)
|
||||
bt_mesh_adv_send(buf, NULL, NULL);
|
||||
#else
|
||||
@ -1378,8 +1380,9 @@ int bt_mesh_net_decode(struct net_buf_simple *data, enum bt_mesh_net_if net_if,
|
||||
return -EBADMSG;
|
||||
}
|
||||
|
||||
/* For case MESH/NODE/RLY/BV-01-C, even the DST is RFU, it needs to be forwarded. */
|
||||
if (BLE_MESH_ADDR_IS_RFU(rx->ctx.recv_dst)) {
|
||||
BT_ERR("Destination address is RFU; dropping packet");
|
||||
BT_ERR("Destination address is RFU; dropping packet 0x%02x", rx->ctx.recv_dst);
|
||||
return -EBADMSG;
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,6 @@ struct bt_mesh_friend {
|
||||
uint8_t fsn:1,
|
||||
send_last:1,
|
||||
pending_req:1,
|
||||
sec_update:1,
|
||||
pending_buf:1,
|
||||
valid:1,
|
||||
established:1;
|
||||
|
@ -1450,18 +1450,22 @@ static void prov_msg_recv(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (type != PROV_FAILED && type != link.expect) {
|
||||
BT_WARN("Unexpected msg 0x%02x != 0x%02x", type, link.expect);
|
||||
prov_send_fail_msg(PROV_ERR_UNEXP_PDU);
|
||||
return;
|
||||
}
|
||||
|
||||
/* For case MESH/NODE/PROV/BI-15-C, when the node receive a Provisioning PDU
|
||||
* with the Type field set to the lowest unsupported or RFU value, it sends a
|
||||
* Provisioning Failed PDU with the Error Code field set to Invalid PDU(0x01).
|
||||
*/
|
||||
if (type >= ARRAY_SIZE(prov_handlers)) {
|
||||
BT_ERR("Unknown provisioning PDU type 0x%02x", type);
|
||||
prov_send_fail_msg(PROV_ERR_NVAL_PDU);
|
||||
return;
|
||||
}
|
||||
|
||||
if (type != PROV_FAILED && type != link.expect) {
|
||||
BT_WARN("Unexpected msg 0x%02x != 0x%02x", type, link.expect);
|
||||
prov_send_fail_msg(PROV_ERR_UNEXP_PDU);
|
||||
return;
|
||||
}
|
||||
|
||||
if (1 + prov_handlers[type].len != link.rx.buf->len) {
|
||||
BT_ERR("Invalid length %u for type 0x%02x",
|
||||
link.rx.buf->len, type);
|
||||
@ -1666,15 +1670,30 @@ int bt_mesh_pb_gatt_recv(struct bt_mesh_conn *conn, struct net_buf_simple *buf)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
type = net_buf_simple_pull_u8(buf);
|
||||
if (type != PROV_FAILED && type != link.expect) {
|
||||
BT_WARN("Unexpected msg 0x%02x != 0x%02x", type, link.expect);
|
||||
/* For case MESH/NODE/PROV/BI-03-C, if the link is closed, when the node receive
|
||||
* a Provisioning PDU , it will send a Provisioning Failed PDU with the Error Code
|
||||
* field set to Unexpected PDU(0x03).
|
||||
*/
|
||||
if (bt_mesh_atomic_test_bit(link.flags, LINK_INVALID)) {
|
||||
BT_WARN("Unexpected msg 0x%02x on invalid link", type);
|
||||
prov_send_fail_msg(PROV_ERR_UNEXP_PDU);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* For case MESH/NODE/PROV/BI-15-C, when the node receive a Provisioning PDU
|
||||
* with the Type field set to the lowest unsupported or RFU value, it sends a
|
||||
* Provisioning Failed PDU with the Error Code field set to Invalid PDU(0x01).
|
||||
*/
|
||||
type = net_buf_simple_pull_u8(buf);
|
||||
if (type >= ARRAY_SIZE(prov_handlers)) {
|
||||
BT_ERR("Unknown provisioning PDU type 0x%02x", type);
|
||||
prov_send_fail_msg(PROV_ERR_NVAL_PDU);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (type != PROV_FAILED && type != link.expect) {
|
||||
BT_WARN("Unexpected msg 0x%02x != 0x%02x", type, link.expect);
|
||||
prov_send_fail_msg(PROV_ERR_UNEXP_PDU);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -2943,6 +2943,12 @@ static void gen_prov_ack(const uint8_t idx, struct prov_rx *rx, struct net_buf_s
|
||||
case PROV_START:
|
||||
pub_key_oob = link[idx].conf_inputs[13];
|
||||
send_pub_key(idx, pub_key_oob);
|
||||
/* For case MESH/PVNR/PROV/BV-04-C, if using OOB public key,
|
||||
* the value of expect_ack_for shall be PROV_PUB_KEY.
|
||||
*/
|
||||
if (pub_key_oob) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case PROV_PUB_KEY:
|
||||
prov_gen_dh_key(idx);
|
||||
|
@ -233,14 +233,11 @@ static void bt_mesh_scan_cb(const bt_mesh_addr_t *addr,
|
||||
|
||||
buf->len = len - 1;
|
||||
|
||||
#if 0
|
||||
/* TODO: Check with BLE Mesh BQB test cases */
|
||||
if ((type == BLE_MESH_DATA_MESH_PROV || type == BLE_MESH_DATA_MESH_MESSAGE ||
|
||||
type == BLE_MESH_DATA_MESH_BEACON) && (adv_type != BLE_MESH_ADV_NONCONN_IND)) {
|
||||
BT_DBG("Ignore mesh packet (type 0x%02x) with adv_type 0x%02x", type, adv_type);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (type) {
|
||||
case BLE_MESH_DATA_MESH_MESSAGE:
|
||||
|
@ -173,6 +173,13 @@ config BT_GATT_MAX_SR_PROFILES
|
||||
help
|
||||
Maximum GATT Server Profiles Count
|
||||
|
||||
config BT_GATT_MAX_SR_ATTRIBUTES
|
||||
int "Max GATT Service Attributes"
|
||||
depends on BT_GATTS_ENABLE && BT_BLUEDROID_ENABLED
|
||||
range 1 500
|
||||
default 100
|
||||
help
|
||||
Maximum GATT Service Attributes Count
|
||||
|
||||
|
||||
choice BT_GATTS_SEND_SERVICE_CHANGE_MODE
|
||||
@ -208,6 +215,14 @@ config BT_GATTC_ENABLE
|
||||
help
|
||||
This option can be close when the app work only on gatt server mode
|
||||
|
||||
config BT_GATTC_MAX_CACHE_CHAR
|
||||
int "Max gattc cache characteristic for discover"
|
||||
depends on BT_GATTC_ENABLE
|
||||
range 1 500
|
||||
default 40
|
||||
help
|
||||
Maximum GATTC cache characteristic count
|
||||
|
||||
config BT_GATTC_CACHE_NVS_FLASH
|
||||
bool "Save gattc cache data to nvs flash"
|
||||
depends on BT_GATTC_ENABLE
|
||||
@ -1030,7 +1045,7 @@ config BT_SMP_ENABLE
|
||||
|
||||
config BT_BLE_ACT_SCAN_REP_ADV_SCAN
|
||||
bool "Report adv data and scan response individually when BLE active scan"
|
||||
depends on BT_BLUEDROID_ENABLED && (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY)
|
||||
depends on BT_BLUEDROID_ENABLED && BT_BLE_ENABLED
|
||||
default n
|
||||
help
|
||||
Originally, when doing BLE active scan, Bluedroid will not report adv to application layer
|
||||
|
@ -85,7 +85,7 @@ esp_err_t esp_ble_gatts_create_service(esp_gatt_if_t gatts_if,
|
||||
|
||||
esp_err_t esp_ble_gatts_create_attr_tab(const esp_gatts_attr_db_t *gatts_attr_db,
|
||||
esp_gatt_if_t gatts_if,
|
||||
uint8_t max_nb_attr,
|
||||
uint16_t max_nb_attr,
|
||||
uint8_t srvc_inst_id)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
@ -93,6 +93,11 @@ esp_err_t esp_ble_gatts_create_attr_tab(const esp_gatts_attr_db_t *gatts_attr_db
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
if (max_nb_attr > ESP_GATT_ATTR_HANDLE_MAX) {
|
||||
LOG_ERROR("The number of attribute should not be greater than CONFIG_BT_GATT_MAX_SR_ATTRIBUTES\n");
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GATTS;
|
||||
msg.act = BTC_GATTS_ACT_CREATE_ATTR_TAB;
|
||||
|
@ -17,8 +17,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**@{
|
||||
* BLE_ADV_DATA_FLAG data flag bit definition used for advertising data flag
|
||||
/**
|
||||
* @brief BLE_ADV_DATA_FLAG data flag bit definition used for advertising data flag
|
||||
*/
|
||||
#define ESP_BLE_ADV_FLAG_LIMIT_DISC (0x01 << 0)
|
||||
#define ESP_BLE_ADV_FLAG_GEN_DISC (0x01 << 1)
|
||||
@ -26,104 +26,102 @@ extern "C" {
|
||||
#define ESP_BLE_ADV_FLAG_DMT_CONTROLLER_SPT (0x01 << 3)
|
||||
#define ESP_BLE_ADV_FLAG_DMT_HOST_SPT (0x01 << 4)
|
||||
#define ESP_BLE_ADV_FLAG_NON_LIMIT_DISC (0x00 )
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* relate to BTM_LE_KEY_xxx in stack/btm_api.h */
|
||||
#define ESP_LE_KEY_NONE 0 /* relate to BTM_LE_KEY_NONE in stack/btm_api.h */
|
||||
#define ESP_LE_KEY_PENC (1 << 0) /*!< encryption key, encryption information of peer device */ /* relate to BTM_LE_KEY_PENC in stack/btm_api.h */
|
||||
#define ESP_LE_KEY_PID (1 << 1) /*!< identity key of the peer device */ /* relate to BTM_LE_KEY_PID in stack/btm_api.h */
|
||||
#define ESP_LE_KEY_PCSRK (1 << 2) /*!< peer SRK */ /* relate to BTM_LE_KEY_PCSRK in stack/btm_api.h */
|
||||
#define ESP_LE_KEY_PLK (1 << 3) /*!< Link key*/ /* relate to BTM_LE_KEY_PLK in stack/btm_api.h */
|
||||
#define ESP_LE_KEY_LLK (ESP_LE_KEY_PLK << 4) /* relate to BTM_LE_KEY_LLK in stack/btm_api.h */
|
||||
#define ESP_LE_KEY_LENC (ESP_LE_KEY_PENC << 4) /*!< master role security information:div */ /* relate to BTM_LE_KEY_LENC in stack/btm_api.h */
|
||||
#define ESP_LE_KEY_LID (ESP_LE_KEY_PID << 4) /*!< master device ID key */ /* relate to BTM_LE_KEY_LID in stack/btm_api.h */
|
||||
#define ESP_LE_KEY_LCSRK (ESP_LE_KEY_PCSRK << 4) /*!< local CSRK has been deliver to peer */ /* relate to BTM_LE_KEY_LCSRK in stack/btm_api.h */
|
||||
|
||||
/// relate to BTM_LE_KEY_xxx in stack/btm_api.h
|
||||
#define ESP_LE_KEY_NONE 0 /*!< No encryption key */
|
||||
#define ESP_LE_KEY_PENC (1 << 0) /*!< encryption key, encryption information of peer device */
|
||||
#define ESP_LE_KEY_PID (1 << 1) /*!< identity key of the peer device */
|
||||
#define ESP_LE_KEY_PCSRK (1 << 2) /*!< peer SRK */
|
||||
#define ESP_LE_KEY_PLK (1 << 3) /*!< Link key*/
|
||||
#define ESP_LE_KEY_LLK (ESP_LE_KEY_PLK << 4) /*!< peer link key*/
|
||||
#define ESP_LE_KEY_LENC (ESP_LE_KEY_PENC << 4) /*!< master role security information:div */
|
||||
#define ESP_LE_KEY_LID (ESP_LE_KEY_PID << 4) /*!< master device ID key */
|
||||
#define ESP_LE_KEY_LCSRK (ESP_LE_KEY_PCSRK << 4) /*!< local CSRK has been deliver to peer */
|
||||
typedef uint8_t esp_ble_key_type_t;
|
||||
|
||||
/* relate to BTM_LE_AUTH_xxx in stack/btm_api.h */
|
||||
#define ESP_LE_AUTH_NO_BOND 0x00 /*!< 0*/ /* relate to BTM_LE_AUTH_NO_BOND in stack/btm_api.h */
|
||||
#define ESP_LE_AUTH_BOND 0x01 /*!< 1 << 0 */ /* relate to BTM_LE_AUTH_BOND in stack/btm_api.h */
|
||||
#define ESP_LE_AUTH_REQ_MITM (1 << 2) /*!< 1 << 2 */ /* relate to BTM_LE_AUTH_REQ_MITM in stack/btm_api.h */
|
||||
#define ESP_LE_AUTH_REQ_BOND_MITM (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_MITM)/*!< 0101*/
|
||||
#define ESP_LE_AUTH_REQ_SC_ONLY (1 << 3) /*!< 1 << 3 */ /* relate to BTM_LE_AUTH_REQ_SC_ONLY in stack/btm_api.h */
|
||||
#define ESP_LE_AUTH_REQ_SC_BOND (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1001 */ /* relate to BTM_LE_AUTH_REQ_SC_BOND in stack/btm_api.h */
|
||||
#define ESP_LE_AUTH_REQ_SC_MITM (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1100 */ /* relate to BTM_LE_AUTH_REQ_SC_MITM in stack/btm_api.h */
|
||||
#define ESP_LE_AUTH_REQ_SC_MITM_BOND (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY | ESP_LE_AUTH_BOND) /*!< 1101 */ /* relate to BTM_LE_AUTH_REQ_SC_MITM_BOND in stack/btm_api.h */
|
||||
/// relate to BTM_LE_AUTH_xxx in stack/btm_api.h
|
||||
#define ESP_LE_AUTH_NO_BOND 0x00 /*!< 0 no bondingv*/
|
||||
#define ESP_LE_AUTH_BOND 0x01 /*!< 1 << 0 device in the bonding with peer */
|
||||
#define ESP_LE_AUTH_REQ_MITM (1 << 2) /*!< 1 << 2 man in the middle attack */
|
||||
#define ESP_LE_AUTH_REQ_BOND_MITM (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_MITM) /*!< 0101 banding with man in the middle attack */
|
||||
#define ESP_LE_AUTH_REQ_SC_ONLY (1 << 3) /*!< 1 << 3 secure connection */
|
||||
#define ESP_LE_AUTH_REQ_SC_BOND (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1001 secure connection with band*/
|
||||
#define ESP_LE_AUTH_REQ_SC_MITM (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1100 secure conn with MITM */
|
||||
#define ESP_LE_AUTH_REQ_SC_MITM_BOND (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY | ESP_LE_AUTH_BOND) /*!< 1101 SC with MITM and Bonding*/
|
||||
typedef uint8_t esp_ble_auth_req_t; /*!< combination of the above bit pattern */
|
||||
|
||||
#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_DISABLE 0
|
||||
#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_ENABLE 1
|
||||
#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_DISABLE 0 /*!< authentication disable*/
|
||||
#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_ENABLE 1 /*!< authentication enable*/
|
||||
|
||||
#define ESP_BLE_OOB_DISABLE 0
|
||||
#define ESP_BLE_OOB_ENABLE 1
|
||||
#define ESP_BLE_OOB_DISABLE 0 /*!< disbale the out of bond*/
|
||||
#define ESP_BLE_OOB_ENABLE 1 /*!< enable the out of bond*/
|
||||
|
||||
/* relate to BTM_IO_CAP_xxx in stack/btm_api.h */
|
||||
#define ESP_IO_CAP_OUT 0 /*!< DisplayOnly */ /* relate to BTM_IO_CAP_OUT in stack/btm_api.h */
|
||||
#define ESP_IO_CAP_IO 1 /*!< DisplayYesNo */ /* relate to BTM_IO_CAP_IO in stack/btm_api.h */
|
||||
#define ESP_IO_CAP_IN 2 /*!< KeyboardOnly */ /* relate to BTM_IO_CAP_IN in stack/btm_api.h */
|
||||
#define ESP_IO_CAP_NONE 3 /*!< NoInputNoOutput */ /* relate to BTM_IO_CAP_NONE in stack/btm_api.h */
|
||||
#define ESP_IO_CAP_KBDISP 4 /*!< Keyboard display */ /* relate to BTM_IO_CAP_KBDISP in stack/btm_api.h */
|
||||
/// relate to BTM_IO_CAP_xxx in stack/btm_api.h
|
||||
#define ESP_IO_CAP_OUT 0 /*!< DisplayOnly */
|
||||
#define ESP_IO_CAP_IO 1 /*!< DisplayYesNo */
|
||||
#define ESP_IO_CAP_IN 2 /*!< KeyboardOnly */
|
||||
#define ESP_IO_CAP_NONE 3 /*!< NoInputNoOutput */
|
||||
#define ESP_IO_CAP_KBDISP 4 /*!< Keyboard display */
|
||||
|
||||
#define ESP_BLE_APPEARANCE_UNKNOWN 0x0000 /* relate to BTM_BLE_APPEARANCE_UNKNOWN in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_PHONE 0x0040 /* relate to BTM_BLE_APPEARANCE_GENERIC_PHONE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_COMPUTER 0x0080 /* relate to BTM_BLE_APPEARANCE_GENERIC_COMPUTER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_WATCH 0x00C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_WATCH in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_SPORTS_WATCH 0x00C1 /* relate to BTM_BLE_APPEARANCE_SPORTS_WATCH in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_CLOCK 0x0100 /* relate to BTM_BLE_APPEARANCE_GENERIC_CLOCK in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_DISPLAY 0x0140 /* relate to BTM_BLE_APPEARANCE_GENERIC_DISPLAY in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_REMOTE 0x0180 /* relate to BTM_BLE_APPEARANCE_GENERIC_REMOTE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_EYEGLASSES 0x01C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_EYEGLASSES in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_TAG 0x0200 /* relate to BTM_BLE_APPEARANCE_GENERIC_TAG in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_KEYRING 0x0240 /* relate to BTM_BLE_APPEARANCE_GENERIC_KEYRING in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280 /* relate to BTM_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_THERMOMETER 0x0300 /* relate to BTM_BLE_APPEARANCE_GENERIC_THERMOMETER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_THERMOMETER_EAR 0x0301 /* relate to BTM_BLE_APPEARANCE_THERMOMETER_EAR in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_HEART_RATE 0x0340 /* relate to BTM_BLE_APPEARANCE_GENERIC_HEART_RATE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HEART_RATE_BELT 0x0341 /* relate to BTM_BLE_APPEARANCE_HEART_RATE_BELT in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380 /* relate to BTM_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381 /* relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_ARM in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382 /* relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_HID 0x03C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_HID in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HID_KEYBOARD 0x03C1 /* relate to BTM_BLE_APPEARANCE_HID_KEYBOARD in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HID_MOUSE 0x03C2 /* relate to BTM_BLE_APPEARANCE_HID_MOUSE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HID_JOYSTICK 0x03C3 /* relate to BTM_BLE_APPEARANCE_HID_JOYSTICK in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HID_GAMEPAD 0x03C4 /* relate to BTM_BLE_APPEARANCE_HID_GAMEPAD in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HID_DIGITIZER_TABLET 0x03C5 /* relate to BTM_BLE_APPEARANCE_HID_DIGITIZER_TABLET in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HID_CARD_READER 0x03C6 /* relate to BTM_BLE_APPEARANCE_HID_CARD_READER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HID_DIGITAL_PEN 0x03C7 /* relate to BTM_BLE_APPEARANCE_HID_DIGITAL_PEN in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HID_BARCODE_SCANNER 0x03C8 /* relate to BTM_BLE_APPEARANCE_HID_BARCODE_SCANNER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_GLUCOSE 0x0400 /* relate to BTM_BLE_APPEARANCE_GENERIC_GLUCOSE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_WALKING 0x0440 /* relate to BTM_BLE_APPEARANCE_GENERIC_WALKING in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_WALKING_IN_SHOE 0x0441 /* relate to BTM_BLE_APPEARANCE_WALKING_IN_SHOE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_WALKING_ON_SHOE 0x0442 /* relate to BTM_BLE_APPEARANCE_WALKING_ON_SHOE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_WALKING_ON_HIP 0x0443 /* relate to BTM_BLE_APPEARANCE_WALKING_ON_HIP in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_CYCLING 0x0480 /* relate to BTM_BLE_APPEARANCE_GENERIC_CYCLING in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_CYCLING_COMPUTER 0x0481 /* relate to BTM_BLE_APPEARANCE_CYCLING_COMPUTER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_CYCLING_SPEED 0x0482 /* relate to BTM_BLE_APPEARANCE_CYCLING_SPEED in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_CYCLING_CADENCE 0x0483 /* relate to BTM_BLE_APPEARANCE_CYCLING_CADENCE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_CYCLING_POWER 0x0484 /* relate to BTM_BLE_APPEARANCE_CYCLING_POWER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485 /* relate to BTM_BLE_APPEARANCE_CYCLING_SPEED_CADENCE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40 /* relate to BTM_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41 /* relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42 /* relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_WRIST in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_WEIGHT 0x0C80 /* relate to BTM_BLE_APPEARANCE_GENERIC_WEIGHT in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE 0x0CC0 /* relate to BTM_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_POWERED_WHEELCHAIR 0x0CC1 /* relate to BTM_BLE_APPEARANCE_POWERED_WHEELCHAIR in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_MOBILITY_SCOOTER 0x0CC2 /* relate to BTM_BLE_APPEARANCE_MOBILITY_SCOOTER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR 0x0D00 /* relate to BTM_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_INSULIN_PUMP 0x0D40 /* relate to BTM_BLE_APPEARANCE_GENERIC_INSULIN_PUMP in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP 0x0D41 /* relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP 0x0D44 /* relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_INSULIN_PEN 0x0D48 /* relate to BTM_BLE_APPEARANCE_INSULIN_PEN in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY 0x0D80 /* relate to BTM_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS 0x1440 /* relate to BTM_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION 0x1441 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV 0x1442 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD 0x1443 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV 0x1444 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_UNKNOWN 0x0000 /*!< relate to BTM_BLE_APPEARANCE_UNKNOWN in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_PHONE 0x0040 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_PHONE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_COMPUTER 0x0080 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_COMPUTER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_WATCH 0x00C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_WATCH in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_SPORTS_WATCH 0x00C1 /*!< relate to BTM_BLE_APPEARANCE_SPORTS_WATCH in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_CLOCK 0x0100 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_CLOCK in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_DISPLAY 0x0140 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_DISPLAY in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_REMOTE 0x0180 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_REMOTE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_EYEGLASSES 0x01C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_EYEGLASSES in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_TAG 0x0200 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_TAG in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_KEYRING 0x0240 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_KEYRING in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_THERMOMETER 0x0300 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_THERMOMETER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_THERMOMETER_EAR 0x0301 /*!< relate to BTM_BLE_APPEARANCE_THERMOMETER_EAR in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_HEART_RATE 0x0340 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_HEART_RATE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HEART_RATE_BELT 0x0341 /*!< relate to BTM_BLE_APPEARANCE_HEART_RATE_BELT in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381 /*!< relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_ARM in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382 /*!< relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_HID 0x03C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_HID in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HID_KEYBOARD 0x03C1 /*!< relate to BTM_BLE_APPEARANCE_HID_KEYBOARD in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HID_MOUSE 0x03C2 /*!< relate to BTM_BLE_APPEARANCE_HID_MOUSE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HID_JOYSTICK 0x03C3 /*!< relate to BTM_BLE_APPEARANCE_HID_JOYSTICK in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HID_GAMEPAD 0x03C4 /*!< relate to BTM_BLE_APPEARANCE_HID_GAMEPAD in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HID_DIGITIZER_TABLET 0x03C5 /*!< relate to BTM_BLE_APPEARANCE_HID_DIGITIZER_TABLET in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HID_CARD_READER 0x03C6 /*!< relate to BTM_BLE_APPEARANCE_HID_CARD_READER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HID_DIGITAL_PEN 0x03C7 /*!< relate to BTM_BLE_APPEARANCE_HID_DIGITAL_PEN in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_HID_BARCODE_SCANNER 0x03C8 /*!< relate to BTM_BLE_APPEARANCE_HID_BARCODE_SCANNER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_GLUCOSE 0x0400 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_GLUCOSE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_WALKING 0x0440 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_WALKING in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_WALKING_IN_SHOE 0x0441 /*!< relate to BTM_BLE_APPEARANCE_WALKING_IN_SHOE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_WALKING_ON_SHOE 0x0442 /*!< relate to BTM_BLE_APPEARANCE_WALKING_ON_SHOE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_WALKING_ON_HIP 0x0443 /*!< relate to BTM_BLE_APPEARANCE_WALKING_ON_HIP in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_CYCLING 0x0480 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_CYCLING in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_CYCLING_COMPUTER 0x0481 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_COMPUTER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_CYCLING_SPEED 0x0482 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_SPEED in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_CYCLING_CADENCE 0x0483 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_CADENCE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_CYCLING_POWER 0x0484 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_POWER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_SPEED_CADENCE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41 /*!< relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42 /*!< relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_WRIST in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_WEIGHT 0x0C80 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_WEIGHT in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE 0x0CC0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_POWERED_WHEELCHAIR 0x0CC1 /*!< relate to BTM_BLE_APPEARANCE_POWERED_WHEELCHAIR in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_MOBILITY_SCOOTER 0x0CC2 /*!< relate to BTM_BLE_APPEARANCE_MOBILITY_SCOOTER in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR 0x0D00 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_INSULIN_PUMP 0x0D40 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_INSULIN_PUMP in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP 0x0D41 /*!< relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP 0x0D44 /*!< relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_INSULIN_PEN 0x0D48 /*!< relate to BTM_BLE_APPEARANCE_INSULIN_PEN in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY 0x0D80 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS 0x1440 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION 0x1441 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV 0x1442 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD 0x1443 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV 0x1444 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV in stack/btm_ble_api.h */
|
||||
|
||||
typedef uint8_t esp_ble_io_cap_t; /*!< combination of the io capability */
|
||||
|
||||
@ -139,15 +137,15 @@ typedef enum {
|
||||
ESP_GAP_BLE_ADV_START_COMPLETE_EVT, /*!< When start advertising complete, the event comes */
|
||||
ESP_GAP_BLE_SCAN_START_COMPLETE_EVT, /*!< When start scan complete, the event comes */
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
ESP_GAP_BLE_AUTH_CMPL_EVT = 8, /* Authentication complete indication. */
|
||||
ESP_GAP_BLE_KEY_EVT, /* BLE key event for peer device keys */
|
||||
ESP_GAP_BLE_SEC_REQ_EVT, /* BLE security request */
|
||||
ESP_GAP_BLE_PASSKEY_NOTIF_EVT, /* passkey notification event */
|
||||
ESP_GAP_BLE_PASSKEY_REQ_EVT, /* passkey request event */
|
||||
ESP_GAP_BLE_OOB_REQ_EVT, /* OOB request event */
|
||||
ESP_GAP_BLE_LOCAL_IR_EVT, /* BLE local IR event */
|
||||
ESP_GAP_BLE_LOCAL_ER_EVT, /* BLE local ER event */
|
||||
ESP_GAP_BLE_NC_REQ_EVT, /* Numeric Comparison request event */
|
||||
ESP_GAP_BLE_AUTH_CMPL_EVT = 8, /*!< Authentication complete indication. */
|
||||
ESP_GAP_BLE_KEY_EVT, /*!< BLE key event for peer device keys */
|
||||
ESP_GAP_BLE_SEC_REQ_EVT, /*!< BLE security request */
|
||||
ESP_GAP_BLE_PASSKEY_NOTIF_EVT, /*!< passkey notification event */
|
||||
ESP_GAP_BLE_PASSKEY_REQ_EVT, /*!< passkey request event */
|
||||
ESP_GAP_BLE_OOB_REQ_EVT, /*!< OOB request event */
|
||||
ESP_GAP_BLE_LOCAL_IR_EVT, /*!< BLE local IR (identity Root 128-bit random static value used to generate Long Term Key) event */
|
||||
ESP_GAP_BLE_LOCAL_ER_EVT, /*!< BLE local ER (Encryption Root vakue used to genrate identity resolving key) event */
|
||||
ESP_GAP_BLE_NC_REQ_EVT, /*!< Numeric Comparison request event */
|
||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT, /*!< When stop adv complete, the event comes */
|
||||
ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT, /*!< When stop scan complete, the event comes */
|
||||
@ -166,45 +164,45 @@ typedef enum {
|
||||
#endif //#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
ESP_GAP_BLE_SET_CHANNELS_EVT = 29, /*!< When setting BLE channels complete, the event comes */
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
ESP_GAP_BLE_READ_PHY_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_SET_PREFERRED_DEFAULT_PHY_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_SET_PREFERRED_PHY_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_EXT_ADV_SET_RAND_ADDR_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_EXT_ADV_SET_PARAMS_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_EXT_ADV_DATA_SET_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_EXT_SCAN_RSP_DATA_SET_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_EXT_ADV_START_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_EXT_ADV_STOP_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_EXT_ADV_SET_REMOVE_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_EXT_ADV_SET_CLEAR_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_PERIODIC_ADV_SET_PARAMS_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_PERIODIC_ADV_DATA_SET_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_PERIODIC_ADV_START_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_PERIODIC_ADV_STOP_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_PERIODIC_ADV_CREATE_SYNC_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_CANCEL_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_TERMINATE_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_PERIODIC_ADV_ADD_DEV_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_PERIODIC_ADV_REMOVE_DEV_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_PERIODIC_ADV_CLEAR_DEV_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_SET_EXT_SCAN_PARAMS_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_EXT_SCAN_START_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_EXT_SCAN_STOP_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_PREFER_EXT_CONN_PARAMS_SET_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_PHY_UPDATE_COMPLETE_EVT,
|
||||
ESP_GAP_BLE_EXT_ADV_REPORT_EVT,
|
||||
ESP_GAP_BLE_SCAN_TIMEOUT_EVT,
|
||||
ESP_GAP_BLE_ADV_TERMINATED_EVT,
|
||||
ESP_GAP_BLE_SCAN_REQ_RECEIVED_EVT,
|
||||
ESP_GAP_BLE_CHANNEL_SELECT_ALGORITHM_EVT,
|
||||
ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT,
|
||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_LOST_EVT,
|
||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT,
|
||||
ESP_GAP_BLE_READ_PHY_COMPLETE_EVT, /*!< when reading phy complete, this event comes */
|
||||
ESP_GAP_BLE_SET_PREFERRED_DEFAULT_PHY_COMPLETE_EVT, /*!< when preferred default phy complete, this event comes */
|
||||
ESP_GAP_BLE_SET_PREFERRED_PHY_COMPLETE_EVT, /*!< when preferred phy complete , this event comes */
|
||||
ESP_GAP_BLE_EXT_ADV_SET_RAND_ADDR_COMPLETE_EVT, /*!< when extended set random address complete, the event comes */
|
||||
ESP_GAP_BLE_EXT_ADV_SET_PARAMS_COMPLETE_EVT, /*!< when extended advertising parameter complete, the event comes */
|
||||
ESP_GAP_BLE_EXT_ADV_DATA_SET_COMPLETE_EVT, /*!< when extended advertising data complete, the event comes */
|
||||
ESP_GAP_BLE_EXT_SCAN_RSP_DATA_SET_COMPLETE_EVT, /*!< when extended scan response data complete, the event comes */
|
||||
ESP_GAP_BLE_EXT_ADV_START_COMPLETE_EVT, /*!< when extended advertising start complete, the event comes */
|
||||
ESP_GAP_BLE_EXT_ADV_STOP_COMPLETE_EVT, /*!< when extended advertising stop complete, the event comes */
|
||||
ESP_GAP_BLE_EXT_ADV_SET_REMOVE_COMPLETE_EVT, /*!< when extended advertising set remove complete, the event comes */
|
||||
ESP_GAP_BLE_EXT_ADV_SET_CLEAR_COMPLETE_EVT, /*!< when extended advertising set clear complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_SET_PARAMS_COMPLETE_EVT, /*!< when periodic advertising parameter complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_DATA_SET_COMPLETE_EVT, /*!< when periodic advertising data complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_START_COMPLETE_EVT, /*!< when periodic advertising start complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_STOP_COMPLETE_EVT, /*!< when periodic advertising stop complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_CREATE_SYNC_COMPLETE_EVT, /*!< when periodic advertising create sync complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_CANCEL_COMPLETE_EVT, /*!< when extended advertising sync cancel complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_TERMINATE_COMPLETE_EVT, /*!< when extended advertising sync terminate complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_ADD_DEV_COMPLETE_EVT, /*!< when extended advertising add device complete , the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_REMOVE_DEV_COMPLETE_EVT, /*!< when extended advertising remove device complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_CLEAR_DEV_COMPLETE_EVT, /*!< when extended advertising clear device, the event comes */
|
||||
ESP_GAP_BLE_SET_EXT_SCAN_PARAMS_COMPLETE_EVT, /*!< when extended scan parameter complete, the event comes */
|
||||
ESP_GAP_BLE_EXT_SCAN_START_COMPLETE_EVT, /*!< when extended scan start complete, the event comes */
|
||||
ESP_GAP_BLE_EXT_SCAN_STOP_COMPLETE_EVT, /*!< when extended scan stop complete, the event comes */
|
||||
ESP_GAP_BLE_PREFER_EXT_CONN_PARAMS_SET_COMPLETE_EVT, /*!< when extended prefer connection parameter set complete, the event comes */
|
||||
ESP_GAP_BLE_PHY_UPDATE_COMPLETE_EVT, /*!< when ble phy update complete, the event comes */
|
||||
ESP_GAP_BLE_EXT_ADV_REPORT_EVT, /*!< when extended advertising report complete, the event comes */
|
||||
ESP_GAP_BLE_SCAN_TIMEOUT_EVT, /*!< when scan timeout complete, the event comes */
|
||||
ESP_GAP_BLE_ADV_TERMINATED_EVT, /*!< when advertising terminate data complete, the event comes */
|
||||
ESP_GAP_BLE_SCAN_REQ_RECEIVED_EVT, /*!< when scan req received complete, the event comes */
|
||||
ESP_GAP_BLE_CHANNEL_SELECT_ALGORITHM_EVT, /*!< when channel select algorithm complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT, /*!< when periodic report advertising complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_LOST_EVT, /*!< when periodic advertising sync lost complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT, /*!< when periodic advertising sync establish complete, the event comes */
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
ESP_GAP_BLE_EVT_MAX,
|
||||
ESP_GAP_BLE_EVT_MAX, /*!< when maximum advertising event complete, the event comes */
|
||||
} esp_gap_ble_cb_event_t;
|
||||
|
||||
#define ESP_GAP_BLE_CHANNELS_LEN 5
|
||||
#define ESP_GAP_BLE_CHANNELS_LEN 5 /*!< channel length*/
|
||||
typedef uint8_t esp_gap_ble_channels[ESP_GAP_BLE_CHANNELS_LEN];
|
||||
|
||||
/// This is the old name, just for backwards compatibility
|
||||
@ -288,46 +286,47 @@ typedef enum {
|
||||
|
||||
/* relate to BTA_DM_BLE_SEC_xxx in bta/bta_api.h */
|
||||
typedef enum {
|
||||
ESP_BLE_SEC_ENCRYPT = 1, /* relate to BTA_DM_BLE_SEC_ENCRYPT in bta/bta_api.h. If the device has already
|
||||
bonded, the stack will used LTK to encrypt with the remote device directly.
|
||||
ESP_BLE_SEC_ENCRYPT = 1, /*!< relate to BTA_DM_BLE_SEC_ENCRYPT in bta/bta_api.h. If the device has already
|
||||
bonded, the stack will used Long Term Key (LTK) to encrypt with the remote device directly.
|
||||
Else if the device hasn't bonded, the stack will used the default authentication request
|
||||
used the esp_ble_gap_set_security_param function set by the user. */
|
||||
ESP_BLE_SEC_ENCRYPT_NO_MITM, /* relate to BTA_DM_BLE_SEC_ENCRYPT_NO_MITM in bta/bta_api.h. If the device has already
|
||||
bonded, the stack will check the LTK Whether the authentication request has been met, if met, used the LTK
|
||||
to encrypt with the remote device directly, else Re-pair with the remote device.
|
||||
Else if the device hasn't bonded, the stack will used NO MITM authentication request in the current link instead of
|
||||
used the authreq in the esp_ble_gap_set_security_param function set by the user. */
|
||||
ESP_BLE_SEC_ENCRYPT_MITM, /* relate to BTA_DM_BLE_SEC_ENCRYPT_MITM in bta/bta_api.h. If the device has already
|
||||
bonded, the stack will check the LTK Whether the authentication request has been met, if met, used the LTK
|
||||
to encrypt with the remote device directly, else Re-pair with the remote device.
|
||||
Else if the device hasn't bonded, the stack will used MITM authentication request in the current link instead of
|
||||
used the authreq in the esp_ble_gap_set_security_param function set by the user. */
|
||||
ESP_BLE_SEC_ENCRYPT_NO_MITM, /*!< relate to BTA_DM_BLE_SEC_ENCRYPT_NO_MITM in bta/bta_api.h. If the device has been already
|
||||
bonded, the stack will check the LTK (Long Term Key) Whether the authentication request has been met, and if met, use the LTK
|
||||
to encrypt with the remote device directly, else re-pair with the remote device.
|
||||
Else if the device hasn't been bonded, the stack will use NO MITM authentication request in the current link instead of
|
||||
using the authreq in the esp_ble_gap_set_security_param function set by the user. */
|
||||
ESP_BLE_SEC_ENCRYPT_MITM, /*!< relate to BTA_DM_BLE_SEC_ENCRYPT_MITM in bta/bta_api.h. If the device has been already
|
||||
bonded, the stack will check the LTK (Long Term Key) whether the authentication request has been met, and if met, use the LTK
|
||||
to encrypt with the remote device directly, else re-pair with the remote device.
|
||||
Else if the device hasn't been bonded, the stack will use MITM authentication request in the current link instead of
|
||||
using the authreq in the esp_ble_gap_set_security_param function set by the user. */
|
||||
}esp_ble_sec_act_t;
|
||||
|
||||
typedef enum {
|
||||
ESP_BLE_SM_PASSKEY = 0,
|
||||
/* Authentication requirements of local device */
|
||||
/*!< Authentication requirements of local device */
|
||||
ESP_BLE_SM_AUTHEN_REQ_MODE,
|
||||
/* The IO capability of local device */
|
||||
/*!< The IO capability of local device */
|
||||
ESP_BLE_SM_IOCAP_MODE,
|
||||
/* Initiator Key Distribution/Generation */
|
||||
/*!< Initiator Key Distribution/Generation */
|
||||
ESP_BLE_SM_SET_INIT_KEY,
|
||||
/* Responder Key Distribution/Generation */
|
||||
/*!< Responder Key Distribution/Generation */
|
||||
ESP_BLE_SM_SET_RSP_KEY,
|
||||
/* Maximum Encryption key size to support */
|
||||
/*!< Maximum Encryption key size to support */
|
||||
ESP_BLE_SM_MAX_KEY_SIZE,
|
||||
/* Minimum Encryption key size requirement from Peer */
|
||||
/*!< Minimum Encryption key size requirement from Peer */
|
||||
ESP_BLE_SM_MIN_KEY_SIZE,
|
||||
/* Set static Passkey */
|
||||
/*!< Set static Passkey */
|
||||
ESP_BLE_SM_SET_STATIC_PASSKEY,
|
||||
/* Reset static Passkey */
|
||||
/*!< Reset static Passkey */
|
||||
ESP_BLE_SM_CLEAR_STATIC_PASSKEY,
|
||||
/* Accept only specified SMP Authentication requirement */
|
||||
/*!< Accept only specified SMP Authentication requirement */
|
||||
ESP_BLE_SM_ONLY_ACCEPT_SPECIFIED_SEC_AUTH,
|
||||
/* Enable/Disable OOB support */
|
||||
/*!< Enable/Disable OOB support */
|
||||
ESP_BLE_SM_OOB_SUPPORT,
|
||||
/* Appl encryption key size */
|
||||
/*!< Appl encryption key size */
|
||||
ESP_BLE_APP_ENC_KEY_SIZE,
|
||||
/*!< authentication max param */
|
||||
ESP_BLE_SM_MAX_PARAM,
|
||||
} esp_ble_sm_param_t;
|
||||
|
||||
@ -673,90 +672,97 @@ typedef uint8_t esp_duplicate_info_t[ESP_BD_ADDR_LEN];
|
||||
#endif //#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_NONCONN_NONSCANNABLE_UNDIRECTED (0 << 0) // Non-Connectable and Non-Scannable Undirected advertising
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE (1 << 0) // Connectable advertising
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE (1 << 1) // Scannable advertising
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED (1 << 2) // Directed advertising
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED (1 << 3) // High Duty Cycle Directed Connectable advertising (<= 3.75 ms Advertising Interval)
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY (1 << 4) // Use legacy advertising PDUs
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_ANON_ADV (1 << 5) // Omit advertiser's address from all PDUs ("anonymous advertising")
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_INCLUDE_TX_PWR (1 << 6) // Include TxPower in the extended header of the advertising PDU
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_MASK (0x7F) // Reserved for future use
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_NONCONN_NONSCANNABLE_UNDIRECTED (0 << 0) /*!< Non-Connectable and Non-Scannable Undirected advertising */
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE (1 << 0) /*!< Connectable advertising */
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE (1 << 1) /*!< Scannable advertising */
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED (1 << 2) /*!< Directed advertising */
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED (1 << 3) /*!< High Duty Cycle Directed Connectable advertising (<= 3.75 ms Advertising Interval) */
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY (1 << 4) /*!< Use legacy advertising PDUs */
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_ANON_ADV (1 << 5) /*!< Omit advertiser's address from all PDUs ("anonymous advertising") */
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_INCLUDE_TX_PWR (1 << 6) /*!< Include TxPower in the extended header of the advertising PDU */
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_MASK (0x7F) /*!< Reserved for future use */
|
||||
|
||||
/* If extended advertising PDU types are being used (bit 4 = 0) then:
|
||||
/*!< If extended advertising PDU types are being used (bit 4 = 0) then:
|
||||
The advertisement shall not be both connectable and scannable.
|
||||
High duty cycle directed connectable advertising (<= 3.75 ms advertising interval) shall not be used (bit 3 = 0)
|
||||
*/
|
||||
// ADV_IND
|
||||
/*!< ADV_IND */
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_IND (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\
|
||||
ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\
|
||||
ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE)
|
||||
// ADV_DIRECT_IND (low duty cycle)
|
||||
/*!< ADV_DIRECT_IND (low duty cycle) */
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_LD_DIR (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\
|
||||
ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\
|
||||
ESP_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED)
|
||||
// ADV_DIRECT_IND (high duty cycle)
|
||||
/*!< ADV_DIRECT_IND (high duty cycle) */
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_HD_DIR (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\
|
||||
ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\
|
||||
ESP_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED)
|
||||
// ADV_SCAN_IND
|
||||
/*!< ADV_SCAN_IND */
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_SCAN (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\
|
||||
ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE)
|
||||
// ADV_NONCONN_IND
|
||||
/*!< ADV_NONCONN_IND */
|
||||
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_NONCONN (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY)
|
||||
typedef uint16_t esp_ble_ext_adv_type_mask_t;
|
||||
|
||||
#define ESP_BLE_GAP_PHY_1M 1
|
||||
#define ESP_BLE_GAP_PHY_2M 2
|
||||
#define ESP_BLE_GAP_PHY_CODED 3
|
||||
#define ESP_BLE_GAP_PHY_1M 1 /*!< Secondery Advertisement PHY is LE1M */
|
||||
#define ESP_BLE_GAP_PHY_2M 2 /*!< Secondery Advertisement PHY is LE2M */
|
||||
#define ESP_BLE_GAP_PHY_CODED 3 /*!< Secondery Advertisement PHY is LE Coded */
|
||||
typedef uint8_t esp_ble_gap_phy_t;
|
||||
|
||||
#define ESP_BLE_GAP_NO_PREFER_TRANSMIT_PHY (1<<0)
|
||||
#define ESP_BLE_GAP_NO_PREFER_RECEIVE_PHY (1<<1)
|
||||
#define ESP_BLE_GAP_NO_PREFER_TRANSMIT_PHY (1<<0) /*!< No Prefer TX PHY supported by controller */
|
||||
#define ESP_BLE_GAP_NO_PREFER_RECEIVE_PHY (1<<1) /*!< No Prefer RX PHY supported by controller */
|
||||
typedef uint8_t esp_ble_gap_all_phys_t;
|
||||
|
||||
// Primary phy only support 1M and LE coded phy
|
||||
#define ESP_BLE_GAP_PRI_PHY_1M ESP_BLE_GAP_PHY_1M
|
||||
#define ESP_BLE_GAP_PRI_PHY_CODED ESP_BLE_GAP_PHY_CODED
|
||||
/// Primary phy only support 1M and LE coded phy
|
||||
#define ESP_BLE_GAP_PRI_PHY_1M ESP_BLE_GAP_PHY_1M /*!< Primary Phy is LE1M */
|
||||
#define ESP_BLE_GAP_PRI_PHY_CODED ESP_BLE_GAP_PHY_CODED /*!< Primary Phy is LE CODED */
|
||||
typedef uint8_t esp_ble_gap_pri_phy_t; // primary phy
|
||||
|
||||
#define ESP_BLE_GAP_PHY_1M_PREF_MASK (1 << 0)
|
||||
#define ESP_BLE_GAP_PHY_2M_PREF_MASK (1 << 1)
|
||||
#define ESP_BLE_GAP_PHY_CODED_PREF_MASK (1 << 2)
|
||||
#define ESP_BLE_GAP_PHY_1M_PREF_MASK (1 << 0) /*!< The Host prefers use the LE1M transmitter or reciever PHY */
|
||||
#define ESP_BLE_GAP_PHY_2M_PREF_MASK (1 << 1) /*!< The Host prefers use the LE2M transmitter or reciever PHY */
|
||||
#define ESP_BLE_GAP_PHY_CODED_PREF_MASK (1 << 2) /*!< The Host prefers use the LE CODED transmitter or reciever PHY */
|
||||
typedef uint8_t esp_ble_gap_phy_mask_t;
|
||||
|
||||
#define ESP_BLE_GAP_PHY_OPTIONS_NO_PREF 0 // The Host has no preferred coding when transmitting on the LE Coded PHY
|
||||
#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S2_CODING 1 // The Host prefers that S=2 coding be used when transmitting on the LE Coded PHY
|
||||
#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S8_CODING 2 // The Host prefers that S=8 coding be used when transmitting on the LE Coded PHY
|
||||
#define ESP_BLE_GAP_PHY_OPTIONS_NO_PREF 0 /*!< The Host has no preferred coding when transmitting on the LE Coded PHY */
|
||||
#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S2_CODING 1 /*!< The Host prefers that S=2 coding be used when transmitting on the LE Coded PHY */
|
||||
#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S8_CODING 2 /*!< The Host prefers that S=8 coding be used when transmitting on the LE Coded PHY */
|
||||
typedef uint16_t esp_ble_gap_prefer_phy_options_t;
|
||||
|
||||
#define ESP_BLE_GAP_EXT_SCAN_CFG_UNCODE_MASK 0x01
|
||||
#define ESP_BLE_GAP_EXT_SCAN_CFG_CODE_MASK 0x02
|
||||
#define ESP_BLE_GAP_EXT_SCAN_CFG_UNCODE_MASK 0x01 /*!< Scan Advertisements on the LE1M PHY */
|
||||
#define ESP_BLE_GAP_EXT_SCAN_CFG_CODE_MASK 0x02 /*!< Scan advertisements on the LE coded PHY */
|
||||
typedef uint8_t esp_ble_ext_scan_cfg_mask_t;
|
||||
|
||||
#define ESP_BLE_GAP_EXT_ADV_DATA_COMPLETE 0x00
|
||||
#define ESP_BLE_GAP_EXT_ADV_DATA_INCOMPLETE 0x01
|
||||
#define ESP_BLE_GAP_EXT_ADV_DATA_TRUNCATED 0x02
|
||||
/// Advertising data
|
||||
#define ESP_BLE_GAP_EXT_ADV_DATA_COMPLETE 0x00 /*!< extended advertising data compete */
|
||||
#define ESP_BLE_GAP_EXT_ADV_DATA_INCOMPLETE 0x01 /*!< extended advertising data incomplete */
|
||||
#define ESP_BLE_GAP_EXT_ADV_DATA_TRUNCATED 0x02 /*!< extended advertising data truncated mode */
|
||||
typedef uint8_t esp_ble_gap_ext_adv_data_status_t;
|
||||
|
||||
#define ESP_BLE_GAP_SYNC_POLICY_BY_ADV_INFO 0
|
||||
#define ESP_BLE_GAP_SYNC_POLICY_BY_PERIODIC_LIST 1
|
||||
/// Advertising SYNC policy
|
||||
#define ESP_BLE_GAP_SYNC_POLICY_BY_ADV_INFO 0 /*!< sync policy by advertising info */
|
||||
#define ESP_BLE_GAP_SYNC_POLICY_BY_PERIODIC_LIST 1 /*!< periodic advertising sync policy */
|
||||
typedef uint8_t esp_ble_gap_sync_t;
|
||||
|
||||
/* Advertising report */
|
||||
#define ESP_BLE_ADV_REPORT_EXT_ADV_IND (1<<0)
|
||||
#define ESP_BLE_ADV_REPORT_EXT_SCAN_IND (1<<1)
|
||||
#define ESP_BLE_ADV_REPORT_EXT_DIRECT_ADV (1<<2)
|
||||
#define ESP_BLE_ADV_REPORT_EXT_SCAN_RSP (1<<3)
|
||||
/* Bluetooth 5.0, Vol 2, Part E, 7.7.65.13 */
|
||||
#define ESP_BLE_LEGACY_ADV_TYPE_IND (0x13)
|
||||
#define ESP_BLE_LEGACY_ADV_TYPE_DIRECT_IND (0x15)
|
||||
#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_IND (0x12)
|
||||
#define ESP_BLE_LEGACY_ADV_TYPE_NONCON_IND (0x10)
|
||||
#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_IND (0x1b)
|
||||
#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_SCAN_IND (0x1a)
|
||||
/// Advertising report
|
||||
#define ESP_BLE_ADV_REPORT_EXT_ADV_IND (1<<0) /*!< advertising report with extended advertising indication type */
|
||||
#define ESP_BLE_ADV_REPORT_EXT_SCAN_IND (1<<1) /*!< advertising report with extended scan indication type */
|
||||
#define ESP_BLE_ADV_REPORT_EXT_DIRECT_ADV (1<<2) /*!< advertising report with extended direct advertising indication type */
|
||||
#define ESP_BLE_ADV_REPORT_EXT_SCAN_RSP (1<<3) /*!< advertising report with extended scan response indication type */
|
||||
|
||||
/*!< Bluetooth 5.0, Vol 2, Part E, 7.7.65.13 */
|
||||
#define ESP_BLE_LEGACY_ADV_TYPE_IND (0x13) /*!< advertising report with legacy advertising indication type */
|
||||
#define ESP_BLE_LEGACY_ADV_TYPE_DIRECT_IND (0x15) /*!< advertising report with legacy direct indication type */
|
||||
#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_IND (0x12) /*!< advertising report with legacy scan indication type */
|
||||
#define ESP_BLE_LEGACY_ADV_TYPE_NONCON_IND (0x10) /*!< advertising report with legacy non connectable indication type */
|
||||
#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_IND (0x1b) /*!< advertising report with legacy scan response indication type */
|
||||
#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_SCAN_IND (0x1a) /*!< advertising report with legacy advertising with scan response indication type */
|
||||
|
||||
typedef uint8_t esp_ble_gap_adv_type_t;
|
||||
|
||||
/// Extend advertising tx power, range: [-127, +126] dBm
|
||||
#define EXT_ADV_TX_PWR_NO_PREFERENCE (127) /*!< host has no preference for tx power */
|
||||
|
||||
/**
|
||||
* @brief ext adv parameters
|
||||
*/
|
||||
@ -1754,8 +1760,8 @@ esp_err_t esp_ble_get_bond_device_list(int *dev_num, esp_ble_bond_dev_t *dev_lis
|
||||
* SMP in response to ESP_GAP_BLE_OOB_REQ_EVT
|
||||
*
|
||||
* @param[in] bd_addr: BD address of the peer device.
|
||||
* @param[in] TK: TK value, the TK value shall be a 128-bit random number
|
||||
* @param[in] len: length of tk, should always be 128-bit
|
||||
* @param[in] TK: Temporary Key value, the TK value shall be a 128-bit random number
|
||||
* @param[in] len: length of temporary key, should always be 128-bit
|
||||
*
|
||||
* @return - ESP_OK : success
|
||||
* - other : failed
|
||||
|
@ -18,7 +18,7 @@ extern "C" {
|
||||
/// GATT INVALID HANDLE
|
||||
#define ESP_GATT_ILLEGAL_HANDLE 0
|
||||
/// GATT attribute max handle
|
||||
#define ESP_GATT_ATTR_HANDLE_MAX 100
|
||||
#define ESP_GATT_ATTR_HANDLE_MAX UC_CONFIG_BT_GATT_MAX_SR_ATTRIBUTES
|
||||
#define ESP_GATT_MAX_READ_MULTI_HANDLES 10 /* Max attributes to read in one request */
|
||||
|
||||
|
||||
|
@ -351,7 +351,7 @@ esp_err_t esp_ble_gatts_create_service(esp_gatt_if_t gatts_if,
|
||||
*/
|
||||
esp_err_t esp_ble_gatts_create_attr_tab(const esp_gatts_attr_db_t *gatts_attr_db,
|
||||
esp_gatt_if_t gatts_if,
|
||||
uint8_t max_nb_attr,
|
||||
uint16_t max_nb_attr,
|
||||
uint8_t srvc_inst_id);
|
||||
/**
|
||||
* @brief This function is called to add an included service. This function have to be called between
|
||||
|
@ -2908,12 +2908,12 @@ static UINT8 bta_dm_authorize_cback (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NA
|
||||
|
||||
if (p_result && p_result->status == BTM_SUCCESS) {
|
||||
BCM_STRNCPY_S((char *)sec_event.cfm_req.bd_name, (char *)p_result->remote_bd_name, BD_NAME_LEN);
|
||||
sec_event.pin_req.bd_name[BD_NAME_LEN] = '\0';
|
||||
sec_event.cfm_req.bd_name[BD_NAME_LEN] = '\0';
|
||||
} else { /* No name found */
|
||||
sec_event.cfm_req.bd_name[0] = '\0';
|
||||
}
|
||||
|
||||
sec_event.key_notif.passkey = bta_dm_cb.num_val; /* get PIN code numeric number */
|
||||
sec_event.cfm_req.num_val = bta_dm_cb.num_val; /* get PIN code numeric number */
|
||||
|
||||
/* 1 additional event data fields for this event */
|
||||
sec_event.cfm_req.just_works = bta_dm_cb.just_works;
|
||||
|
@ -2820,6 +2820,7 @@ void BTA_DmBleGapExtAdvSetRemove(UINT8 instance)
|
||||
if ((p_msg = (tBTA_DM_API_BLE_EXT_ADV_SET_REMOVE *) osi_malloc(sizeof(tBTA_DM_API_BLE_EXT_ADV_SET_REMOVE))) != NULL) {
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_BLE_EXT_ADV_SET_REMOVE));
|
||||
p_msg->hdr.event = BTA_DM_API_EXT_ADV_SET_REMOVE_EVT;
|
||||
p_msg->instance = instance;
|
||||
//start sent the msg to the bta system control moudle
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
|
@ -541,7 +541,6 @@ void bta_gattc_start_disc_char_dscp(UINT16 conn_id, tBTA_GATTC_SERV *p_srvc_cb)
|
||||
if (bta_gattc_discover_procedure(conn_id, p_srvc_cb, GATT_DISC_CHAR_DSCPT) != 0) {
|
||||
bta_gattc_char_dscpt_disc_cmpl(conn_id, p_srvc_cb);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void bta_gattc_update_include_service(const list_t *services) {
|
||||
@ -693,7 +692,9 @@ static void bta_gattc_char_dscpt_disc_cmpl(UINT16 conn_id, tBTA_GATTC_SERV *p_sr
|
||||
{
|
||||
tBTA_GATTC_ATTR_REC *p_rec = NULL;
|
||||
|
||||
if (--p_srvc_cb->total_char > 0) {
|
||||
/* Recursive function will cause BTU stack overflow when there are a large number of characteristic
|
||||
* without descriptor to discover. So replace it with while function */
|
||||
while (--p_srvc_cb->total_char > 0) {
|
||||
p_rec = p_srvc_cb->p_srvc_list + (++ p_srvc_cb->cur_char_idx);
|
||||
/* add the next characteristic into cache */
|
||||
bta_gattc_add_char_to_cache (p_srvc_cb,
|
||||
@ -701,11 +702,14 @@ static void bta_gattc_char_dscpt_disc_cmpl(UINT16 conn_id, tBTA_GATTC_SERV *p_sr
|
||||
p_rec->s_handle,
|
||||
&p_rec->uuid,
|
||||
p_rec->property);
|
||||
/* start to discover next characteristic for descriptor */
|
||||
if (bta_gattc_discover_procedure(conn_id, p_srvc_cb, GATT_DISC_CHAR_DSCPT) == 0) {
|
||||
/* send att req and wait for att rsp */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* start discoverying next characteristic for char descriptor */
|
||||
bta_gattc_start_disc_char_dscp(conn_id, p_srvc_cb);
|
||||
} else
|
||||
/* all characteristic has been explored, start with next service if any */
|
||||
if (p_srvc_cb->total_char == 0) /* all characteristic has been explored, start with next service if any */
|
||||
{
|
||||
#if (defined BTA_GATT_DEBUG && BTA_GATT_DEBUG == TRUE)
|
||||
APPL_TRACE_ERROR("all char has been explored");
|
||||
@ -772,7 +776,7 @@ static tBTA_GATT_STATUS bta_gattc_add_srvc_to_list(tBTA_GATTC_SERV *p_srvc_cb,
|
||||
/* allocate bigger buffer ?? */
|
||||
status = GATT_DB_FULL;
|
||||
|
||||
APPL_TRACE_ERROR("service not added, no resources or wrong state");
|
||||
APPL_TRACE_ERROR("service not added, no resources or wrong state, see CONFIG_BT_GATTC_MAX_CACHE_CHAR");
|
||||
}
|
||||
return status;
|
||||
}
|
||||
@ -814,7 +818,7 @@ static tBTA_GATT_STATUS bta_gattc_add_char_to_list(tBTA_GATTC_SERV *p_srvc_cb,
|
||||
}
|
||||
p_srvc_cb->next_avail_idx ++;
|
||||
} else {
|
||||
APPL_TRACE_ERROR("char not added, no resources");
|
||||
APPL_TRACE_ERROR("char not added, no resources, see CONFIG_BT_GATTC_MAX_CACHE_CHAR");
|
||||
/* allocate bigger buffer ?? */
|
||||
status = BTA_GATT_DB_FULL;
|
||||
}
|
||||
|
@ -270,7 +270,6 @@ typedef struct {
|
||||
} tBTA_GATTC_ATTR_REC;
|
||||
|
||||
|
||||
#define BTA_GATTC_MAX_CACHE_CHAR 40
|
||||
#define BTA_GATTC_ATTR_LIST_SIZE (BTA_GATTC_MAX_CACHE_CHAR * sizeof(tBTA_GATTC_ATTR_REC))
|
||||
|
||||
#ifndef BTA_GATTC_CACHE_SRVR_SIZE
|
||||
@ -305,10 +304,10 @@ typedef struct {
|
||||
|
||||
tBTA_GATTC_ATTR_REC *p_srvc_list;
|
||||
UINT8 cur_srvc_idx;
|
||||
UINT8 cur_char_idx;
|
||||
UINT8 next_avail_idx;
|
||||
UINT16 cur_char_idx;
|
||||
UINT16 next_avail_idx;
|
||||
UINT8 total_srvc;
|
||||
UINT8 total_char;
|
||||
UINT16 total_char;
|
||||
UINT16 total_attr;
|
||||
UINT8 srvc_hdl_chg; /* service handle change indication pending */
|
||||
UINT16 attr_index; /* cahce NV saving/loading attribute index */
|
||||
|
@ -1469,7 +1469,7 @@ typedef struct {
|
||||
tBLE_ADDR_TYPE peer_addr_type;
|
||||
BD_ADDR peer_addr;
|
||||
tBTA_BLE_AFP filter_policy;
|
||||
UINT8 tx_power;
|
||||
INT8 tx_power;
|
||||
tBTA_DM_BLE_GAP_PHY primary_phy;
|
||||
UINT8 max_skip;
|
||||
tBTA_DM_BLE_GAP_PHY secondary_phy;
|
||||
|
@ -104,7 +104,8 @@ void btc_dm_sec_evt(tBTA_DM_SEC_EVT event, tBTA_DM_SEC *data)
|
||||
msg.pid = BTC_PID_DM_SEC;
|
||||
msg.act = event;
|
||||
|
||||
btc_transfer_context(&msg, (btc_dm_sec_args_t *)data, sizeof(btc_dm_sec_args_t), btc_dm_sec_arg_deep_copy);
|
||||
btc_transfer_context(&msg, (btc_dm_sec_args_t *)data,
|
||||
data == NULL ? 0 : sizeof(btc_dm_sec_args_t), btc_dm_sec_arg_deep_copy);
|
||||
}
|
||||
|
||||
static void btc_enable_bluetooth_evt(tBTA_STATUS status)
|
||||
|
@ -415,7 +415,8 @@ static void btc_a2dp_sink_handle_decoder_reset(tBTC_MEDIA_SINK_CFG_UPDATE *p_msg
|
||||
a2dp_sink_local_param.btc_aa_snk_cb.rx_flush = FALSE;
|
||||
APPL_TRACE_EVENT("Reset to sink role");
|
||||
status = OI_CODEC_SBC_DecoderReset(&a2dp_sink_local_param.context, a2dp_sink_local_param.contextData,
|
||||
sizeof(a2dp_sink_local_param.contextData), 2, 2, FALSE, FALSE);
|
||||
sizeof(a2dp_sink_local_param.contextData), a2dp_sink_local_param.btc_aa_snk_cb.channel_count,
|
||||
a2dp_sink_local_param.btc_aa_snk_cb.channel_count, FALSE, FALSE);
|
||||
if (!OI_SUCCESS(status)) {
|
||||
APPL_TRACE_ERROR("OI_CODEC_SBC_DecoderReset failed with error code %d\n", status);
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ void btc_gatts_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||
break;
|
||||
}
|
||||
case BTC_GATTS_ACT_CREATE_ATTR_TAB: {
|
||||
uint8_t num_attr = src->create_attr_tab.max_nb_attr;
|
||||
uint16_t num_attr = src->create_attr_tab.max_nb_attr;
|
||||
if (src->create_attr_tab.gatts_attr_db && (num_attr > 0)) {
|
||||
dst->create_attr_tab.gatts_attr_db = (esp_gatts_attr_db_t *) osi_malloc(sizeof(esp_gatts_attr_db_t) * num_attr);
|
||||
if (dst->create_attr_tab.gatts_attr_db) {
|
||||
@ -217,7 +217,7 @@ void btc_gatts_arg_deep_free(btc_msg_t *msg)
|
||||
|
||||
static void btc_gatts_act_create_attr_tab(esp_gatts_attr_db_t *gatts_attr_db,
|
||||
esp_gatt_if_t gatts_if,
|
||||
uint8_t max_nb_attr,
|
||||
uint16_t max_nb_attr,
|
||||
uint8_t srvc_inst_id)
|
||||
{
|
||||
uint16_t uuid = 0;
|
||||
@ -568,24 +568,24 @@ static void btc_gatts_inter_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
|
||||
//save the service handle to the btc module after used
|
||||
//the attribute table method to creat a service
|
||||
bta_to_btc_uuid(&btc_creat_tab_env.svc_uuid, &p_data->create.uuid);
|
||||
uint8_t index = btc_creat_tab_env.handle_idx;
|
||||
uint16_t index = btc_creat_tab_env.handle_idx;
|
||||
btc_creat_tab_env.svc_start_hdl = p_data->create.service_id;
|
||||
btc_creat_tab_env.handles[index] = p_data->create.service_id;
|
||||
break;
|
||||
}
|
||||
case BTA_GATTS_ADD_INCL_SRVC_EVT: {
|
||||
uint8_t index = btc_creat_tab_env.handle_idx;
|
||||
uint16_t index = btc_creat_tab_env.handle_idx;
|
||||
btc_creat_tab_env.handles[index] = p_data->add_result.attr_id;
|
||||
break;
|
||||
}
|
||||
case BTA_GATTS_ADD_CHAR_EVT: {
|
||||
uint8_t index = btc_creat_tab_env.handle_idx;
|
||||
uint16_t index = btc_creat_tab_env.handle_idx;
|
||||
btc_creat_tab_env.handles[index] = p_data->add_result.attr_id - 1;
|
||||
btc_creat_tab_env.handles[index+1] = p_data->add_result.attr_id;
|
||||
break;
|
||||
}
|
||||
case BTA_GATTS_ADD_CHAR_DESCR_EVT: {
|
||||
uint8_t index = btc_creat_tab_env.handle_idx;
|
||||
uint16_t index = btc_creat_tab_env.handle_idx;
|
||||
btc_creat_tab_env.handles[index] = p_data->add_result.attr_id;
|
||||
break;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ typedef union {
|
||||
struct create_attr_tab_args{
|
||||
esp_gatt_if_t gatts_if;
|
||||
uint8_t srvc_inst_id;
|
||||
uint8_t max_nb_attr;
|
||||
uint16_t max_nb_attr;
|
||||
esp_gatts_attr_db_t *gatts_attr_db;
|
||||
}create_attr_tab;
|
||||
|
||||
@ -149,8 +149,8 @@ typedef struct {
|
||||
esp_bt_uuid_t svc_uuid;
|
||||
bool is_tab_creat_svc;
|
||||
bool is_use_svc;
|
||||
uint8_t num_handle;
|
||||
uint8_t handle_idx;
|
||||
uint16_t num_handle;
|
||||
uint16_t handle_idx;
|
||||
uint16_t handles[ESP_GATT_ATTR_HANDLE_MAX];
|
||||
} esp_btc_creat_tab_t;
|
||||
|
||||
|
@ -134,6 +134,12 @@
|
||||
#endif
|
||||
|
||||
//GATTC CACHE
|
||||
#ifdef CONFIG_BT_GATTC_MAX_CACHE_CHAR
|
||||
#define UC_BT_GATTC_MAX_CACHE_CHAR CONFIG_BT_GATTC_MAX_CACHE_CHAR
|
||||
#else
|
||||
#define UC_BT_GATTC_MAX_CACHE_CHAR 40
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_GATTC_CACHE_NVS_FLASH
|
||||
#define UC_BT_GATTC_CACHE_NVS_FLASH_ENABLED CONFIG_BT_GATTC_CACHE_NVS_FLASH
|
||||
#else
|
||||
@ -258,6 +264,11 @@
|
||||
#define UC_CONFIG_BT_GATT_MAX_SR_PROFILES 8
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_GATT_MAX_SR_ATTRIBUTES
|
||||
#define UC_CONFIG_BT_GATT_MAX_SR_ATTRIBUTES CONFIG_BT_GATT_MAX_SR_ATTRIBUTES
|
||||
#else
|
||||
#define UC_CONFIG_BT_GATT_MAX_SR_ATTRIBUTES 100
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE
|
||||
#define UC_BT_GATTS_SEND_SERVICE_CHANGE_MODE CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE
|
||||
|
@ -21,7 +21,6 @@
|
||||
#define BT_TARGET_H
|
||||
|
||||
#include <bt_common.h>
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
#ifndef BUILDCFG
|
||||
#define BUILDCFG
|
||||
@ -278,11 +277,6 @@
|
||||
#define BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT UC_BT_BLE_ESTAB_LINK_CONN_TOUT
|
||||
#endif
|
||||
|
||||
#ifdef SOC_BLE_DONT_UPDATE_OWN_RPA
|
||||
#define BLE_UPDATE_BLE_ADDR_TYPE_RPA FALSE
|
||||
#else
|
||||
#define BLE_UPDATE_BLE_ADDR_TYPE_RPA TRUE
|
||||
#endif
|
||||
//------------------Added from bdroid_buildcfg.h---------------------
|
||||
#ifndef L2CAP_EXTFEA_SUPPORTED_MASK
|
||||
#define L2CAP_EXTFEA_SUPPORTED_MASK (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | L2CAP_EXTFEA_FIXED_CHNLS)
|
||||
@ -1203,15 +1197,27 @@
|
||||
#endif
|
||||
|
||||
#ifndef BTM_BLE_ADV_TX_POWER
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||
#define BTM_BLE_ADV_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9}
|
||||
#else
|
||||
#define BTM_BLE_ADV_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 21}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef BTM_TX_POWER
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||
#define BTM_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9}
|
||||
#else
|
||||
#define BTM_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 21}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef BTM_TX_POWER_LEVEL_MAX
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||
#define BTM_TX_POWER_LEVEL_MAX 7
|
||||
#else
|
||||
#define BTM_TX_POWER_LEVEL_MAX 15
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@ -2241,6 +2247,10 @@ The maximum number of payload octets that the local device can receive in a sing
|
||||
#define BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY FALSE
|
||||
#endif
|
||||
|
||||
#ifndef BTA_GATTC_MAX_CACHE_CHAR
|
||||
#define BTA_GATTC_MAX_CACHE_CHAR UC_BT_GATTC_MAX_CACHE_CHAR
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
** Tracing: Include trace header file here.
|
||||
|
@ -598,7 +598,7 @@ ble_hs_hci_rx_evt(uint8_t *hci_ev, void *arg)
|
||||
if(esp_bluedroid_get_status() == ESP_BLUEDROID_STATUS_UNINITIALIZED) {
|
||||
return 0;
|
||||
}
|
||||
uint8_t len = hci_ev[1] + 3;
|
||||
uint16_t len = hci_ev[1] + 3;
|
||||
uint8_t *data = (uint8_t *)malloc(len);
|
||||
data[0] = 0x04;
|
||||
memcpy(&data[1], hci_ev, len - 1);
|
||||
@ -608,22 +608,17 @@ ble_hs_hci_rx_evt(uint8_t *hci_ev, void *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void *trans_om;
|
||||
void hci_trans_free_mbuf(void)
|
||||
{
|
||||
os_mbuf_free_chain(trans_om);
|
||||
}
|
||||
|
||||
int
|
||||
ble_hs_rx_data(struct os_mbuf *om, void *arg)
|
||||
{
|
||||
uint8_t len = om->om_len + 1;
|
||||
uint16_t len = om->om_len + 1;
|
||||
uint8_t *data = (uint8_t *)malloc(len);
|
||||
data[0] = 0x02;
|
||||
memcpy(&data[1], om->om_data, len - 1);
|
||||
os_mbuf_copydata(om, 0, len - 1, &data[1]);
|
||||
host_recv_pkt_cb(data, len);
|
||||
trans_om = om;
|
||||
free(data);
|
||||
hci_trans_free_mbuf();
|
||||
os_mbuf_free_chain(om);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1990,7 +1990,7 @@ void btm_ble_conn_complete(UINT8 *p, UINT16 evt_len, BOOLEAN enhanced)
|
||||
}
|
||||
#if (BLE_PRIVACY_SPT == TRUE )
|
||||
peer_addr_type = bda_type;
|
||||
match = btm_identity_addr_to_random_pseudo (bda, &bda_type, TRUE);
|
||||
match = btm_identity_addr_to_random_pseudo (bda, &bda_type, FALSE);
|
||||
|
||||
/* possiblly receive connection complete with resolvable random on
|
||||
slave role while the device has been paired */
|
||||
|
@ -56,8 +56,9 @@ static void btm_gen_resolve_paddr_cmpl(tSMP_ENC *p)
|
||||
p_cb->private_addr[5] = p->param_buf[0];
|
||||
p_cb->private_addr[4] = p->param_buf[1];
|
||||
p_cb->private_addr[3] = p->param_buf[2];
|
||||
|
||||
/* set it to controller */
|
||||
btsnd_hcic_ble_set_random_addr(p_cb->private_addr);
|
||||
btm_ble_set_random_addr(p_cb->private_addr);
|
||||
|
||||
p_cb->exist_addr_bit |= BTM_BLE_GAP_ADDR_BIT_RESOLVABLE;
|
||||
memcpy(p_cb->resolvale_addr, p_cb->private_addr, BD_ADDR_LEN);
|
||||
@ -66,23 +67,6 @@ static void btm_gen_resolve_paddr_cmpl(tSMP_ENC *p)
|
||||
p_cb->set_local_privacy_cback = NULL;
|
||||
}
|
||||
|
||||
if (btm_cb.ble_ctr_cb.inq_var.adv_mode == BTM_BLE_ADV_ENABLE){
|
||||
BTM_TRACE_DEBUG("Advertise with new resolvable private address, now.");
|
||||
/**
|
||||
* Restart advertising, using new resolvable private address
|
||||
*/
|
||||
btm_ble_stop_adv();
|
||||
btm_ble_start_adv();
|
||||
}
|
||||
if (btm_cb.ble_ctr_cb.inq_var.state == BTM_BLE_SCANNING){
|
||||
BTM_TRACE_DEBUG("Scan with new resolvable private address, now.");
|
||||
/**
|
||||
* Restart scaning, using new resolvable private address
|
||||
*/
|
||||
btm_ble_stop_scan();
|
||||
btm_ble_start_scan();
|
||||
}
|
||||
|
||||
/* start a periodical timer to refresh random addr */
|
||||
btu_stop_timer_oneshot(&p_cb->raddr_timer_ent);
|
||||
#if (BTM_BLE_CONFORMANCE_TESTING == TRUE)
|
||||
|
@ -1018,9 +1018,7 @@ uint32_t BTM_BleUpdateOwnType(uint8_t *own_bda_type, tBTM_START_ADV_CMPL_CBACK *
|
||||
}
|
||||
} else if(*own_bda_type == BLE_ADDR_PUBLIC_ID || *own_bda_type == BLE_ADDR_RANDOM_ID) {
|
||||
if((btm_cb.ble_ctr_cb.addr_mgnt_cb.exist_addr_bit & BTM_BLE_GAP_ADDR_BIT_RESOLVABLE) == BTM_BLE_GAP_ADDR_BIT_RESOLVABLE) {
|
||||
#if (BLE_UPDATE_BLE_ADDR_TYPE_RPA)
|
||||
*own_bda_type = BLE_ADDR_RANDOM;
|
||||
#endif
|
||||
btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type = BLE_ADDR_RANDOM;
|
||||
memcpy(btm_cb.ble_ctr_cb.addr_mgnt_cb.private_addr, btm_cb.ble_ctr_cb.addr_mgnt_cb.resolvale_addr, BD_ADDR_LEN);
|
||||
btsnd_hcic_ble_set_random_addr(btm_cb.ble_ctr_cb.addr_mgnt_cb.resolvale_addr);
|
||||
@ -3675,21 +3673,20 @@ static void btm_ble_process_adv_pkt_cont(BD_ADDR bda, UINT8 addr_type, UINT8 evt
|
||||
0x04 Scan Response (SCAN_RSP)
|
||||
0x05-0xFF Reserved for future use
|
||||
*/
|
||||
//if scan duplicate is enabled, the adv packet without scan response is allowed to report to higher layer
|
||||
if(p_le_inq_cb->scan_duplicate_filter == BTM_BLE_SCAN_DUPLICATE_ENABLE) {
|
||||
/*
|
||||
Bluedroid will put the advertising packet and scan response into a packet and send it to the higher layer.
|
||||
If two advertising packets are not with the same address, or can't be combined into a packet, then the first advertising
|
||||
packet will be discarded. So we added the following judgment:
|
||||
1. For different addresses, send the last advertising packet to higher layer
|
||||
2. For same address and same advertising type (not scan response), send the last advertising packet to higher layer
|
||||
3. For same address and scan response, do nothing
|
||||
*/
|
||||
int same_addr = memcmp(bda, p_le_inq_cb->adv_addr, BD_ADDR_LEN);
|
||||
if (same_addr != 0 || (same_addr == 0 && evt_type != BTM_BLE_SCAN_RSP_EVT)) {
|
||||
btm_ble_process_last_adv_pkt();
|
||||
}
|
||||
}
|
||||
// The adv packet without scan response is allowed to report to higher layer
|
||||
/*
|
||||
Bluedroid will put the advertising packet and scan response into a packet and send it to the higher layer.
|
||||
If two advertising packets are not with the same address, or can't be combined into a packet, then the first advertising
|
||||
packet will be discarded. So we added the following judgment:
|
||||
1. For different addresses, send the last advertising packet to higher layer
|
||||
2. For same address and same advertising type (not scan response), send the last advertising packet to higher layer
|
||||
3. For same address and scan response, do nothing
|
||||
*/
|
||||
int same_addr = memcmp(bda, p_le_inq_cb->adv_addr, BD_ADDR_LEN);
|
||||
if (same_addr != 0 || (same_addr == 0 && evt_type != BTM_BLE_SCAN_RSP_EVT)) {
|
||||
btm_ble_process_last_adv_pkt();
|
||||
}
|
||||
|
||||
|
||||
p_i = btm_inq_db_find (bda);
|
||||
|
||||
@ -4121,6 +4118,59 @@ tBTM_STATUS btm_ble_stop_adv(void)
|
||||
return rt;
|
||||
}
|
||||
|
||||
tBTM_STATUS btm_ble_set_random_addr(BD_ADDR random_bda)
|
||||
{
|
||||
tBTM_STATUS rt = BTM_SUCCESS;
|
||||
|
||||
osi_mutex_lock(&adv_enable_lock, OSI_MUTEX_MAX_TIMEOUT);
|
||||
osi_mutex_lock(&scan_enable_lock, OSI_MUTEX_MAX_TIMEOUT);
|
||||
|
||||
if (btm_cb.ble_ctr_cb.inq_var.adv_mode == BTM_BLE_ADV_ENABLE) {
|
||||
if (btsnd_hcic_ble_set_adv_enable (BTM_BLE_ADV_DISABLE)) {
|
||||
osi_sem_take(&adv_enable_sem, OSI_SEM_MAX_TIMEOUT);
|
||||
rt = adv_enable_status;
|
||||
} else {
|
||||
rt = BTM_BAD_VALUE_RET;
|
||||
}
|
||||
}
|
||||
|
||||
if (BTM_BLE_IS_DISCO_ACTIVE(btm_cb.ble_ctr_cb.scan_activity)) {
|
||||
if (btsnd_hcic_ble_set_scan_enable (BTM_BLE_SCAN_DISABLE, BTM_BLE_SCAN_DUPLICATE_DISABLE)) {
|
||||
osi_sem_take(&scan_enable_sem, OSI_SEM_MAX_TIMEOUT);
|
||||
rt = scan_enable_status;
|
||||
} else {
|
||||
rt = BTM_BAD_VALUE_RET;
|
||||
}
|
||||
}
|
||||
|
||||
if (rt == BTM_SUCCESS) {
|
||||
btsnd_hcic_ble_set_random_addr(random_bda);
|
||||
}
|
||||
|
||||
if (btm_cb.ble_ctr_cb.inq_var.adv_mode == BTM_BLE_ADV_ENABLE) {
|
||||
if (btsnd_hcic_ble_set_adv_enable (BTM_BLE_ADV_ENABLE)) {
|
||||
osi_sem_take(&adv_enable_sem, OSI_SEM_MAX_TIMEOUT);
|
||||
rt = adv_enable_status;
|
||||
} else {
|
||||
rt = BTM_BAD_VALUE_RET;
|
||||
}
|
||||
}
|
||||
|
||||
if (BTM_BLE_IS_DISCO_ACTIVE(btm_cb.ble_ctr_cb.scan_activity)) {
|
||||
if (btsnd_hcic_ble_set_scan_enable (BTM_BLE_SCAN_ENABLE, btm_cb.ble_ctr_cb.inq_var.scan_duplicate_filter)) {
|
||||
osi_sem_take(&scan_enable_sem, OSI_SEM_MAX_TIMEOUT);
|
||||
rt = scan_enable_status;
|
||||
} else {
|
||||
rt = BTM_BAD_VALUE_RET;
|
||||
}
|
||||
}
|
||||
|
||||
osi_mutex_unlock(&adv_enable_lock);
|
||||
osi_mutex_unlock(&scan_enable_lock);
|
||||
|
||||
return rt;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@ -4250,10 +4300,11 @@ void btm_ble_read_remote_features_complete(UINT8 *p)
|
||||
btsnd_hcic_rmt_ver_req (p_acl_cb->hci_handle);
|
||||
}
|
||||
else{
|
||||
uint16_t data_length = controller_get_interface()->get_ble_default_data_packet_length();
|
||||
uint16_t data_txtime = controller_get_interface()->get_ble_default_data_packet_txtime();
|
||||
if (p_acl_cb->transport == BT_TRANSPORT_LE) {
|
||||
if (HCI_LE_DATA_LEN_EXT_SUPPORTED(p_acl_cb->peer_le_features)) {
|
||||
uint16_t data_length = controller_get_interface()->get_ble_default_data_packet_length();
|
||||
uint16_t data_txtime = controller_get_interface()->get_ble_default_data_packet_txtime();
|
||||
if (HCI_LE_DATA_LEN_EXT_SUPPORTED(p_acl_cb->peer_le_features) &&
|
||||
(p_acl_cb->data_length_params.tx_len != data_length)) {
|
||||
p_acl_cb->data_len_updating = true;
|
||||
btsnd_hcic_ble_set_data_length(p_acl_cb->hci_handle, data_length, data_txtime);
|
||||
}
|
||||
|
@ -240,12 +240,6 @@ BOOLEAN BTM_SecRegister(tBTM_APPL_INFO *p_cb_info)
|
||||
if (memcmp(btm_cb.devcb.id_keys.ir, &temp_value, sizeof(BT_OCTET16)) == 0) {
|
||||
btm_ble_reset_id();
|
||||
}
|
||||
#if (!BLE_UPDATE_BLE_ADDR_TYPE_RPA)
|
||||
BD_ADDR peer_addr = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
|
||||
BT_OCTET16 peer_irk = {0x0};
|
||||
/* add local irk to controller */
|
||||
btsnd_hcic_ble_add_device_resolving_list (0, peer_addr, peer_irk, btm_cb.devcb.id_keys.irk);
|
||||
#endif
|
||||
} else {
|
||||
BTM_TRACE_WARNING("%s p_cb_info->p_le_callback == NULL\n", __func__);
|
||||
}
|
||||
|
@ -419,6 +419,7 @@ tBTM_STATUS btm_ble_stop_adv(void);
|
||||
tBTM_STATUS btm_ble_start_scan(void);
|
||||
void btm_ble_create_ll_conn_complete (UINT8 status);
|
||||
void btm_ble_create_conn_cancel_complete (UINT8 *p);
|
||||
tBTM_STATUS btm_ble_set_random_addr(BD_ADDR random_bda);
|
||||
|
||||
/* LE security function from btm_sec.c */
|
||||
#if SMP_INCLUDED == TRUE
|
||||
|
@ -48,7 +48,7 @@
|
||||
#define BTU_TASK_STACK_SIZE (BT_BTU_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE)
|
||||
#define BTU_TASK_PRIO (BT_TASK_MAX_PRIORITIES - 5)
|
||||
#define BTU_TASK_NAME "BTU_TASK"
|
||||
#define BTU_TASK_WORKQUEUE_NUM (2)
|
||||
#define BTU_TASK_WORKQUEUE_NUM (1)
|
||||
#define BTU_TASK_WORKQUEUE0_LEN (0)
|
||||
|
||||
hash_map_t *btu_general_alarm_hash_map;
|
||||
|
@ -1214,7 +1214,7 @@ UINT8 btsnd_hcic_ble_set_extend_rand_address(UINT8 adv_handle, BD_ADDR rand_addr
|
||||
UINT8 btsnd_hcic_ble_set_ext_adv_params(UINT8 adv_handle, UINT16 properties, UINT32 interval_min,
|
||||
UINT32 interval_max, UINT8 channel_map, UINT8 own_addr_type,
|
||||
UINT8 peer_addr_type, BD_ADDR peer_addr,
|
||||
UINT8 adv_filter_policy, UINT8 adv_tx_power,
|
||||
UINT8 adv_filter_policy, INT8 adv_tx_power,
|
||||
UINT8 primary_adv_phy, UINT8 secondary_adv_max_skip,
|
||||
UINT8 secondary_adv_phy,
|
||||
UINT8 adv_sid, UINT8 scan_req_ntf_enable)
|
||||
@ -1244,7 +1244,7 @@ UINT8 btsnd_hcic_ble_set_ext_adv_params(UINT8 adv_handle, UINT16 properties, UIN
|
||||
UINT8_TO_STREAM(pp, peer_addr_type);
|
||||
BDADDR_TO_STREAM (pp, peer_addr);
|
||||
UINT8_TO_STREAM(pp, adv_filter_policy);
|
||||
UINT8_TO_STREAM(pp, adv_tx_power);
|
||||
INT8_TO_STREAM(pp, adv_tx_power);
|
||||
UINT8_TO_STREAM(pp, primary_adv_phy);
|
||||
UINT8_TO_STREAM(pp, secondary_adv_max_skip);
|
||||
UINT8_TO_STREAM(pp, secondary_adv_phy);
|
||||
|
@ -1176,7 +1176,7 @@ typedef void (tBTM_ESCO_CBACK) (tBTM_ESCO_EVT event, tBTM_ESCO_EVT_DATA *p_data)
|
||||
#define BTM_LKEY_TYPE_UNAUTH_COMB_P_256 HCI_LKEY_TYPE_UNAUTH_COMB_P_256
|
||||
#define BTM_LKEY_TYPE_AUTH_COMB_P_256 HCI_LKEY_TYPE_AUTH_COMB_P_256
|
||||
|
||||
#define BTM_LTK_DERIVED_LKEY_OFFSET 0x20 /* "easy" requirements for LK derived from LTK */
|
||||
#define BTM_LTK_DERIVED_LKEY_OFFSET 0x20 /* "easy" requirements for Link Key (LK) derived from Long Term Key */
|
||||
#define BTM_LKEY_TYPE_IGNORE 0xff /* used when event is response from
|
||||
hci return link keys request */
|
||||
|
||||
|
@ -385,7 +385,7 @@ typedef UINT8 tBTM_BLE_AD_TYPE;
|
||||
|
||||
/* adv tx power level */
|
||||
#define BTM_BLE_ADV_TX_POWER_MIN 0 /* minimum tx power */
|
||||
#define BTM_BLE_ADV_TX_POWER_MAX 7 /* maximum tx power */
|
||||
#define BTM_BLE_ADV_TX_POWER_MAX BTM_TX_POWER_LEVEL_MAX /* maximum tx power */
|
||||
typedef UINT8 tBTM_BLE_ADV_TX_POWER;
|
||||
|
||||
/* adv tx power in dBm */
|
||||
@ -767,7 +767,7 @@ typedef struct {
|
||||
tBLE_ADDR_TYPE peer_addr_type;
|
||||
BD_ADDR peer_addr;
|
||||
tBTM_BLE_AFP filter_policy;
|
||||
UINT8 tx_power;
|
||||
INT8 tx_power;
|
||||
tBTM_BLE_GAP_PHY primary_phy;
|
||||
UINT8 max_skip;
|
||||
tBTM_BLE_GAP_PHY secondary_phy;
|
||||
|
@ -962,7 +962,7 @@ UINT8 btsnd_hcic_ble_set_extend_rand_address(UINT8 adv_handle, BD_ADDR rand_addr
|
||||
UINT8 btsnd_hcic_ble_set_ext_adv_params(UINT8 adv_handle, UINT16 properties, UINT32 interval_min,
|
||||
UINT32 interval_max, UINT8 channel_map, UINT8 own_addr_type,
|
||||
UINT8 peer_addr_type, BD_ADDR peer_addr,
|
||||
UINT8 adv_filter_policy, UINT8 adv_tx_power,
|
||||
UINT8 adv_filter_policy, INT8 adv_tx_power,
|
||||
UINT8 primary_adv_phy, UINT8 secondary_adv_max_skip,
|
||||
UINT8 secondary_adv_phy,
|
||||
UINT8 adv_sid, UINT8 scan_req_ntf_enable);
|
||||
|
@ -2342,7 +2342,15 @@ void l2ble_update_att_acl_pkt_num(UINT8 type, tl2c_buff_param_t *param)
|
||||
xSemaphoreGive(buff_semaphore);
|
||||
break;
|
||||
}
|
||||
fixed_queue_t * queue = p_lcb->p_fixed_ccbs[L2CAP_ATT_CID - L2CAP_FIRST_FIXED_CHNL]->xmit_hold_q;
|
||||
|
||||
tL2C_CCB *p_ccb = p_lcb->p_fixed_ccbs[L2CAP_ATT_CID - L2CAP_FIRST_FIXED_CHNL];
|
||||
if(p_ccb == NULL) {
|
||||
L2CAP_TRACE_ERROR("%s not found p_ccb", __func__);
|
||||
xSemaphoreGive(buff_semaphore);
|
||||
break;
|
||||
}
|
||||
|
||||
fixed_queue_t * queue = p_ccb->xmit_hold_q;
|
||||
att_max_num = MIN(p_lcb->link_xmit_quota, L2CAP_CACHE_ATT_ACL_NUM);
|
||||
if (queue == NULL){
|
||||
L2CAP_TRACE_ERROR("%s not found queue", __func__);
|
||||
|
@ -240,7 +240,8 @@ config BT_NIMBLE_SVC_GAP_APPEARANCE
|
||||
menu "Memory Settings"
|
||||
config BT_NIMBLE_MSYS_1_BLOCK_COUNT
|
||||
int "MSYS_1 Block Count"
|
||||
default 12
|
||||
default 24 if SOC_ESP_NIMBLE_CONTROLLER
|
||||
default 12 if !SOC_ESP_NIMBLE_CONTROLLER
|
||||
help
|
||||
MSYS is a system level mbuf registry. For prepare write & prepare
|
||||
responses MBUFs are allocated out of msys_1 pool. For NIMBLE_MESH
|
||||
@ -249,7 +250,8 @@ menu "Memory Settings"
|
||||
|
||||
config BT_NIMBLE_MSYS_1_BLOCK_SIZE
|
||||
int "MSYS_1 Block Size"
|
||||
default 256
|
||||
default 128 if SOC_ESP_NIMBLE_CONTROLLER
|
||||
default 256 if !SOC_ESP_NIMBLE_CONTROLLER
|
||||
help
|
||||
Dynamic memory size of block 1
|
||||
|
||||
|
@ -350,7 +350,8 @@ static int host_rcv_pkt(uint8_t *data, uint16_t len)
|
||||
}
|
||||
|
||||
/* Allocate LE Advertising Report Event from lo pool only */
|
||||
if ((data[1] == BLE_HCI_EVCODE_LE_META) && (data[3] == BLE_HCI_LE_SUBEV_ADV_RPT)) {
|
||||
if ((data[1] == BLE_HCI_EVCODE_LE_META) &&
|
||||
(data[3] == BLE_HCI_LE_SUBEV_ADV_RPT || data[3] == BLE_HCI_LE_SUBEV_EXT_ADV_RPT)) {
|
||||
evbuf = ble_hci_trans_buf_alloc(BLE_HCI_TRANS_BUF_EVT_LO);
|
||||
/* Skip advertising report if we're out of memory */
|
||||
if (!evbuf) {
|
||||
|
Submodule components/bt/host/nimble/nimble updated: c1cb851c85...94adb077f2
@ -183,7 +183,7 @@ the adv packet will be discarded until the memory is restored. */
|
||||
.pcm_polar = CONFIG_BTDM_CTRL_PCM_POLAR_EFF, \
|
||||
.hli = BTDM_CTRL_HLI, \
|
||||
.magic = ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL, \
|
||||
};
|
||||
}
|
||||
|
||||
#else
|
||||
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() {0}; _Static_assert(0, "please enable bluetooth in menuconfig to use bt.h");
|
||||
|
@ -76,25 +76,34 @@ typedef enum {
|
||||
* @brief Bluetooth TX power level(index), it's just a index corresponding to power(dbm).
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_PWR_LVL_N27 = 0, /*!< Corresponding to -27dbm */
|
||||
ESP_PWR_LVL_N24 = 1, /*!< Corresponding to -24dbm */
|
||||
ESP_PWR_LVL_N21 = 2, /*!< Corresponding to -21dbm */
|
||||
ESP_PWR_LVL_N18 = 3, /*!< Corresponding to -18dbm */
|
||||
ESP_PWR_LVL_N15 = 4, /*!< Corresponding to -15dbm */
|
||||
ESP_PWR_LVL_N12 = 5, /*!< Corresponding to -12dbm */
|
||||
ESP_PWR_LVL_N9 = 6, /*!< Corresponding to -9dbm */
|
||||
ESP_PWR_LVL_N6 = 7, /*!< Corresponding to -6dbm */
|
||||
ESP_PWR_LVL_N3 = 8, /*!< Corresponding to -3dbm */
|
||||
ESP_PWR_LVL_N0 = 9, /*!< Corresponding to 0dbm */
|
||||
ESP_PWR_LVL_P3 = 10, /*!< Corresponding to +3dbm */
|
||||
ESP_PWR_LVL_P6 = 11, /*!< Corresponding to +6dbm */
|
||||
ESP_PWR_LVL_P9 = 12, /*!< Corresponding to +9dbm */
|
||||
ESP_PWR_LVL_P12 = 13, /*!< Corresponding to +12dbm */
|
||||
ESP_PWR_LVL_P15 = 14, /*!< Corresponding to +15dbm */
|
||||
ESP_PWR_LVL_P18 = 15, /*!< Corresponding to +18dbm */
|
||||
ESP_PWR_LVL_N24 = 0, /*!< Corresponding to -24dbm */
|
||||
ESP_PWR_LVL_N21 = 1, /*!< Corresponding to -21dbm */
|
||||
ESP_PWR_LVL_N18 = 2, /*!< Corresponding to -18dbm */
|
||||
ESP_PWR_LVL_N15 = 3, /*!< Corresponding to -15dbm */
|
||||
ESP_PWR_LVL_N12 = 4, /*!< Corresponding to -12dbm */
|
||||
ESP_PWR_LVL_N9 = 5, /*!< Corresponding to -9dbm */
|
||||
ESP_PWR_LVL_N6 = 6, /*!< Corresponding to -6dbm */
|
||||
ESP_PWR_LVL_N3 = 7, /*!< Corresponding to -3dbm */
|
||||
ESP_PWR_LVL_N0 = 8, /*!< Corresponding to 0dbm */
|
||||
ESP_PWR_LVL_P3 = 9, /*!< Corresponding to +3dbm */
|
||||
ESP_PWR_LVL_P6 = 10, /*!< Corresponding to +6dbm */
|
||||
ESP_PWR_LVL_P9 = 11, /*!< Corresponding to +9dbm */
|
||||
ESP_PWR_LVL_P12 = 12, /*!< Corresponding to +12dbm */
|
||||
ESP_PWR_LVL_P15 = 13, /*!< Corresponding to +15dbm */
|
||||
ESP_PWR_LVL_P18 = 14, /*!< Corresponding to +18dbm */
|
||||
ESP_PWR_LVL_P21 = 15, /*!< Corresponding to +21dbm */
|
||||
ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */
|
||||
} esp_power_level_t;
|
||||
|
||||
typedef enum {
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT = 0,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_ADV,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_SCAN,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_INIT,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_CONN,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_MAX,
|
||||
} esp_ble_enhanced_power_type_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t type;
|
||||
uint8_t val[6];
|
||||
@ -117,8 +126,26 @@ esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_
|
||||
*/
|
||||
esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type);
|
||||
|
||||
/**
|
||||
* @brief ENHANCED API for Setting BLE TX power
|
||||
* Connection Tx power should only be set after connection created.
|
||||
* @param power_type : The enhanced type of which tx power, could set Advertising/Connection/Default and etc
|
||||
* @param handle : The handle of Advertising or Connection and the value 0 for other enhanced power types.
|
||||
* @param power_level: Power level(index) corresponding to absolute value(dbm)
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle, esp_power_level_t power_level);
|
||||
|
||||
#define CONFIG_VERSION 0x20220729
|
||||
/**
|
||||
* @brief ENHANCED API of Getting BLE TX power
|
||||
* Connection Tx power should only be get after connection created.
|
||||
* @param power_type : The enhanced type of which tx power, could set Advertising/Connection/Default and etc
|
||||
* @param handle : The handle of Advertising or Connection and the value 0 for other enhanced power types.
|
||||
* @return >= 0 - Power level, < 0 - Invalid
|
||||
*/
|
||||
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
|
||||
|
||||
#define CONFIG_VERSION 0x20220824
|
||||
#define CONFIG_MAGIC 0x5A5AA5A5
|
||||
|
||||
/**
|
||||
@ -172,7 +199,9 @@ typedef struct {
|
||||
uint8_t sleep_en;
|
||||
uint8_t coex_phy_coded_tx_rx_time_limit;
|
||||
uint8_t dis_scan_backoff;
|
||||
uint8_t esp_scan_filter_en;
|
||||
uint8_t ble_scan_classify_filter_enable;
|
||||
uint8_t cca_drop_mode;
|
||||
int8_t cca_low_tx_pwr;
|
||||
uint8_t main_xtal_freq;
|
||||
uint32_t config_magic;
|
||||
} esp_bt_controller_config_t;
|
||||
@ -223,10 +252,10 @@ typedef struct {
|
||||
.sleep_en = NIMBLE_SLEEP_ENABLE, \
|
||||
.coex_phy_coded_tx_rx_time_limit = DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF, \
|
||||
.dis_scan_backoff = NIMBLE_DISABLE_SCAN_BACKOFF, \
|
||||
.esp_scan_filter_en = 0, \
|
||||
.main_xtal_freq = CONFIG_ESP32C2_XTAL_FREQ, \
|
||||
.ble_scan_classify_filter_enable = 0, \
|
||||
.main_xtal_freq = CONFIG_XTAL_FREQ, \
|
||||
.config_magic = CONFIG_MAGIC, \
|
||||
};
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg);
|
||||
|
||||
|
@ -192,13 +192,13 @@ extern "C" {
|
||||
|
||||
#define BLE_LL_CONN_DEF_AUTH_PYLD_TMO_N (3000)
|
||||
|
||||
#ifdef CONFIG_ESP32C2_XTAL_FREQ_26
|
||||
#ifdef CONFIG_XTAL_FREQ_26
|
||||
#define RTC_FREQ_N (40000) /* in Hz */
|
||||
#else
|
||||
#define RTC_FREQ_N (32000) /* in Hz */
|
||||
#endif // CONFIG_ESP32C2_XTAL_FREQ_26
|
||||
#endif // CONFIG_XTAL_FREQ_26
|
||||
|
||||
#define BLE_LL_TX_PWR_DBM_N (0)
|
||||
#define BLE_LL_TX_PWR_DBM_N (9)
|
||||
|
||||
|
||||
#define RUN_BQB_TEST (0)
|
||||
|
@ -181,7 +181,7 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
|
||||
.slave_ce_len_min = SLAVE_CE_LEN_MIN_DEFAULT, \
|
||||
.hw_recorrect_en = AGC_RECORRECT_EN, \
|
||||
.cca_thresh = CONFIG_BT_CTRL_HW_CCA_VAL, \
|
||||
};
|
||||
}
|
||||
|
||||
#else
|
||||
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() {0}; _Static_assert(0, "please enable bluetooth in menuconfig to use bt.h");
|
||||
@ -290,22 +290,22 @@ typedef enum {
|
||||
* @brief Bluetooth TX power level(index), it's just a index corresponding to power(dbm).
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_PWR_LVL_N27 = 0, /*!< Corresponding to -27dbm */
|
||||
ESP_PWR_LVL_N24 = 1, /*!< Corresponding to -24dbm */
|
||||
ESP_PWR_LVL_N21 = 2, /*!< Corresponding to -21dbm */
|
||||
ESP_PWR_LVL_N18 = 3, /*!< Corresponding to -18dbm */
|
||||
ESP_PWR_LVL_N15 = 4, /*!< Corresponding to -15dbm */
|
||||
ESP_PWR_LVL_N12 = 5, /*!< Corresponding to -12dbm */
|
||||
ESP_PWR_LVL_N9 = 6, /*!< Corresponding to -9dbm */
|
||||
ESP_PWR_LVL_N6 = 7, /*!< Corresponding to -6dbm */
|
||||
ESP_PWR_LVL_N3 = 8, /*!< Corresponding to -3dbm */
|
||||
ESP_PWR_LVL_N0 = 9, /*!< Corresponding to 0dbm */
|
||||
ESP_PWR_LVL_P3 = 10, /*!< Corresponding to +3dbm */
|
||||
ESP_PWR_LVL_P6 = 11, /*!< Corresponding to +6dbm */
|
||||
ESP_PWR_LVL_P9 = 12, /*!< Corresponding to +9dbm */
|
||||
ESP_PWR_LVL_P12 = 13, /*!< Corresponding to +12dbm */
|
||||
ESP_PWR_LVL_P15 = 14, /*!< Corresponding to +15dbm */
|
||||
ESP_PWR_LVL_P18 = 15, /*!< Corresponding to +18dbm */
|
||||
ESP_PWR_LVL_N24 = 0, /*!< Corresponding to -24dbm */
|
||||
ESP_PWR_LVL_N21 = 1, /*!< Corresponding to -21dbm */
|
||||
ESP_PWR_LVL_N18 = 2, /*!< Corresponding to -18dbm */
|
||||
ESP_PWR_LVL_N15 = 3, /*!< Corresponding to -15dbm */
|
||||
ESP_PWR_LVL_N12 = 4, /*!< Corresponding to -12dbm */
|
||||
ESP_PWR_LVL_N9 = 5, /*!< Corresponding to -9dbm */
|
||||
ESP_PWR_LVL_N6 = 6, /*!< Corresponding to -6dbm */
|
||||
ESP_PWR_LVL_N3 = 7, /*!< Corresponding to -3dbm */
|
||||
ESP_PWR_LVL_N0 = 8, /*!< Corresponding to 0dbm */
|
||||
ESP_PWR_LVL_P3 = 9, /*!< Corresponding to +3dbm */
|
||||
ESP_PWR_LVL_P6 = 10, /*!< Corresponding to +6dbm */
|
||||
ESP_PWR_LVL_P9 = 11, /*!< Corresponding to +9dbm */
|
||||
ESP_PWR_LVL_P12 = 12, /*!< Corresponding to +12dbm */
|
||||
ESP_PWR_LVL_P15 = 13, /*!< Corresponding to +15dbm */
|
||||
ESP_PWR_LVL_P18 = 14, /*!< Corresponding to +18dbm */
|
||||
ESP_PWR_LVL_P21 = 15, /*!< Corresponding to +21dbm */
|
||||
ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */
|
||||
} esp_power_level_t;
|
||||
|
||||
|
@ -227,7 +227,7 @@ typedef struct {
|
||||
.coex_phy_coded_tx_rx_time_limit = DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF, \
|
||||
.scan_classify_filter_enable = false, \
|
||||
.config_magic = CONFIG_MAGIC, \
|
||||
};
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg);
|
||||
|
||||
|
@ -180,7 +180,7 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
|
||||
.slave_ce_len_min = SLAVE_CE_LEN_MIN_DEFAULT, \
|
||||
.hw_recorrect_en = AGC_RECORRECT_EN, \
|
||||
.cca_thresh = CONFIG_BT_CTRL_HW_CCA_VAL, \
|
||||
};
|
||||
}
|
||||
|
||||
#else
|
||||
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() {0}; _Static_assert(0, "please enable bluetooth in menuconfig to use bt.h");
|
||||
@ -289,23 +289,23 @@ typedef enum {
|
||||
* @brief Bluetooth TX power level(index), it's just a index corresponding to power(dbm).
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_PWR_LVL_N27 = 0, /*!< Corresponding to -27dbm */
|
||||
ESP_PWR_LVL_N24 = 1, /*!< Corresponding to -24dbm */
|
||||
ESP_PWR_LVL_N21 = 2, /*!< Corresponding to -21dbm */
|
||||
ESP_PWR_LVL_N18 = 3, /*!< Corresponding to -18dbm */
|
||||
ESP_PWR_LVL_N15 = 4, /*!< Corresponding to -15dbm */
|
||||
ESP_PWR_LVL_N12 = 5, /*!< Corresponding to -12dbm */
|
||||
ESP_PWR_LVL_N9 = 6, /*!< Corresponding to -9dbm */
|
||||
ESP_PWR_LVL_N6 = 7, /*!< Corresponding to -6dbm */
|
||||
ESP_PWR_LVL_N3 = 8, /*!< Corresponding to -3dbm */
|
||||
ESP_PWR_LVL_N0 = 9, /*!< Corresponding to 0dbm */
|
||||
ESP_PWR_LVL_P3 = 10, /*!< Corresponding to +3dbm */
|
||||
ESP_PWR_LVL_P6 = 11, /*!< Corresponding to +6dbm */
|
||||
ESP_PWR_LVL_P9 = 12, /*!< Corresponding to +9dbm */
|
||||
ESP_PWR_LVL_P12 = 13, /*!< Corresponding to +12dbm */
|
||||
ESP_PWR_LVL_P15 = 14, /*!< Corresponding to +15dbm */
|
||||
ESP_PWR_LVL_P18 = 15, /*!< Corresponding to +18dbm */
|
||||
ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */
|
||||
ESP_PWR_LVL_N24 = 0, /*!< Corresponding to -24dbm */
|
||||
ESP_PWR_LVL_N21 = 1, /*!< Corresponding to -21dbm */
|
||||
ESP_PWR_LVL_N18 = 2, /*!< Corresponding to -18dbm */
|
||||
ESP_PWR_LVL_N15 = 3, /*!< Corresponding to -15dbm */
|
||||
ESP_PWR_LVL_N12 = 4, /*!< Corresponding to -12dbm */
|
||||
ESP_PWR_LVL_N9 = 5, /*!< Corresponding to -9dbm */
|
||||
ESP_PWR_LVL_N6 = 6, /*!< Corresponding to -6dbm */
|
||||
ESP_PWR_LVL_N3 = 7, /*!< Corresponding to -3dbm */
|
||||
ESP_PWR_LVL_N0 = 8, /*!< Corresponding to 0dbm */
|
||||
ESP_PWR_LVL_P3 = 9, /*!< Corresponding to +3dbm */
|
||||
ESP_PWR_LVL_P6 = 10, /*!< Corresponding to +6dbm */
|
||||
ESP_PWR_LVL_P9 = 11, /*!< Corresponding to +9dbm */
|
||||
ESP_PWR_LVL_P12 = 12, /*!< Corresponding to +12dbm */
|
||||
ESP_PWR_LVL_P15 = 13, /*!< Corresponding to +15dbm */
|
||||
ESP_PWR_LVL_P18 = 14, /*!< Corresponding to +18dbm */
|
||||
ESP_PWR_LVL_P21 = 15, /*!< Corresponding to +21dbm */
|
||||
ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */
|
||||
} esp_power_level_t;
|
||||
|
||||
/**
|
||||
|
@ -116,9 +116,10 @@ struct ble_mbuf_hdr_rxinfo
|
||||
struct ble_mbuf_hdr_txinfo
|
||||
{
|
||||
uint8_t flags;
|
||||
uint8_t offset;
|
||||
uint8_t reserve0;
|
||||
uint8_t pyld_len;
|
||||
uint8_t hdr_byte;
|
||||
uint16_t offset;
|
||||
};
|
||||
|
||||
struct ble_mbuf_hdr
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user