forked from espressif/esp-idf
Compare commits
942 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03d7a3807b | ||
|
|
9fe3bf2a3c | ||
|
|
b1e88e3f6e | ||
|
|
32d3bf7919 | ||
|
|
2d14933dbc | ||
|
|
2e387a71b0 | ||
|
|
112ce3f3a5 | ||
|
|
ab5576d91d | ||
|
|
259e8ab25b | ||
|
|
19919a2222 | ||
|
|
52333aeac9 | ||
|
|
1d611df0b5 | ||
|
|
a060a261ef | ||
|
|
c56fa7ce36 | ||
|
|
db287328bc | ||
|
|
bab64a98d8 | ||
|
|
3cab1a00bc | ||
|
|
893725dd40 | ||
|
|
0b71f8a2d2 | ||
|
|
606360d33d | ||
|
|
71ed11a7f0 | ||
|
|
b147fcad42 | ||
|
|
d8dd468631 | ||
|
|
69e7b56c48 | ||
|
|
32160c7b74 | ||
|
|
15825570a3 | ||
|
|
eaba52d7df | ||
|
|
893dac658e | ||
|
|
ae02cc7b7c | ||
|
|
85651c507f | ||
|
|
a8caeb9af4 | ||
|
|
0b740b3b80 | ||
|
|
cba997763d | ||
|
|
f97e379122 | ||
|
|
3bb601cee7 | ||
|
|
5f497153f7 | ||
|
|
94c90c71bc | ||
|
|
28224b3af5 | ||
|
|
20d82594d7 | ||
|
|
692952d60e | ||
|
|
a5c2e40416 | ||
|
|
457c00eead | ||
|
|
201608e590 | ||
|
|
de88da5370 | ||
|
|
2166b5986e | ||
|
|
5c1f5f2522 | ||
|
|
ead822e6ee | ||
|
|
d7667c79ef | ||
|
|
d587d24c43 | ||
|
|
7d87f56e35 | ||
|
|
2e833a6a12 | ||
|
|
73de32f29f | ||
|
|
2e5937286c | ||
|
|
5c4ddf2d83 | ||
|
|
1884afc9c4 | ||
|
|
c0dd50a35b | ||
|
|
09a9a9257d | ||
|
|
2e0d1508c4 | ||
|
|
d920052bf0 | ||
|
|
12ee01fc87 | ||
|
|
9998c2bd82 | ||
|
|
4c8502e00d | ||
|
|
ac5ce8d02d | ||
|
|
293cf4d332 | ||
|
|
e4a38c3cba | ||
|
|
1c0fb3bb4a | ||
|
|
08e4757764 | ||
|
|
1c261213d7 | ||
|
|
30cd76b0f0 | ||
|
|
977b7f4bdb | ||
|
|
c0a1d27858 | ||
|
|
fffc6f9328 | ||
|
|
8ae138e7be | ||
|
|
6c9c30f125 | ||
|
|
ea8b719288 | ||
|
|
5f1d3790cc | ||
|
|
c29f14e7b2 | ||
|
|
3fd3848932 | ||
|
|
207996eb68 | ||
|
|
6de1e945c8 | ||
|
|
a155523263 | ||
|
|
6383609e99 | ||
|
|
40f1ca7666 | ||
|
|
35f09a6ce6 | ||
|
|
13fdffbe98 | ||
|
|
6d77fe9b79 | ||
|
|
82aed29e59 | ||
|
|
a84ad081b2 | ||
|
|
50b49d856f | ||
|
|
cd242a5e3e | ||
|
|
6bf79dfa8f | ||
|
|
905da8f5bf | ||
|
|
8cc73fe6bf | ||
|
|
81350e30f3 | ||
|
|
4d4b89755c | ||
|
|
249468e5bc | ||
|
|
29a2249170 | ||
|
|
3405065ed5 | ||
|
|
856daf8a35 | ||
|
|
2542b74edd | ||
|
|
e42bcf2e88 | ||
|
|
33f8e6acea | ||
|
|
27acfa5377 | ||
|
|
ee53260db8 | ||
|
|
3239ef1c8e | ||
|
|
3937e35a08 | ||
|
|
4ee958df57 | ||
|
|
01c5d8d72e | ||
|
|
5460d41b43 | ||
|
|
1e69dbf6cf | ||
|
|
6ff708aa91 | ||
|
|
efef840124 | ||
|
|
34a6d8ebe7 | ||
|
|
44f7c7f6bb | ||
|
|
ef444d6a1b | ||
|
|
6a7e250442 | ||
|
|
3c1ec70457 | ||
|
|
f8500f77b1 | ||
|
|
d5a32fa5e8 | ||
|
|
403ad764c8 | ||
|
|
b2a4cf197e | ||
|
|
2d00212e19 | ||
|
|
98d617b0dc | ||
|
|
da2399a2c5 | ||
|
|
af91df9e6f | ||
|
|
a0c0857d94 | ||
|
|
1db67a7133 | ||
|
|
5402e14cfb | ||
|
|
ea93f7620b | ||
|
|
963284fc4c | ||
|
|
dbdd6c7eb8 | ||
|
|
d8a8149abd | ||
|
|
825f99f16e | ||
|
|
3f207efa4b | ||
|
|
ae755628d0 | ||
|
|
03732b50fd | ||
|
|
ea59318583 | ||
|
|
02089b1825 | ||
|
|
93e973fa21 | ||
|
|
2aa66f5188 | ||
|
|
c4affdb943 | ||
|
|
1f34bece78 | ||
|
|
b1e5ef2c47 | ||
|
|
5dafc957ef | ||
|
|
06ac8505b9 | ||
|
|
46f81cebe4 | ||
|
|
cc12adf71b | ||
|
|
973aca32be | ||
|
|
5d26770886 | ||
|
|
e9ee047908 | ||
|
|
4ae0dc38cc | ||
|
|
2b5f344a21 | ||
|
|
7135c2d1fa | ||
|
|
37d94af1f7 | ||
|
|
49f02b3b43 | ||
|
|
b784bbb27b | ||
|
|
a84c563c1e | ||
|
|
52112a9b91 | ||
|
|
52ff4707d8 | ||
|
|
912c1666ff | ||
|
|
f5e80b68c7 | ||
|
|
2a3d18c0cc | ||
|
|
c90353291c | ||
|
|
20a34298cf | ||
|
|
728cd2489a | ||
|
|
345accbe13 | ||
|
|
3d8915f2b3 | ||
|
|
21885a0cf9 | ||
|
|
27f1557d70 | ||
|
|
30f1c507d4 | ||
|
|
d6165c0859 | ||
|
|
336244a060 | ||
|
|
ea64b7cb1b | ||
|
|
5758407281 | ||
|
|
018e84599a | ||
|
|
b19e24ef01 | ||
|
|
fc96662044 | ||
|
|
0e99be11f0 | ||
|
|
89bf50f05a | ||
|
|
a6afbb38a4 | ||
|
|
f2da30262a | ||
|
|
4bd203b6da | ||
|
|
eb432da2db | ||
|
|
9d8b38bafd | ||
|
|
4f97598f7d | ||
|
|
8e5bd616be | ||
|
|
c2f6a5c180 | ||
|
|
d5fda4a286 | ||
|
|
7789d30686 | ||
|
|
883d7e793f | ||
|
|
ecdbdc789c | ||
|
|
dc85f670aa | ||
|
|
bde852d403 | ||
|
|
5293a3e403 | ||
|
|
6bfac2a6e4 | ||
|
|
bcb6a2f386 | ||
|
|
1f5e7e33df | ||
|
|
349bc1795c | ||
|
|
555891bb54 | ||
|
|
279e00927b | ||
|
|
e89e490565 | ||
|
|
2100dddaf1 | ||
|
|
8edd26b4f3 | ||
|
|
b57ff5dce6 | ||
|
|
d5bf0121ab | ||
|
|
4bd2b33d9b | ||
|
|
1e3bb1469a | ||
|
|
c06e48c02e | ||
|
|
231e822d03 | ||
|
|
60d9fd9e3a | ||
|
|
4ba42edafc | ||
|
|
674b533eed | ||
|
|
6875e2b7d0 | ||
|
|
0187f3b4e3 | ||
|
|
d2b9326df1 | ||
|
|
478ac965aa | ||
|
|
46c75fc31c | ||
|
|
c6588baf8f | ||
|
|
f3729b1610 | ||
|
|
b13e24f26c | ||
|
|
39674d11e0 | ||
|
|
3502d25a2e | ||
|
|
ab427cc1c0 | ||
|
|
a16c26c4ca | ||
|
|
cc746091a9 | ||
|
|
f333925342 | ||
|
|
6881b3fa33 | ||
|
|
22f31de902 | ||
|
|
ded1414d7b | ||
|
|
65e0356c3d | ||
|
|
dd16903b51 | ||
|
|
443f2b8ebe | ||
|
|
861410f4eb | ||
|
|
64ceda77f4 | ||
|
|
28ba29a95d | ||
|
|
8b7c87028b | ||
|
|
3d381ba560 | ||
|
|
e943bbda36 | ||
|
|
82563128c8 | ||
|
|
9ca65d9720 | ||
|
|
d5255c9ba8 | ||
|
|
39ea20354d | ||
|
|
5004647fb1 | ||
|
|
79e55b6e92 | ||
|
|
00d58a92dc | ||
|
|
9fc58a706d | ||
|
|
467cae8a41 | ||
|
|
3229216527 | ||
|
|
baf04c4334 | ||
|
|
98d88f86a7 | ||
|
|
5c6533d574 | ||
|
|
c1b8734fb9 | ||
|
|
18c8d0e04c | ||
|
|
447e9701ef | ||
|
|
c33962259c | ||
|
|
3e90ed6428 | ||
|
|
088c546964 | ||
|
|
97fe016e4e | ||
|
|
10ef082950 | ||
|
|
65321ea317 | ||
|
|
209608623c | ||
|
|
f8f999870f | ||
|
|
c80e82fa07 | ||
|
|
64e1f2fe5e | ||
|
|
299fa49d75 | ||
|
|
363f37cc67 | ||
|
|
dc8e00e22f | ||
|
|
dc6fd94048 | ||
|
|
8037563c53 | ||
|
|
3a04291f8e | ||
|
|
5c692796e8 | ||
|
|
f1efc6223e | ||
|
|
26fbfe7d94 | ||
|
|
b7f17f7531 | ||
|
|
6a33321693 | ||
|
|
d9af38524b | ||
|
|
d2b82b47c7 | ||
|
|
82ccd61c06 | ||
|
|
fd10813b41 | ||
|
|
b9a15e601b | ||
|
|
c08f099361 | ||
|
|
bcd5292435 | ||
|
|
3df12b0c7d | ||
|
|
f3f0917166 | ||
|
|
7d6b70c48e | ||
|
|
437fbbc518 | ||
|
|
2cb11f7698 | ||
|
|
ae5cbbf656 | ||
|
|
67a1fe6373 | ||
|
|
0f3eb4f5a6 | ||
|
|
8093ef885e | ||
|
|
52342cda83 | ||
|
|
1b5a9a9420 | ||
|
|
1f870c8102 | ||
|
|
f2dbd880ee | ||
|
|
32dcb1abd9 | ||
|
|
9dc12cb8c2 | ||
|
|
ffae14ac1d | ||
|
|
64639bb296 | ||
|
|
d4b9cb7e63 | ||
|
|
ef2a051313 | ||
|
|
7b786f7716 | ||
|
|
acfe0474dd | ||
|
|
08a83bbea5 | ||
|
|
570f5880be | ||
|
|
1f93358d4e | ||
|
|
5dba99409e | ||
|
|
5e2c3e23ae | ||
|
|
3f55377ab4 | ||
|
|
6fdbd027c5 | ||
|
|
782a60a11d | ||
|
|
2007f2f4cc | ||
|
|
817f8ef669 | ||
|
|
b07b08d9eb | ||
|
|
821f6f117a | ||
|
|
284d6d235b | ||
|
|
6ae027eb8b | ||
|
|
f4e6510852 | ||
|
|
6d7c58516b | ||
|
|
49bd0ca8fd | ||
|
|
012f13366a | ||
|
|
d801c78081 | ||
|
|
f2077b13fb | ||
|
|
36392368f4 | ||
|
|
6c9b6207b2 | ||
|
|
30fda7f5c2 | ||
|
|
1b6cfd828d | ||
|
|
fcfb16050f | ||
|
|
acf5b6eccb | ||
|
|
8d4ae2014b | ||
|
|
b089f6e038 | ||
|
|
c71801f9fa | ||
|
|
3ea86d53b1 | ||
|
|
025a669983 | ||
|
|
261a2618b9 | ||
|
|
f4170d127e | ||
|
|
7e1af63bfc | ||
|
|
9897df3647 | ||
|
|
23e3279a84 | ||
|
|
4f332026e6 | ||
|
|
ce41d2c0a8 | ||
|
|
9a11ce19ea | ||
|
|
2a747a3058 | ||
|
|
0687fad3d6 | ||
|
|
833d3226c5 | ||
|
|
6c1d11ad7e | ||
|
|
0c379e6663 | ||
|
|
0ae59943e2 | ||
|
|
840d8a2aee | ||
|
|
7620ff11b5 | ||
|
|
32c6d13001 | ||
|
|
9562935813 | ||
|
|
3f0800ef66 | ||
|
|
5d3d6bf7c0 | ||
|
|
af72846e92 | ||
|
|
a921a2dfd7 | ||
|
|
9bf94cb7e1 | ||
|
|
ce6d37fe35 | ||
|
|
202d1f11e9 | ||
|
|
39cc5e0fcc | ||
|
|
82f26d48a3 | ||
|
|
e53e0c553f | ||
|
|
5b2404af4b | ||
|
|
a03df471ae | ||
|
|
30cfd31ea5 | ||
|
|
5cc7d3741d | ||
|
|
1e95e18576 | ||
|
|
11091e654a | ||
|
|
c853492e1c | ||
|
|
c4d7be43ed | ||
|
|
aedd7fe002 | ||
|
|
9f0d0e27ef | ||
|
|
92b4e5c15b | ||
|
|
be49757cbf | ||
|
|
0b4adebda5 | ||
|
|
3ab19cc298 | ||
|
|
0c09543d65 | ||
|
|
a48a845cfa | ||
|
|
35bc5c3beb | ||
|
|
d2109f0527 | ||
|
|
0016eb028c | ||
|
|
a431bb4579 | ||
|
|
caf6660080 | ||
|
|
69b0a57777 | ||
|
|
185ed100fd | ||
|
|
40b99b513c | ||
|
|
711477d354 | ||
|
|
2bec2de36e | ||
|
|
d86397aca4 | ||
|
|
d6df3b7758 | ||
|
|
9af8a1e7a7 | ||
|
|
9fce08c5d2 | ||
|
|
19a07ffb96 | ||
|
|
c85c755ec6 | ||
|
|
4e6a831d57 | ||
|
|
ed1a83a93f | ||
|
|
debcf93282 | ||
|
|
559368ba77 | ||
|
|
c75ffd7de1 | ||
|
|
fc57ae154d | ||
|
|
3115bd17b5 | ||
|
|
ae3029cad8 | ||
|
|
b75ccbde65 | ||
|
|
6fd9a50c17 | ||
|
|
5a1d9da84f | ||
|
|
751380762c | ||
|
|
2fd9ca6554 | ||
|
|
87aeb49cff | ||
|
|
5a98ae1a52 | ||
|
|
83b9a7e2a5 | ||
|
|
4c118e23ca | ||
|
|
d1d4519f96 | ||
|
|
e3f05d0972 | ||
|
|
42a703f287 | ||
|
|
a6abcfb990 | ||
|
|
b212ab6176 | ||
|
|
11ecd9e5cf | ||
|
|
89bfe3e352 | ||
|
|
03d9d39ec7 | ||
|
|
8276854072 | ||
|
|
1b4464a6be | ||
|
|
f089f0d83b | ||
|
|
6314d3540b | ||
|
|
21a6d5b4cd | ||
|
|
6447807e4e | ||
|
|
1bdc5dedc1 | ||
|
|
833970b783 | ||
|
|
0b86f34cb4 | ||
|
|
58392ec5d5 | ||
|
|
eb7a99040d | ||
|
|
7ce55ea9fe | ||
|
|
a869c484d0 | ||
|
|
3da1684b4a | ||
|
|
e0a3a3d64c | ||
|
|
8fbf4ba605 | ||
|
|
b0d4fb3b35 | ||
|
|
79b2773102 | ||
|
|
47da0967ac | ||
|
|
f3876b60f5 | ||
|
|
a02cb1ebc0 | ||
|
|
9fb3f19e3a | ||
|
|
4b7f77a769 | ||
|
|
a4223c75a6 | ||
|
|
9fe0fa3455 | ||
|
|
e741807b5a | ||
|
|
a29eaf058e | ||
|
|
f06d3ff5bb | ||
|
|
ca31d75cc3 | ||
|
|
dc417eeab9 | ||
|
|
99197d4a02 | ||
|
|
d04b4e836b | ||
|
|
60b4e1f998 | ||
|
|
5f243e9b95 | ||
|
|
50a854ce10 | ||
|
|
fbf196a7f9 | ||
|
|
54fecc5561 | ||
|
|
5dc39ebf5a | ||
|
|
963f5a40db | ||
|
|
fbf2d5d5d9 | ||
|
|
774056bf62 | ||
|
|
e1864ca1e8 | ||
|
|
e36e0f5233 | ||
|
|
f0ed003d91 | ||
|
|
fb14ef7c24 | ||
|
|
2c3ae21591 | ||
|
|
c4dffd57c3 | ||
|
|
9c71aad75b | ||
|
|
7bf89d83d5 | ||
|
|
9ab9e05639 | ||
|
|
aba35cd526 | ||
|
|
29be69d797 | ||
|
|
c95c3ba38e | ||
|
|
14b1290a20 | ||
|
|
8668c55512 | ||
|
|
7e4a64a9ab | ||
|
|
1eae9ce61c | ||
|
|
7a3d12316a | ||
|
|
bf1a67362e | ||
|
|
6c37f49d16 | ||
|
|
11e8970a45 | ||
|
|
0315b24514 | ||
|
|
630154ed2d | ||
|
|
3100841f64 | ||
|
|
285e86ad04 | ||
|
|
0b76c3615e | ||
|
|
69b8b587c9 | ||
|
|
42a1d94830 | ||
|
|
1ce00f01ca | ||
|
|
ed34a2b500 | ||
|
|
52e3e684e0 | ||
|
|
4145099bdc | ||
|
|
5577f709b0 | ||
|
|
03ec7a0c5d | ||
|
|
eb25e92584 | ||
|
|
7065c87963 | ||
|
|
715ff1e432 | ||
|
|
a9f039e56f | ||
|
|
760ce1ebd8 | ||
|
|
86310135f6 | ||
|
|
a78ad034f5 | ||
|
|
45e1b89efe | ||
|
|
62e6999279 | ||
|
|
3d99ce2d1a | ||
|
|
8797a92844 | ||
|
|
304d6164ae | ||
|
|
4095399436 | ||
|
|
8f3085c1bb | ||
|
|
a6958aa142 | ||
|
|
c6992fa8b8 | ||
|
|
ff523686b5 | ||
|
|
f7618e10da | ||
|
|
eb8a741be2 | ||
|
|
1baf1055bd | ||
|
|
0861bf4c55 | ||
|
|
f218fa50d4 | ||
|
|
e8507d1380 | ||
|
|
8e3b112c74 | ||
|
|
328f592e9d | ||
|
|
1b580186f2 | ||
|
|
787a6c9408 | ||
|
|
d90cb866f1 | ||
|
|
53b1c2a2e6 | ||
|
|
6183b555aa | ||
|
|
358b408753 | ||
|
|
676553f432 | ||
|
|
615222f1c2 | ||
|
|
d82a2e2eec | ||
|
|
771f6b2b7e | ||
|
|
9d6809bc99 | ||
|
|
484f4cce31 | ||
|
|
61ef154a60 | ||
|
|
a84f601493 | ||
|
|
97bdb74766 | ||
|
|
2a88fb9e81 | ||
|
|
d2fb10008e | ||
|
|
056de3bfb5 | ||
|
|
f82d97216a | ||
|
|
a1920067a2 | ||
|
|
5a90dfb776 | ||
|
|
6bb1e32782 | ||
|
|
024c311475 | ||
|
|
4cafb6bfa8 | ||
|
|
453e0c784d | ||
|
|
41dc26f5bd | ||
|
|
46f5638847 | ||
|
|
29cd791cd9 | ||
|
|
b01f0fee50 | ||
|
|
6c6a55ef91 | ||
|
|
711279c36f | ||
|
|
186b5b4d55 | ||
|
|
ee1c3119a7 | ||
|
|
af45a6d40d | ||
|
|
a4fa0019ec | ||
|
|
8b692dd0ca | ||
|
|
d52c033574 | ||
|
|
85b69db02d | ||
|
|
80231a8c58 | ||
|
|
9489c588bc | ||
|
|
87d429fb57 | ||
|
|
478022104a | ||
|
|
8c22b81949 | ||
|
|
9aefeb6dcb | ||
|
|
98c2bc85bb | ||
|
|
cf4c628ef3 | ||
|
|
bc003fc6d4 | ||
|
|
9806a1e7e2 | ||
|
|
849ab66f5f | ||
|
|
d811f7c1f0 | ||
|
|
f9816801a9 | ||
|
|
095f1f259b | ||
|
|
52e2f9b0ad | ||
|
|
38bd8d3044 | ||
|
|
7c91c8f78d | ||
|
|
5a5fae5f1e | ||
|
|
4efb3d7a7a | ||
|
|
80d3e7a0b2 | ||
|
|
8157b2606b | ||
|
|
273928f14d | ||
|
|
673a3b9b80 | ||
|
|
958dae0c21 | ||
|
|
bb4b3a36bc | ||
|
|
222190f08d | ||
|
|
7e45bf4573 | ||
|
|
53408df990 | ||
|
|
73d238cdfb | ||
|
|
92bc2c74fc | ||
|
|
b7a28abd2c | ||
|
|
58f24412db | ||
|
|
de2df68585 | ||
|
|
098a0293b1 | ||
|
|
7a0e39d5f0 | ||
|
|
fdbb885964 | ||
|
|
cce8fa3781 | ||
|
|
0508821a68 | ||
|
|
01871aa91b | ||
|
|
402a8f90d7 | ||
|
|
2a1e6f73ee | ||
|
|
556816423c | ||
|
|
16aef4bbee | ||
|
|
9523b57c8d | ||
|
|
018f493cb3 | ||
|
|
3b047f7572 | ||
|
|
342ae32a23 | ||
|
|
1812fdc58a | ||
|
|
c7cda1c489 | ||
|
|
baa90a6177 | ||
|
|
52890aeb22 | ||
|
|
e6c1c5cf6d | ||
|
|
5983040644 | ||
|
|
48a31a8a51 | ||
|
|
498d012510 | ||
|
|
b554ee475c | ||
|
|
78324fc655 | ||
|
|
cf90dc98f5 | ||
|
|
2ab2d8dce7 | ||
|
|
8abc88dab0 | ||
|
|
78491181ff | ||
|
|
b412b1f2c9 | ||
|
|
3c07dc26ed | ||
|
|
42677134dc | ||
|
|
60acb3239d | ||
|
|
c7a5b3c948 | ||
|
|
a55ab7cb5d | ||
|
|
b9c34e83f8 | ||
|
|
4f67fe7d3f | ||
|
|
5369eea710 | ||
|
|
38c8db565f | ||
|
|
6e5bcdfe4c | ||
|
|
63b32f4dda | ||
|
|
cb139b4386 | ||
|
|
bd23db594b | ||
|
|
5e933a8fc5 | ||
|
|
116f343115 | ||
|
|
2f7ccb7e3f | ||
|
|
2f88ec6824 | ||
|
|
52c9c342bd | ||
|
|
f5154364ac | ||
|
|
4fd3eb28d6 | ||
|
|
f34f4272a0 | ||
|
|
5eddb9e016 | ||
|
|
f168e9f174 | ||
|
|
4b29d8340b | ||
|
|
ca087a174d | ||
|
|
6fa9586fd8 | ||
|
|
7744f7888c | ||
|
|
cbb4126f71 | ||
|
|
6daffb32b3 | ||
|
|
6531a415f2 | ||
|
|
e81d8f8329 | ||
|
|
01a870bd8a | ||
|
|
34efd5af6f | ||
|
|
c5d3f350a0 | ||
|
|
4153351bb8 | ||
|
|
c6caa80d4c | ||
|
|
6a7646e5f4 | ||
|
|
080214b31a | ||
|
|
66b718ac82 | ||
|
|
6db7b11d7e | ||
|
|
339dff07f3 | ||
|
|
3fd6493ade | ||
|
|
9ec33f6a68 | ||
|
|
8beb1a2f8d | ||
|
|
8a187da064 | ||
|
|
652bc76354 | ||
|
|
f5ad81e04a | ||
|
|
543a0aaa25 | ||
|
|
ea3f68824f | ||
|
|
2236c2fd34 | ||
|
|
1283619767 | ||
|
|
68e07d90ba | ||
|
|
049c219c8c | ||
|
|
082a2972cd | ||
|
|
3fc8422fe6 | ||
|
|
951510489d | ||
|
|
29777aaa51 | ||
|
|
70dde52e91 | ||
|
|
9935a17b1d | ||
|
|
f572b91024 | ||
|
|
aeef81cde7 | ||
|
|
3c7776cd58 | ||
|
|
f5f3196c01 | ||
|
|
832f1f9f0b | ||
|
|
62b7ed25f3 | ||
|
|
8e5718fd0c | ||
|
|
57335c9051 | ||
|
|
9fa4ff5300 | ||
|
|
332a4d3bef | ||
|
|
c920123629 | ||
|
|
35c484324f | ||
|
|
8b59c17ef0 | ||
|
|
cb85b7b7a7 | ||
|
|
aff7ff1a9f | ||
|
|
0e9974a918 | ||
|
|
210ffa0475 | ||
|
|
b4b4306677 | ||
|
|
ba0ab6687d | ||
|
|
3727d56c82 | ||
|
|
585cbec17b | ||
|
|
c36f5fb77a | ||
|
|
3fba3425f1 | ||
|
|
598c1fa7e2 | ||
|
|
5b440d1bd1 | ||
|
|
22d34feac4 | ||
|
|
000450504d | ||
|
|
b4ee8b573a | ||
|
|
38de42bd26 | ||
|
|
403cdb03ec | ||
|
|
c56ff93007 | ||
|
|
5a59c50951 | ||
|
|
0c2cd2dfa6 | ||
|
|
5fb0d557a4 | ||
|
|
6211d5a461 | ||
|
|
805f3bc557 | ||
|
|
d8f9786beb | ||
|
|
88a815c84e | ||
|
|
0148546df3 | ||
|
|
264c807f3a | ||
|
|
8c6dcfa376 | ||
|
|
4a2f38930b | ||
|
|
bb2e88b27f | ||
|
|
6f8c62b205 | ||
|
|
d1da86465b | ||
|
|
cc5d5c8d79 | ||
|
|
4d301ef3a2 | ||
|
|
8e06eb490b | ||
|
|
368dca0d84 | ||
|
|
0b42747d0a | ||
|
|
881f3fc54d | ||
|
|
b2134caf0d | ||
|
|
7dddb468f4 | ||
|
|
acec0ef0ce | ||
|
|
3838862709 | ||
|
|
1da5dbf899 | ||
|
|
55976a5bd7 | ||
|
|
a87a04992e | ||
|
|
bf5c09aacd | ||
|
|
baecf8d44f | ||
|
|
70faa798e7 | ||
|
|
3fca37dbcf | ||
|
|
28e6b3565f | ||
|
|
ce8f2dc894 | ||
|
|
568e5537b0 | ||
|
|
82e8d78b3b | ||
|
|
36bc9ab30c | ||
|
|
6f14f5218d | ||
|
|
f2973dc4c6 | ||
|
|
902c6973f1 | ||
|
|
7ca9ca6f90 | ||
|
|
621589aeb6 | ||
|
|
1853b46a37 | ||
|
|
f1d060a511 | ||
|
|
09854f0e89 | ||
|
|
b013faa84b | ||
|
|
1315845d75 | ||
|
|
642aba7c03 | ||
|
|
71f5dc4973 | ||
|
|
5037c2ec02 | ||
|
|
3fc6eb9000 | ||
|
|
befe69d152 | ||
|
|
7f2c879d71 | ||
|
|
f418a998a9 | ||
|
|
05d05f3c51 | ||
|
|
bb89a5769b | ||
|
|
3d015a44d2 | ||
|
|
086412cb56 | ||
|
|
87f2e7e415 | ||
|
|
b0b3e0dc70 | ||
|
|
4c7e65238f | ||
|
|
cf83b324d3 | ||
|
|
f1ee3e41aa | ||
|
|
8df440175a | ||
|
|
c68e7eab06 | ||
|
|
0055426b3f | ||
|
|
168f2adc28 | ||
|
|
3a73b1bf9b | ||
|
|
400e220f06 | ||
|
|
bc2772819d | ||
|
|
b541a23499 | ||
|
|
38c0475616 | ||
|
|
18df8caaa9 | ||
|
|
d503e1740f | ||
|
|
9f2fe912e4 | ||
|
|
4da3e20855 | ||
|
|
0fbddcb991 | ||
|
|
0e986431bc | ||
|
|
031af815da | ||
|
|
e8810e86fc | ||
|
|
cddca1adf4 | ||
|
|
c6d190e568 | ||
|
|
aa4635e52f | ||
|
|
e71bab242e | ||
|
|
ff9b9583ab | ||
|
|
d2f2b952bc | ||
|
|
35b6a541de | ||
|
|
f833ea4c2e | ||
|
|
4ff52a94f9 | ||
|
|
03a4137fd4 | ||
|
|
7c149c9fcc | ||
|
|
1a0dc04ae1 | ||
|
|
9b82d9731a | ||
|
|
a08413f3a8 | ||
|
|
d3031ddddc | ||
|
|
ae1de35817 | ||
|
|
fdfe75a1fd | ||
|
|
abd0fca51a | ||
|
|
ba6e04dff6 | ||
|
|
ed93de6efa | ||
|
|
575b540b8b | ||
|
|
16d7ce0843 | ||
|
|
57b365377f | ||
|
|
1f1b10aa26 | ||
|
|
2173ff9cc0 | ||
|
|
f7b97b53c6 | ||
|
|
9ea1265987 | ||
|
|
1f919ca454 | ||
|
|
82ce7dc165 | ||
|
|
7296cc6451 | ||
|
|
d2dcef277c | ||
|
|
9b96d5bd96 | ||
|
|
8b1efb68fd | ||
|
|
10c1004629 | ||
|
|
d666536a21 | ||
|
|
1c5619b738 | ||
|
|
5d7b60ec5c | ||
|
|
2cf7834db5 | ||
|
|
73551a70cc | ||
|
|
a6d8a331d9 | ||
|
|
43fa7e2e4a | ||
|
|
74e032eb49 | ||
|
|
36de1ba9c8 | ||
|
|
002efdf88b | ||
|
|
8fa72ec3b7 | ||
|
|
bd824a04d6 | ||
|
|
7bd6e8f707 | ||
|
|
8b01e23558 | ||
|
|
f0f859f964 | ||
|
|
b04c2f6f9b | ||
|
|
6fa3982408 | ||
|
|
c227759a4d | ||
|
|
3a7e3fbbf6 | ||
|
|
fb81668aab | ||
|
|
c5f2db8b11 | ||
|
|
a71a6e4a30 | ||
|
|
9f0be63126 | ||
|
|
80db9fb3c6 | ||
|
|
2ea42539a6 | ||
|
|
c9129ba2d5 | ||
|
|
1655084c90 | ||
|
|
378f493851 | ||
|
|
e2925cde68 | ||
|
|
a3722b4cc4 | ||
|
|
ab7df868cb | ||
|
|
55559c3b5b | ||
|
|
12d09e0b3b | ||
|
|
67f6b668bd | ||
|
|
08c6c90ed9 | ||
|
|
7a126fa266 | ||
|
|
007ae93913 | ||
|
|
afe026f318 | ||
|
|
095bb9f015 | ||
|
|
12d9bafc37 | ||
|
|
5cb2736de6 | ||
|
|
10ee73839f | ||
|
|
e99b7835fa | ||
|
|
40aac8601b | ||
|
|
44cdf1d6e7 | ||
|
|
c10505f939 | ||
|
|
f0de10e43c | ||
|
|
1c0887b363 | ||
|
|
8f7d8fb3f5 | ||
|
|
9e0bd6f7aa | ||
|
|
0f44414ce0 | ||
|
|
29b1115485 | ||
|
|
dfd7102212 | ||
|
|
a0f14a8f14 | ||
|
|
a3ed59744b | ||
|
|
2bc999db7b | ||
|
|
f0a53601e0 | ||
|
|
3061770e7b | ||
|
|
1b7e47d3d3 | ||
|
|
e1b37bfa66 | ||
|
|
56994aeb0b | ||
|
|
a205213cc8 | ||
|
|
b4a62fb339 | ||
|
|
5689db1ddf | ||
|
|
8ce037e99f | ||
|
|
757f58c3ba | ||
|
|
ce1042a267 | ||
|
|
e858c2c1e0 | ||
|
|
b4c8d92d94 | ||
|
|
52589aca08 | ||
|
|
7114092451 | ||
|
|
bfddc02963 | ||
|
|
181666c4a7 | ||
|
|
5714d6d324 | ||
|
|
c076c24a11 | ||
|
|
75bd131a54 | ||
|
|
8390818e7e | ||
|
|
7c766af407 | ||
|
|
e0370d89c3 | ||
|
|
1dbca70b62 | ||
|
|
a42b4da02d | ||
|
|
94294610e9 | ||
|
|
3eae74e966 | ||
|
|
684e15f729 | ||
|
|
837a46b5a7 | ||
|
|
b947cab073 | ||
|
|
ff28efe5be | ||
|
|
a2cf3ae4df | ||
|
|
e43622d1df | ||
|
|
92ca847730 | ||
|
|
93ce0714fd | ||
|
|
6c14120c7f | ||
|
|
49bb1e85b7 | ||
|
|
df68489f15 | ||
|
|
02ee20ff3a | ||
|
|
57e188c2e3 | ||
|
|
9c3a13515c | ||
|
|
4ac68a97d9 | ||
|
|
55644575db | ||
|
|
68646e23ae | ||
|
|
feee3a3059 | ||
|
|
7b98762ff5 | ||
|
|
2bdbcf12a9 | ||
|
|
da223dd790 | ||
|
|
4068c1d7b4 | ||
|
|
169d7dc3c9 | ||
|
|
6212ce9d94 | ||
|
|
861e6a4ef8 | ||
|
|
da7cbbfb7f | ||
|
|
2be8e6e086 | ||
|
|
2dea457d9a | ||
|
|
21cc277c3d | ||
|
|
8600761adf | ||
|
|
d202fc5993 | ||
|
|
3ee8a59d59 | ||
|
|
65e8cb55eb | ||
|
|
f5c5c539a6 | ||
|
|
9795444f6c | ||
|
|
8704ff0b55 | ||
|
|
4ceae4654b | ||
|
|
842e8a9889 |
@@ -13,7 +13,7 @@ stages:
|
||||
workflow:
|
||||
rules:
|
||||
# Disable those non-protected push triggered pipelines
|
||||
- if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_PIPELINE_SOURCE == "push"'
|
||||
- if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_COMMIT_TAG !~ /^qa-test/ && $CI_PIPELINE_SOURCE == "push"'
|
||||
when: never
|
||||
# when running merged result pipelines, it would create a temp commit id. use $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA instead of $CI_COMMIT_SHA.
|
||||
# Please use PIPELINE_COMMIT_SHA at all places that require a commit sha
|
||||
@@ -73,9 +73,6 @@ variables:
|
||||
|
||||
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"
|
||||
|
||||
@@ -228,6 +225,7 @@ include:
|
||||
- '.gitlab/ci/pre_check.yml'
|
||||
- '.gitlab/ci/build.yml'
|
||||
- '.gitlab/ci/assign-test.yml'
|
||||
- '.gitlab/ci/integration_test.yml'
|
||||
- '.gitlab/ci/host-test.yml'
|
||||
- '.gitlab/ci/target-test.yml'
|
||||
- '.gitlab/ci/deploy.yml'
|
||||
|
||||
@@ -21,11 +21,6 @@
|
||||
- [Shell Script Related](#shell-script-related)
|
||||
- [Manifest File to Control the Build/Test apps](#manifest-file-to-control-the-buildtest-apps)
|
||||
- [Grammar](#grammar)
|
||||
- [Operands](#operands)
|
||||
- [Operators](#operators)
|
||||
- [Limitation:](#limitation)
|
||||
- [How does it work?](#how-does-it-work)
|
||||
- [Example](#example)
|
||||
|
||||
## General Workflow
|
||||
|
||||
@@ -56,7 +51,7 @@
|
||||
- `example_test[_esp32/esp32s2/...]`
|
||||
- `fuzzer_test`
|
||||
- `host_test`
|
||||
- `integration_test[_wifi/ble]`
|
||||
- `integration_test`
|
||||
- `iperf_stress_test`
|
||||
- `macos`
|
||||
- `macos_test`
|
||||
@@ -144,10 +139,11 @@ check if there's a suitable `.if-<if-anchor-you-need>` anchor
|
||||
1. if there is, create a rule following [`rules` Template Naming Rules](#rules-template-naming-rules).For detail information, please refer to [GitLab Documentation `rules-if`](https://docs.gitlab.com/ee/ci/yaml/README.html#rulesif). Here's an example.
|
||||
|
||||
```yaml
|
||||
.rules:dev:
|
||||
.rules:patterns:python-files:
|
||||
rules:
|
||||
- <<: *if-trigger
|
||||
- <<: *if-protected
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-python-files
|
||||
```
|
||||
|
||||
2. if there isn't
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
- assign_test
|
||||
variables:
|
||||
SUBMODULES_TO_FETCH: "none"
|
||||
CI_TARGET_TEST_CONFIG_FILE: "$CI_PROJECT_DIR/.gitlab/ci/target-test.yml"
|
||||
artifacts:
|
||||
paths:
|
||||
- ${TEST_DIR}/test_configs/
|
||||
@@ -80,34 +81,3 @@ assign_unit_test:
|
||||
variables:
|
||||
TEST_TYPE: unit_test
|
||||
TEST_DIR: components/idf_test/unit_test
|
||||
|
||||
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
|
||||
- build_ssc_esp32c2
|
||||
artifacts:
|
||||
paths:
|
||||
- $TEST_DIR/test_configs
|
||||
expire_in: 1 week
|
||||
variables:
|
||||
TEST_DIR: ${CI_PROJECT_DIR}/tools/ci/integration_test
|
||||
BUILD_DIR: ${CI_PROJECT_DIR}/SSC/ssc_bin
|
||||
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
|
||||
GIT_LFS_SKIP_SMUDGE: 1
|
||||
script:
|
||||
- add_gitlab_ssh_keys
|
||||
# clone test script to assign tests
|
||||
- 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
|
||||
|
||||
@@ -99,6 +99,7 @@
|
||||
- "**/build*/bootloader/*.bin"
|
||||
- "**/build*/bootloader/*.elf"
|
||||
- "**/build*/partition_table/*.bin"
|
||||
- "**/build*/project_description.json"
|
||||
- list_job_*.json
|
||||
- size_info.txt
|
||||
when: always
|
||||
@@ -314,50 +315,6 @@ fast_template_app:
|
||||
BUILD_COMMAND_ARGS: "-p"
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
.build_ssc_template:
|
||||
extends:
|
||||
- .build_template
|
||||
- .rules:build:integration_test
|
||||
artifacts:
|
||||
paths:
|
||||
- SSC/ssc_bin
|
||||
expire_in: 1 week
|
||||
script:
|
||||
- retry_failed git clone $SSC_REPOSITORY
|
||||
- python $CHECKOUT_REF_SCRIPT SSC SSC
|
||||
- cd SSC
|
||||
- MAKEFLAGS= ./ci_build_ssc.sh $TARGET_NAME
|
||||
|
||||
build_ssc_esp32:
|
||||
extends: .build_ssc_template
|
||||
parallel: 3
|
||||
variables:
|
||||
TARGET_NAME: "ESP32"
|
||||
|
||||
build_ssc_esp32s2:
|
||||
extends: .build_ssc_template
|
||||
parallel: 2
|
||||
variables:
|
||||
TARGET_NAME: "ESP32S2"
|
||||
|
||||
build_ssc_esp32c2:
|
||||
extends: .build_ssc_template
|
||||
parallel: 2
|
||||
variables:
|
||||
TARGET_NAME: "ESP32C2"
|
||||
|
||||
build_ssc_esp32c3:
|
||||
extends: .build_ssc_template
|
||||
parallel: 3
|
||||
variables:
|
||||
TARGET_NAME: "ESP32C3"
|
||||
|
||||
build_ssc_esp32s3:
|
||||
extends: .build_ssc_template
|
||||
parallel: 3
|
||||
variables:
|
||||
TARGET_NAME: "ESP32S3"
|
||||
|
||||
.build_esp_idf_tests_cmake_template:
|
||||
extends:
|
||||
- .build_cmake_template
|
||||
|
||||
@@ -68,16 +68,6 @@
|
||||
- "build:{0}"
|
||||
- build:target_test
|
||||
|
||||
build:integration_test:
|
||||
labels:
|
||||
- build
|
||||
patterns:
|
||||
- build_components
|
||||
- build_system
|
||||
included_in:
|
||||
- build:target_test
|
||||
|
||||
|
||||
####################
|
||||
# Target Test Jobs #
|
||||
####################
|
||||
@@ -156,23 +146,6 @@ build:integration_test:
|
||||
- "build:example_test"
|
||||
- build:target_test
|
||||
|
||||
"test:integration_test_{0}":
|
||||
matrix:
|
||||
- - wifi
|
||||
- ble
|
||||
labels:
|
||||
- integration_test_{0}
|
||||
- integration_test
|
||||
- target_test
|
||||
patterns:
|
||||
- integration_test-{0}
|
||||
- target_test-{0}
|
||||
# - maybe others
|
||||
included_in:
|
||||
- test:integration_test
|
||||
- build:integration_test
|
||||
- build:target_test
|
||||
|
||||
"test:host_test":
|
||||
labels:
|
||||
- host_test
|
||||
|
||||
@@ -32,50 +32,11 @@ push_to_github:
|
||||
extends:
|
||||
- .deploy_job_template
|
||||
- .before_script_minimal
|
||||
- .rules:protected-no_label
|
||||
dependencies: []
|
||||
- .rules:push_to_github
|
||||
needs:
|
||||
- check_submodule_sync
|
||||
script:
|
||||
- add_github_ssh_keys
|
||||
- git remote remove github &>/dev/null || true
|
||||
- git remote add github git@github.com:espressif/esp-idf.git
|
||||
- tools/ci/push_to_github.sh
|
||||
|
||||
deploy_test_result:
|
||||
extends:
|
||||
- .deploy_job_template
|
||||
- .before_script_minimal
|
||||
- .rules:ref:master-always
|
||||
image: $CI_DOCKER_REGISTRY/bot-env:1
|
||||
dependencies: []
|
||||
tags:
|
||||
- deploy_test
|
||||
artifacts:
|
||||
when: always
|
||||
paths:
|
||||
- ${CI_PROJECT_DIR}/test-management/*.log
|
||||
expire_in: 1 week
|
||||
variables:
|
||||
BOT_ACCOUNT_CONFIG_FILE: "${CI_PROJECT_DIR}/test-management/Config/Account.local.yml"
|
||||
TEST_RESULTS_PATH: "${CI_PROJECT_DIR}/TEST_RESULTS"
|
||||
script:
|
||||
- add_gitlab_ssh_keys
|
||||
- export GIT_SHA=$(echo ${CI_COMMIT_SHA} | cut -c 1-8)
|
||||
- export REV_COUNT=$(git rev-list --count ${GIT_SHA} --)
|
||||
- export SUMMARY="IDF CI test result for $GIT_SHA (r${REV_COUNT})"
|
||||
# Download test result
|
||||
- export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
|
||||
- python3 ${IDF_PATH}/tools/ci/get_all_test_results.py --path ${TEST_RESULTS_PATH} --include_retried
|
||||
- if [[ -z $(find ${TEST_RESULTS_PATH} -name "*.xml") ]]; then exit 0; fi
|
||||
# Clone test-management repo
|
||||
- retry_failed git clone $TEST_MANAGEMENT_REPO
|
||||
- python3 $CHECKOUT_REF_SCRIPT test-management test-management
|
||||
- cd test-management
|
||||
- echo $BOT_JIRA_ACCOUNT > ${BOT_ACCOUNT_CONFIG_FILE}
|
||||
# Make sure all requirements are installed
|
||||
- pip3 install -r requirements.txt
|
||||
# Update test cases
|
||||
- python3 ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT from_xml -d ${TEST_RESULTS_PATH} -r $GIT_SHA -l IDFCI
|
||||
# update test results
|
||||
- python3 ImportTestResult.py -r "$GIT_SHA (r${REV_COUNT})" -j $JIRA_TEST_MANAGEMENT_PROJECT -s "$SUMMARY" -l IDFCI -p ${TEST_RESULTS_PATH} --pipeline_url ${CI_PIPELINE_URL}
|
||||
# May need a long time to upload all test results.
|
||||
timeout: 4 hours
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
.if-protected-no_label: &if-protected-no_label
|
||||
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) && $BOT_TRIGGER_WITH_LABEL == null'
|
||||
|
||||
.if-qa-test-tag: &if-qa-test-tag
|
||||
if: '$CI_COMMIT_TAG =~ /^qa-test/'
|
||||
|
||||
.if-label-build_docs: &if-label-build_docs
|
||||
if: '$BOT_LABEL_BUILD_DOCS || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*build_docs(?:,[^,\n\r]+)*$/i'
|
||||
|
||||
@@ -27,10 +30,12 @@
|
||||
if: '$BOT_LABEL_DOCS_FAST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*docs_fast(?:,[^,\n\r]+)*$/i'
|
||||
|
||||
.if-dev-push: &if-dev-push
|
||||
if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event")'
|
||||
if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_COMMIT_TAG !~ /^qa-test/ && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event")'
|
||||
|
||||
.doc-rules:build:docs:
|
||||
rules:
|
||||
- <<: *if-qa-test-tag
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build_docs
|
||||
- <<: *if-label-docs
|
||||
|
||||
@@ -303,6 +303,14 @@ test_mkuf2:
|
||||
- cd ${IDF_PATH}/tools/test_mkuf2
|
||||
- ./test_mkuf2.py
|
||||
|
||||
test_sbom:
|
||||
extends:
|
||||
- .host_test_template
|
||||
- .rules:patterns:sbom
|
||||
script:
|
||||
- cd ${IDF_PATH}/tools/test_sbom
|
||||
- pytest
|
||||
|
||||
test_autocomplete:
|
||||
extends:
|
||||
- .host_test_template
|
||||
|
||||
69
.gitlab/ci/integration_test.yml
Normal file
69
.gitlab/ci/integration_test.yml
Normal file
@@ -0,0 +1,69 @@
|
||||
# generate dynamic integration pipeline by `idf-integration-ci` project
|
||||
|
||||
.patterns-integration_test: &patterns-integration_test
|
||||
# add all possible patterns to make sure `gen_integration_pipeline` can be triggered.
|
||||
# fine-grained control will be done while generating the pipeline
|
||||
# find `patterns` in `idf-integration-ci` project
|
||||
- "components/**/*"
|
||||
- "tools/**/*"
|
||||
- ".gitlab-ci.yml"
|
||||
- ".gitlab/ci/common.yml"
|
||||
- ".gitlab/ci/integration_test.yml"
|
||||
- ".gitmodules"
|
||||
- "CMakeLists.txt"
|
||||
- "install.sh"
|
||||
- "export.sh"
|
||||
- "Kconfig"
|
||||
- "sdkconfig.rename"
|
||||
|
||||
# Simplify the rules
|
||||
.integration_test_rules:
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE != "merge_request_event"'
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
changes: *patterns-integration_test
|
||||
# support trigger by ci labels
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*target_test(?:,[^,\n\r]+)*$/i'
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*integration_test(?:,[^,\n\r]+)*$/i'
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*build(?:,[^,\n\r]+)*$/i'
|
||||
|
||||
gen_integration_pipeline:
|
||||
extends:
|
||||
- .before_script_minimal
|
||||
- .integration_test_rules
|
||||
image: ${CI_INTEGRATION_ASSIGN_ENV}
|
||||
stage: assign_test
|
||||
cache: []
|
||||
tags:
|
||||
- assign_test
|
||||
variables:
|
||||
SUBMODULES_TO_FETCH: "none"
|
||||
GIT_LFS_SKIP_SMUDGE: 1
|
||||
needs:
|
||||
- job: fast_template_app
|
||||
artifacts: false
|
||||
optional: true
|
||||
artifacts:
|
||||
paths:
|
||||
- idf-integration-ci/child_pipeline/
|
||||
expire_in: 2 weeks
|
||||
script:
|
||||
- add_gitlab_ssh_keys
|
||||
- retry_failed git clone ${CI_GEN_INTEGRATION_PIPELINE_REPO} idf-integration-ci
|
||||
- python $CHECKOUT_REF_SCRIPT idf-integration-ci idf-integration-ci
|
||||
- cd idf-integration-ci
|
||||
- python tools/generate_child_pipeline.py -o child_pipeline/
|
||||
|
||||
child_integration_test_pipeline:
|
||||
extends:
|
||||
- .integration_test_rules
|
||||
stage: assign_test
|
||||
needs:
|
||||
- gen_integration_pipeline
|
||||
trigger:
|
||||
include:
|
||||
- artifact: idf-integration-ci/child_pipeline/pipeline.yml
|
||||
job: gen_integration_pipeline
|
||||
forward:
|
||||
yaml_variables: false
|
||||
strategy: depend
|
||||
@@ -21,7 +21,7 @@ check_pre_commit_master_release:
|
||||
check_pre_commit_MR:
|
||||
extends:
|
||||
- .check_pre_commit_template
|
||||
- .rules:dev
|
||||
- .rules:mr
|
||||
script:
|
||||
- python ${CI_PROJECT_DIR}/tools/ci/ci_get_mr_info.py files ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} | xargs pre-commit run --files
|
||||
|
||||
|
||||
@@ -50,6 +50,9 @@
|
||||
- "tools/ci/test_build_system*.py"
|
||||
- "tools/ci/ci_build_apps.py"
|
||||
|
||||
.patterns-sbom: &patterns-sbom
|
||||
- "tools/test_sbom/*"
|
||||
|
||||
.patterns-custom_test: &patterns-custom_test
|
||||
- "tools/ci/python_packages/gitlab_api.py"
|
||||
- "tools/ci/python_packages/tiny_test_fw/**/*"
|
||||
@@ -83,19 +86,6 @@
|
||||
- "components/esp_phy/**/*"
|
||||
- "components/wpa_supplicant/**/*"
|
||||
|
||||
.patterns-integration_test-ble: &patterns-integration_test-ble
|
||||
- "tools/ci/python_packages/gitlab_api.py"
|
||||
- "tools/ci/integration_test/**/*"
|
||||
- "components/bt/controller/lib_esp32"
|
||||
- "components/bt/controller/lib_esp32c3_family"
|
||||
- "components/bt/controller/lib_esp32h2/esp32h2-bt-lib"
|
||||
- "components/bt/host/nimble/nimble"
|
||||
- "components/esp_phy/lib"
|
||||
|
||||
.patterns-integration_test-wifi: &patterns-integration_test-wifi
|
||||
- "tools/ci/python_packages/gitlab_api.py"
|
||||
- "tools/ci/integration_test/**/*"
|
||||
|
||||
.patterns-host_test: &patterns-host_test
|
||||
- ".gitlab/ci/host-test.yml"
|
||||
|
||||
@@ -256,13 +246,19 @@
|
||||
if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/'
|
||||
|
||||
.if-protected: &if-protected
|
||||
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/)'
|
||||
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) || $CI_COMMIT_TAG =~ /^qa-test/'
|
||||
|
||||
.if-protected-no_label: &if-protected-no_label
|
||||
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) && $BOT_TRIGGER_WITH_LABEL == null'
|
||||
|
||||
.if-qa-test-tag: &if-qa-test-tag
|
||||
if: '$CI_COMMIT_TAG =~ /^qa-test/'
|
||||
|
||||
.if-dev-push: &if-dev-push
|
||||
if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event")'
|
||||
if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_COMMIT_TAG !~ /^qa-test/ && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event")'
|
||||
|
||||
.if-merge_request: &if-merge_request
|
||||
if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
|
||||
.if-schedule: &if-schedule
|
||||
if: '$CI_PIPELINE_SOURCE == "schedule"'
|
||||
@@ -292,10 +288,17 @@
|
||||
rules:
|
||||
- <<: *if-protected
|
||||
|
||||
.rules:protected-no_label:
|
||||
.rules:push_to_github:
|
||||
rules:
|
||||
- <<: *if-qa-test-tag
|
||||
when: never
|
||||
- <<: *if-protected-no_label
|
||||
|
||||
.rules:mr:
|
||||
rules:
|
||||
- <<: *if-merge_request
|
||||
|
||||
### Patterns ###
|
||||
.rules:patterns:python-cache:
|
||||
rules:
|
||||
- <<: *if-dev-push
|
||||
@@ -346,6 +349,14 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-sonarqube-files
|
||||
|
||||
.rules:patterns:sbom:
|
||||
rules:
|
||||
- <<: *if-protected
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-sbom
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-submodule
|
||||
|
||||
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
# DO NOT place comments or maintain any code from this line
|
||||
#
|
||||
@@ -433,15 +444,6 @@
|
||||
.if-label-host_test: &if-label-host_test
|
||||
if: '$BOT_LABEL_HOST_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*host_test(?:,[^,\n\r]+)*$/i'
|
||||
|
||||
.if-label-integration_test: &if-label-integration_test
|
||||
if: '$BOT_LABEL_INTEGRATION_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*integration_test(?:,[^,\n\r]+)*$/i'
|
||||
|
||||
.if-label-integration_test_ble: &if-label-integration_test_ble
|
||||
if: '$BOT_LABEL_INTEGRATION_TEST_BLE || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*integration_test_ble(?:,[^,\n\r]+)*$/i'
|
||||
|
||||
.if-label-integration_test_wifi: &if-label-integration_test_wifi
|
||||
if: '$BOT_LABEL_INTEGRATION_TEST_WIFI || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*integration_test_wifi(?:,[^,\n\r]+)*$/i'
|
||||
|
||||
.if-label-iperf_stress_test: &if-label-iperf_stress_test
|
||||
if: '$BOT_LABEL_IPERF_STRESS_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*iperf_stress_test(?:,[^,\n\r]+)*$/i'
|
||||
|
||||
@@ -1058,27 +1060,6 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-target_test-wifi
|
||||
|
||||
.rules:build:integration_test:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build
|
||||
- <<: *if-label-integration_test
|
||||
- <<: *if-label-integration_test_ble
|
||||
- <<: *if-label-integration_test_wifi
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-build_components
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-build_system
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-integration_test-ble
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-integration_test-wifi
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-target_test-wifi
|
||||
|
||||
.rules:build:macos:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
@@ -1118,9 +1099,6 @@
|
||||
- <<: *if-label-example_test_esp32h2
|
||||
- <<: *if-label-example_test_esp32s2
|
||||
- <<: *if-label-example_test_esp32s3
|
||||
- <<: *if-label-integration_test
|
||||
- <<: *if-label-integration_test_ble
|
||||
- <<: *if-label-integration_test_wifi
|
||||
- <<: *if-label-iperf_stress_test
|
||||
- <<: *if-label-lan8720
|
||||
- <<: *if-label-target_test
|
||||
@@ -1154,10 +1132,6 @@
|
||||
changes: *patterns-example_test-usb
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-example_test-wifi
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-integration_test-ble
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-integration_test-wifi
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-target_test-adc
|
||||
- <<: *if-dev-push
|
||||
@@ -2979,52 +2953,6 @@
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-host_test
|
||||
|
||||
.rules:test:integration_test:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-integration_test
|
||||
- <<: *if-label-integration_test_ble
|
||||
- <<: *if-label-integration_test_wifi
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-integration_test-ble
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-integration_test-wifi
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-target_test-wifi
|
||||
|
||||
.rules:test:integration_test_ble:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-integration_test
|
||||
- <<: *if-label-integration_test_ble
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-integration_test-ble
|
||||
|
||||
.rules:test:integration_test_wifi:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-integration_test
|
||||
- <<: *if-label-integration_test_wifi
|
||||
- <<: *if-label-target_test
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-integration_test-wifi
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-target_test-wifi
|
||||
|
||||
.rules:test:submodule:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
|
||||
@@ -135,6 +135,14 @@ example_test_pytest_esp32_ethernet:
|
||||
- build_pytest_examples_esp32
|
||||
tags: [ esp32, ethernet]
|
||||
|
||||
pytest_examples_esp32_ethernet_httpbin:
|
||||
extends:
|
||||
- .pytest_examples_dir_template
|
||||
- .rules:test:example_test-esp32-ethernet
|
||||
needs:
|
||||
- build_pytest_examples_esp32
|
||||
tags: [ esp32, httpbin]
|
||||
|
||||
example_test_pytest_esp32_8mb_flash:
|
||||
extends:
|
||||
- .pytest_examples_dir_template
|
||||
@@ -1088,301 +1096,3 @@ UT_S3_FLASH:
|
||||
tags:
|
||||
- ESP32S3_IDF
|
||||
- UT_T1_ESP_FLASH
|
||||
|
||||
.integration_test_template:
|
||||
extends:
|
||||
- .target_test_job_template
|
||||
- .rules:test: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:
|
||||
LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32_IDF"
|
||||
LOG_PATH: "${CI_PROJECT_DIR}/TEST_LOGS"
|
||||
TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/auto_test_script/TestCaseFiles"
|
||||
CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/tools/ci/integration_test/test_configs"
|
||||
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}/auto_test_script/tools/ci/idf_prepare_test_bins.py"
|
||||
PYTHONPATH: "${CI_PROJECT_DIR}/auto_test_script/packages:${CI_PROJECT_DIR}/tools/ci/python_packages:${PYTHONPATH}"
|
||||
INITIAL_CONDITION_RETRY_COUNT: "1"
|
||||
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
|
||||
- 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
|
||||
- python ${CI_RUNNER_SCRIPT} -l "$LOG_PATH/$JOB_FULL_NAME" -c $CONFIG_FILE -e $LOCAL_ENV_CONFIG_PATH -t $TEST_CASE_FILE_PATH
|
||||
|
||||
.integration_test_esp32c3_template:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
variables:
|
||||
LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32C3_IDF"
|
||||
|
||||
.integration_test_esp32c2_template:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
variables:
|
||||
LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32C2_IDF"
|
||||
|
||||
nvs_compatible_test:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test
|
||||
artifacts:
|
||||
when: always
|
||||
paths:
|
||||
- $LOG_PATH
|
||||
- nvs_wifi.bin
|
||||
expire_in: 1 mos
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- NVS_Compatible
|
||||
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
|
||||
- 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
|
||||
- python ${CI_RUNNER_SCRIPT} -l "$LOG_PATH/$JOB_FULL_NAME" -c $CONFIG_FILE -e $LOCAL_ENV_CONFIG_PATH -t $TEST_CASE_FILE_PATH
|
||||
|
||||
IT_T1_Simple:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
parallel: 2
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T1_Simple
|
||||
|
||||
IT_T1_WAP:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T1_WAP
|
||||
|
||||
IT_T2_Simple:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
parallel: 9
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T2_Simple
|
||||
|
||||
IT_T5_BT_Simple:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_ble
|
||||
parallel: 3
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T5_BT_Simple
|
||||
|
||||
IT_T2_BT_Simple:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_ble
|
||||
parallel: 6
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T2_BT_Simple
|
||||
|
||||
IT_T1_BT_Dongle:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_ble
|
||||
parallel: 2
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T1_BT_Dongle
|
||||
|
||||
IT_T1_AP:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T1_AP
|
||||
|
||||
IT_T1_AP_E:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
parallel: 5
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T1_AP_E
|
||||
|
||||
IT_T1_WNIC_AP:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T1_WNIC_AP
|
||||
|
||||
IT_T1_WNIC_AP_E:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T1_WNIC_AP_E
|
||||
|
||||
IT_T1_MESH1:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T1_MESH1
|
||||
|
||||
IT_T2_MESH1:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
parallel: 2
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T2_MESH1
|
||||
|
||||
IT_T3_MESH1:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T3_MESH1
|
||||
|
||||
IT_T6_MESH1:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T6_MESH1
|
||||
|
||||
IT_T12_MESH1:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T12_MESH1
|
||||
|
||||
IT_T50_MESH1:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
allow_failure: true
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T50_MESH1
|
||||
|
||||
IT_T1_MESH2:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T1_MESH2
|
||||
|
||||
IT_T2_WNIC:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T2_WNIC
|
||||
|
||||
IT_T2_AP:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T2_AP
|
||||
|
||||
IT_T3_Simple:
|
||||
extends:
|
||||
- .integration_test_template
|
||||
- .rules:test:integration_test_wifi
|
||||
tags:
|
||||
- ESP32_IDF
|
||||
- SSC_T3_Simple
|
||||
|
||||
IT_C3_T2_BT_Simple:
|
||||
extends:
|
||||
- .integration_test_esp32c3_template
|
||||
- .rules:test:integration_test_ble
|
||||
parallel: 11
|
||||
tags:
|
||||
- ESP32C3_IDF
|
||||
- SSC_T2_BT_Simple
|
||||
|
||||
IT_C3_T5_BT_Simple:
|
||||
extends:
|
||||
- .integration_test_esp32c3_template
|
||||
- .rules:test:integration_test_ble
|
||||
parallel: 5
|
||||
tags:
|
||||
- ESP32C3_IDF
|
||||
- SSC_T5_BT_Simple
|
||||
|
||||
IT_C3_T1_BT_Dongle:
|
||||
extends:
|
||||
- .integration_test_esp32c3_template
|
||||
- .rules:test:integration_test_ble
|
||||
image: gitlab.espressif.cn:5050/qa/dockerfiles/integration-test-env-dbg:1
|
||||
parallel: 2
|
||||
tags:
|
||||
- ESP32C3_IDF
|
||||
- SSC_T1_BT_Dongle
|
||||
|
||||
IT_C2_T2_BT_Simple:
|
||||
extends:
|
||||
- .integration_test_esp32c2_template
|
||||
- .rules:test:integration_test_ble
|
||||
parallel: 9
|
||||
tags:
|
||||
- ESP32C2_IDF
|
||||
- SSC_T2_BT_Simple
|
||||
|
||||
IT_C2_T1_BT_Dongle:
|
||||
extends:
|
||||
- .integration_test_esp32c2_template
|
||||
- .rules:test:integration_test_ble
|
||||
image: gitlab.espressif.cn:5050/qa/dockerfiles/integration-test-env-dbg:1
|
||||
parallel: 2
|
||||
tags:
|
||||
- ESP32C2_IDF
|
||||
- SSC_T1_BT_Dongle
|
||||
|
||||
53
.gitmodules
vendored
53
.gitmodules
vendored
@@ -2,6 +2,26 @@
|
||||
# All the relative URL paths are intended to be GitHub ones
|
||||
# For Espressif's public projects please use '../../espressif/proj', not a '../proj'
|
||||
#
|
||||
# Submodules SBOM information
|
||||
# ---------------------------
|
||||
# Submodules, which are used directly and not forked into espressif namespace should
|
||||
# contain SBOM information here. Other submodules should have the SBOM manifest file
|
||||
# included in the root of their project's repository.
|
||||
#
|
||||
# The sbom-hash entry records the submodule's checkout SHA as presented in git-tree
|
||||
# commit object. For example spiffs submodule
|
||||
#
|
||||
# $ git ls-tree HEAD components/spiffs/spiffs
|
||||
# 160000 commit 0dbb3f71c5f6fae3747a9d935372773762baf852 components/spiffs/spiffs
|
||||
#
|
||||
# The hash can be also obtained with git submodule command
|
||||
#
|
||||
# $ git submodule status components/spiffs/spiffs
|
||||
# 0dbb3f71c5f6fae3747a9d935372773762baf852 components/spiffs/spiffs (0.2-255-g0dbb3f71c5f6)
|
||||
#
|
||||
# The submodule SHA recorded here has to match with SHA, which is presented in git-tree.
|
||||
# This is checked by CI. Also please don't forget to update the submodule version
|
||||
# if you are changing the sbom-hash. This is important for SBOM generation.
|
||||
|
||||
[submodule "components/bt/controller/lib_esp32"]
|
||||
path = components/bt/controller/lib_esp32
|
||||
@@ -10,14 +30,31 @@
|
||||
[submodule "components/bootloader/subproject/components/micro-ecc/micro-ecc"]
|
||||
path = components/bootloader/subproject/components/micro-ecc/micro-ecc
|
||||
url = ../../kmackay/micro-ecc.git
|
||||
sbom-version = 1.1
|
||||
sbom-cpe = cpe:2.3:a:micro-ecc_project:micro-ecc:{}:*:*:*:*:*:*:*
|
||||
sbom-supplier = Person: Ken MacKay
|
||||
sbom-url = https://github.com/kmackay/micro-ecc
|
||||
sbom-description = A small and fast ECDH and ECDSA implementation for 8-bit, 32-bit, and 64-bit processors
|
||||
sbom-hash = 24c60e243580c7868f4334a1ba3123481fe1aa48
|
||||
|
||||
[submodule "components/spiffs/spiffs"]
|
||||
path = components/spiffs/spiffs
|
||||
url = ../../pellepl/spiffs.git
|
||||
sbom-version = 0.2-255-g0dbb3f71c5f6
|
||||
sbom-supplier = Person: Peter Andersson
|
||||
sbom-url = https://github.com/pellepl/spiffs
|
||||
sbom-description = Wear-leveled SPI flash file system for embedded devices
|
||||
sbom-hash = 0dbb3f71c5f6fae3747a9d935372773762baf852
|
||||
|
||||
[submodule "components/json/cJSON"]
|
||||
path = components/json/cJSON
|
||||
url = ../../DaveGamble/cJSON.git
|
||||
sbom-version = 1.7.16
|
||||
sbom-cpe = cpe:2.3:a:cjson_project:cjson:{}:*:*:*:*:*:*:*
|
||||
sbom-supplier = Person: Dave Gamble
|
||||
sbom-url = https://github.com/DaveGamble/cJSON
|
||||
sbom-description = Ultralightweight JSON parser in ANSI C
|
||||
sbom-hash = cb8693b058ba302f4829ec6d03f609ac6f848546
|
||||
|
||||
[submodule "components/mbedtls/mbedtls"]
|
||||
path = components/mbedtls/mbedtls
|
||||
@@ -34,10 +71,21 @@
|
||||
[submodule "components/protobuf-c/protobuf-c"]
|
||||
path = components/protobuf-c/protobuf-c
|
||||
url = ../../protobuf-c/protobuf-c.git
|
||||
sbom-version = 1.4.1
|
||||
sbom-cpe = cpe:2.3:a:protobuf-c_project:protobuf-c:{}:*:*:*:*:*:*:*
|
||||
sbom-supplier = Organization: protobuf-c community <https://groups.google.com/g/protobuf-c>
|
||||
sbom-url = https://github.com/protobuf-c/protobuf-c
|
||||
sbom-description = Protocol Buffers implementation in C
|
||||
sbom-hash = abc67a11c6db271bedbb9f58be85d6f4e2ea8389
|
||||
|
||||
[submodule "components/unity/unity"]
|
||||
path = components/unity/unity
|
||||
url = ../../ThrowTheSwitch/Unity.git
|
||||
sbom-version = v2.4.3-51-g7d2bf62b7e6a
|
||||
sbom-supplier = Organization: ThrowTheSwitch community <http://www.throwtheswitch.org>
|
||||
sbom-url = https://github.com/ThrowTheSwitch/Unity
|
||||
sbom-description = Simple Unit Testing for C
|
||||
sbom-hash = 7d2bf62b7e6afaf38153041a9d53c21aeeca9a25
|
||||
|
||||
[submodule "components/bt/host/nimble/nimble"]
|
||||
path = components/bt/host/nimble/nimble
|
||||
@@ -50,6 +98,11 @@
|
||||
[submodule "components/cmock/CMock"]
|
||||
path = components/cmock/CMock
|
||||
url = ../../ThrowTheSwitch/CMock.git
|
||||
sbom-version = v2.5.2-2-geeecc49ce8af
|
||||
sbom-supplier = Organization: ThrowTheSwitch community <http://www.throwtheswitch.org>
|
||||
sbom-url = https://github.com/ThrowTheSwitch/CMock
|
||||
sbom-description = CMock - Mock/stub generator for C
|
||||
sbom-hash = eeecc49ce8af123cf8ad40efdb9673e37b56230f
|
||||
|
||||
[submodule "components/openthread/openthread"]
|
||||
path = components/openthread/openthread
|
||||
|
||||
@@ -141,6 +141,7 @@ repos:
|
||||
name: Check if all apps readme files match given .build-test-rules.yml files. Modify the supported target tables
|
||||
entry: tools/ci/check_build_test_rules.py check-readmes
|
||||
language: python
|
||||
require_serial: true
|
||||
files: 'tools/test_apps/.+|examples/.+|components/.+'
|
||||
additional_dependencies:
|
||||
- idf_build_apps
|
||||
@@ -157,7 +158,7 @@ repos:
|
||||
- id: file-contents-sorter
|
||||
files: 'tools\/ci\/(executable-list\.txt|mypy_ignore_list\.txt|check_copyright_ignore\.txt)'
|
||||
- repo: https://github.com/espressif/check-copyright/
|
||||
rev: v1.0.1
|
||||
rev: v1.0.3
|
||||
hooks:
|
||||
- id: check-copyright
|
||||
args: ['--ignore', 'tools/ci/check_copyright_ignore.txt', '--config', 'tools/ci/check_copyright_config.yaml']
|
||||
|
||||
@@ -54,13 +54,15 @@ idf_component_register(SRCS "${srcs}"
|
||||
REQUIRES esp_timer
|
||||
LDFRAGMENTS linker.lf)
|
||||
|
||||
# disable --coverage for this component, as it is used as transport
|
||||
# for gcov
|
||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-fno-profile-arcs" "-fno-test-coverage")
|
||||
|
||||
# Force app_trace to also appear later than gcov in link line
|
||||
idf_component_get_property(app_trace app_trace COMPONENT_LIB)
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${app_trace}> gcov $<TARGET_FILE:${app_trace}> c)
|
||||
if(CONFIG_APPTRACE_GCOV_ENABLE)
|
||||
# disable --coverage for this component, as it is used as transport
|
||||
# for gcov
|
||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-fno-profile-arcs" "-fno-test-coverage")
|
||||
# Force app_trace to also appear later than gcov in link line
|
||||
idf_component_get_property(app_trace app_trace COMPONENT_LIB)
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE
|
||||
"-Wl,--undefined=gcov_rtio_atexit" $<TARGET_FILE:${app_trace}> gcov $<TARGET_FILE:${app_trace}> c)
|
||||
endif()
|
||||
|
||||
# This function adds a dependency on the given component if the component is included into the build.
|
||||
function(maybe_add_component component_name)
|
||||
|
||||
@@ -389,4 +389,11 @@ menu "Application Level Tracing"
|
||||
help
|
||||
Enables support for GCOV data transfer to host.
|
||||
|
||||
config APPTRACE_GCOV_DUMP_TASK_STACK_SIZE
|
||||
int "Gcov dump task stack size"
|
||||
depends on APPTRACE_GCOV_ENABLE
|
||||
default 2048
|
||||
help
|
||||
Configures stack size of Gcov dump task
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -76,7 +76,8 @@ gcov_exit:
|
||||
void gcov_create_task(void *arg)
|
||||
{
|
||||
ESP_EARLY_LOGV(TAG, "%s", __FUNCTION__);
|
||||
xTaskCreatePinnedToCore(&gcov_dump_task, "gcov_dump_task", 2048, (void *)&s_gcov_task_running, configMAX_PRIORITIES - 1, NULL, 0);
|
||||
xTaskCreatePinnedToCore(&gcov_dump_task, "gcov_dump_task", CONFIG_APPTRACE_GCOV_DUMP_TASK_STACK_SIZE,
|
||||
(void *)&s_gcov_task_running, configMAX_PRIORITIES - 1, NULL, 0);
|
||||
}
|
||||
|
||||
void gcov_create_task_tick_hook(void)
|
||||
|
||||
@@ -691,14 +691,12 @@ menu "Security features"
|
||||
|
||||
config SECURE_BOOT_VERIFICATION_KEY
|
||||
string "Secure boot public signature verification key"
|
||||
depends on SECURE_SIGNED_APPS && !SECURE_BOOT_BUILD_SIGNED_BINARIES && !SECURE_SIGNED_APPS_RSA_SCHEME
|
||||
depends on SECURE_SIGNED_APPS && SECURE_SIGNED_APPS_ECDSA_SCHEME && !SECURE_BOOT_BUILD_SIGNED_BINARIES
|
||||
default "signature_verification_key.bin"
|
||||
help
|
||||
Path to a public key file used to verify signed images.
|
||||
Secure Boot V1: This ECDSA public key is compiled into the bootloader and/or
|
||||
app, to verify app images.
|
||||
Secure Boot V2: This RSA public key is compiled into the signature block at
|
||||
the end of the bootloader/app.
|
||||
|
||||
Key file is in raw binary format, and can be extracted from a
|
||||
PEM formatted private key using the espsecure.py
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -109,6 +109,17 @@ extern const bootloader_qio_info_t __attribute__((weak)) bootloader_flash_qe_sup
|
||||
*/
|
||||
esp_err_t __attribute__((weak)) bootloader_flash_unlock(void);
|
||||
|
||||
#if CONFIG_SPI_FLASH_OCTAL_32BIT_ADDR_ENABLE
|
||||
/**
|
||||
* @brief Enable 32bits address flash(larger than 16MB) can map to cache.
|
||||
*
|
||||
* @param flash_mode SPI flash working mode.
|
||||
*
|
||||
* @note This can be overridden because it's attribute weak.
|
||||
*/
|
||||
void __attribute__((weak)) bootloader_flash_32bits_address_map_enable(esp_rom_spiflash_read_mode_t flash_mode);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -53,6 +53,8 @@ extern "C" {
|
||||
#define CMD_RESUME 0x7A /* Resume command to clear flash suspend bit */
|
||||
#define CMD_RESETEN 0x66
|
||||
#define CMD_RESET 0x99
|
||||
#define CMD_FASTRD_4B 0x0C
|
||||
#define CMD_SLOWRD_4B 0x13
|
||||
|
||||
|
||||
/* Provide a Flash API for bootloader_support code,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -412,6 +412,33 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
|
||||
return spi_to_esp_err(rc);
|
||||
}
|
||||
|
||||
#if CONFIG_SPI_FLASH_OCTAL_32BIT_ADDR_ENABLE
|
||||
void bootloader_flash_32bits_address_map_enable(esp_rom_spiflash_read_mode_t flash_mode)
|
||||
{
|
||||
esp_rom_opiflash_spi0rd_t cache_rd = {};
|
||||
switch (flash_mode) {
|
||||
case ESP_ROM_SPIFLASH_FASTRD_MODE:
|
||||
cache_rd.addr_bit_len = 32;
|
||||
cache_rd.dummy_bit_len = 8;
|
||||
cache_rd.cmd = CMD_FASTRD_4B;
|
||||
cache_rd.cmd_bit_len = 8;
|
||||
break;
|
||||
case ESP_ROM_SPIFLASH_SLOWRD_MODE:
|
||||
cache_rd.addr_bit_len = 32;
|
||||
cache_rd.dummy_bit_len = 0;
|
||||
cache_rd.cmd = CMD_SLOWRD_4B;
|
||||
cache_rd.cmd_bit_len = 8;
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
cache_hal_disable(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
esp_rom_opiflash_cache_mode_config(flash_mode, &cache_rd);
|
||||
cache_hal_enable(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // BOOTLOADER_BUILD
|
||||
|
||||
|
||||
|
||||
@@ -121,22 +121,6 @@ int bootloader_common_select_otadata(const esp_ota_select_entry_t *two_otadata,
|
||||
|
||||
#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))
|
||||
|
||||
_Static_assert(RTC_RETAIN_MEM_ADDR >= SOC_RTC_DRAM_LOW, "rtc_retain_mem_t structure size is bigger than the RTC memory size. Consider reducing RTC reserved memory size.");
|
||||
|
||||
rtc_retain_mem_t *const rtc_retain_mem = (rtc_retain_mem_t *)RTC_RETAIN_MEM_ADDR;
|
||||
|
||||
#ifndef BOOTLOADER_BUILD
|
||||
#include "heap_memory_layout.h"
|
||||
/* The app needs to be told this memory is reserved, important if configured to use RTC memory as heap.
|
||||
|
||||
Note that keeping this macro here only works when other symbols in this file are referenced by the app, as
|
||||
this feature is otherwise 100% part of the bootloader. However this seems to happen in all apps.
|
||||
*/
|
||||
SOC_RESERVE_MEMORY_REGION(RTC_RETAIN_MEM_ADDR, RTC_RETAIN_MEM_ADDR + sizeof(rtc_retain_mem_t), rtc_retain_mem);
|
||||
#endif
|
||||
|
||||
static uint32_t rtc_retain_mem_size(void) {
|
||||
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
|
||||
/* A custom memory has been reserved by the user, do not consider this memory into CRC calculation as it may change without
|
||||
@@ -144,17 +128,19 @@ static uint32_t rtc_retain_mem_size(void) {
|
||||
* minus the size of everything after (including) `custom` */
|
||||
return offsetof(rtc_retain_mem_t, custom);
|
||||
#else
|
||||
return sizeof(rtc_retain_mem_t) - sizeof(rtc_retain_mem->crc);
|
||||
return sizeof(rtc_retain_mem_t) - sizeof(bootloader_common_get_rtc_retain_mem()->crc);
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool check_rtc_retain_mem(void)
|
||||
{
|
||||
rtc_retain_mem_t* rtc_retain_mem = bootloader_common_get_rtc_retain_mem();
|
||||
return esp_rom_crc32_le(UINT32_MAX, (uint8_t*)rtc_retain_mem, rtc_retain_mem_size()) == rtc_retain_mem->crc && rtc_retain_mem->crc != UINT32_MAX;
|
||||
}
|
||||
|
||||
static void update_rtc_retain_mem_crc(void)
|
||||
{
|
||||
rtc_retain_mem_t* rtc_retain_mem = bootloader_common_get_rtc_retain_mem();
|
||||
rtc_retain_mem->crc = esp_rom_crc32_le(UINT32_MAX, (uint8_t*)rtc_retain_mem, rtc_retain_mem_size());
|
||||
}
|
||||
|
||||
@@ -163,14 +149,14 @@ NOINLINE_ATTR void bootloader_common_reset_rtc_retain_mem(void)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
memset(rtc_retain_mem, 0, sizeof(rtc_retain_mem_t));
|
||||
memset(bootloader_common_get_rtc_retain_mem(), 0, sizeof(rtc_retain_mem_t));
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
|
||||
uint16_t bootloader_common_get_rtc_retain_mem_reboot_counter(void)
|
||||
{
|
||||
if (check_rtc_retain_mem()) {
|
||||
return rtc_retain_mem->reboot_counter;
|
||||
return bootloader_common_get_rtc_retain_mem()->reboot_counter;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -178,13 +164,14 @@ uint16_t bootloader_common_get_rtc_retain_mem_reboot_counter(void)
|
||||
esp_partition_pos_t* bootloader_common_get_rtc_retain_mem_partition(void)
|
||||
{
|
||||
if (check_rtc_retain_mem()) {
|
||||
return &rtc_retain_mem->partition;
|
||||
return &bootloader_common_get_rtc_retain_mem()->partition;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void bootloader_common_update_rtc_retain_mem(esp_partition_pos_t* partition, bool reboot_counter)
|
||||
{
|
||||
rtc_retain_mem_t* rtc_retain_mem = bootloader_common_get_rtc_retain_mem();
|
||||
if (reboot_counter) {
|
||||
if (!check_rtc_retain_mem()) {
|
||||
bootloader_common_reset_rtc_retain_mem();
|
||||
@@ -206,6 +193,13 @@ void bootloader_common_update_rtc_retain_mem(esp_partition_pos_t* partition, boo
|
||||
|
||||
rtc_retain_mem_t* bootloader_common_get_rtc_retain_mem(void)
|
||||
{
|
||||
return rtc_retain_mem;
|
||||
#ifdef BOOTLOADER_BUILD
|
||||
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_HIGH - sizeof(rtc_retain_mem_t))
|
||||
static rtc_retain_mem_t *const s_bootloader_retain_mem = (rtc_retain_mem_t *)RTC_RETAIN_MEM_ADDR;
|
||||
return s_bootloader_retain_mem;
|
||||
#else
|
||||
static __attribute__((section(".bootloader_data_rtc_mem"))) rtc_retain_mem_t s_bootloader_retain_mem;
|
||||
return &s_bootloader_retain_mem;
|
||||
#endif // !BOOTLOADER_BUILD
|
||||
}
|
||||
#endif // defined( CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP ) || defined( CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC )
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -29,6 +29,9 @@
|
||||
#include "esp32c2/rom/ets_sys.h"
|
||||
#include "esp32c2/rom/uart.h"
|
||||
#endif
|
||||
#if SOC_USB_SERIAL_JTAG_SUPPORTED
|
||||
#include "hal/usb_phy_ll.h"
|
||||
#endif
|
||||
#include "esp_rom_gpio.h"
|
||||
#include "esp_rom_uart.h"
|
||||
#include "esp_rom_sys.h"
|
||||
@@ -105,8 +108,12 @@ void bootloader_console_init(void)
|
||||
#endif
|
||||
|
||||
esp_rom_uart_usb_acm_init(s_usb_cdc_buf, sizeof(s_usb_cdc_buf));
|
||||
esp_rom_uart_set_as_console(ESP_ROM_UART_USB);
|
||||
esp_rom_uart_set_as_console(ESP_ROM_USB_OTG_NUM);
|
||||
esp_rom_install_channel_putc(1, bootloader_console_write_char_usb);
|
||||
#if SOC_USB_SERIAL_JTAG_SUPPORTED
|
||||
usb_phy_ll_usb_wrap_pad_enable(&USB_WRAP, true);
|
||||
usb_phy_ll_int_otg_enable(&USB_WRAP);
|
||||
#endif
|
||||
}
|
||||
#endif //CONFIG_ESP_CONSOLE_USB_CDC
|
||||
|
||||
|
||||
@@ -26,9 +26,11 @@ void abort(void)
|
||||
#if !CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT
|
||||
esp_rom_printf("abort() was called at PC 0x%08x\r\n", (intptr_t)__builtin_return_address(0) - 3);
|
||||
#endif
|
||||
#if CONFIG_ESP_DEBUG_OCDAWARE
|
||||
if (esp_cpu_dbgr_is_attached()) {
|
||||
esp_cpu_dbgr_break();
|
||||
}
|
||||
#endif
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,7 +220,9 @@ static esp_err_t bootloader_init_spi_flash(void)
|
||||
#if CONFIG_ESPTOOLPY_FLASHMODE_QIO || CONFIG_ESPTOOLPY_FLASHMODE_QOUT
|
||||
bootloader_enable_qio_mode();
|
||||
#endif
|
||||
|
||||
#if CONFIG_SPI_FLASH_OCTAL_32BIT_ADDR_ENABLE
|
||||
bootloader_flash_32bits_address_map_enable(bootloader_flash_get_spi_mode());
|
||||
#endif
|
||||
print_flash_info(&bootloader_image_hdr);
|
||||
update_flash_config(&bootloader_image_hdr);
|
||||
//ensure the flash is write-protected
|
||||
|
||||
@@ -860,7 +860,7 @@ static esp_err_t verify_secure_boot_signature(bootloader_sha256_handle_t sha_han
|
||||
bootloader_munmap(simple_hash);
|
||||
}
|
||||
|
||||
#if CONFIG_SECURE_BOOT_V2_ENABLED
|
||||
#if CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME
|
||||
// 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 = ALIGN_UP(end, FLASH_SECTOR_SIZE);
|
||||
@@ -870,7 +870,7 @@ static esp_err_t verify_secure_boot_signature(bootloader_sha256_handle_t sha_han
|
||||
bootloader_munmap(padding);
|
||||
end = padded_end;
|
||||
}
|
||||
#endif
|
||||
#endif // CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME
|
||||
|
||||
bootloader_sha256_finish(sha_handle, image_digest);
|
||||
|
||||
|
||||
@@ -144,9 +144,9 @@ static esp_err_t secure_boot_v2_check(bool *need_fix)
|
||||
#endif
|
||||
#endif // CONFIG_SECURE_BOOT
|
||||
|
||||
#if CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
|
||||
#if (CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME) && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
|
||||
|
||||
static void rsa_check_signature_on_update_check(void)
|
||||
static void check_signature_on_update_check(void)
|
||||
{
|
||||
// We rely on the keys used to sign this app to verify the next app on OTA, so make sure there is at
|
||||
// least one to avoid a stuck firmware
|
||||
@@ -164,7 +164,7 @@ static void rsa_check_signature_on_update_check(void)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif // CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
|
||||
#endif // (CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME) && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
|
||||
|
||||
void esp_secure_boot_init_checks(void)
|
||||
{
|
||||
@@ -184,9 +184,9 @@ void esp_secure_boot_init_checks(void)
|
||||
#endif // CONFIG_SECURE_BOOT
|
||||
|
||||
|
||||
#if CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
|
||||
rsa_check_signature_on_update_check();
|
||||
#endif // CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
|
||||
#if (CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME) && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
|
||||
check_signature_on_update_check();
|
||||
#endif // (CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME) && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ if(CONFIG_BT_ENABLED)
|
||||
|
||||
set(srcs "")
|
||||
set(include_dirs "")
|
||||
set(ldfragments "linker.lf")
|
||||
|
||||
if(CONFIG_IDF_TARGET_ESP32)
|
||||
list(APPEND srcs "controller/esp32/bt.c"
|
||||
@@ -22,6 +23,7 @@ if(CONFIG_BT_ENABLED)
|
||||
list(APPEND include_dirs include/esp32h2/include)
|
||||
|
||||
elseif(CONFIG_IDF_TARGET_ESP32C2)
|
||||
set(ldfragments "linker.lf.esp32c2")
|
||||
list(APPEND srcs "controller/esp32c2/bt.c")
|
||||
list(APPEND include_dirs include/esp32c2/include)
|
||||
endif()
|
||||
@@ -321,6 +323,7 @@ if(CONFIG_BT_ENABLED)
|
||||
"host/bluedroid/stack/gatt/gatt_db.c"
|
||||
"host/bluedroid/stack/gatt/gatt_main.c"
|
||||
"host/bluedroid/stack/gatt/gatt_sr.c"
|
||||
"host/bluedroid/stack/gatt/gatt_sr_hash.c"
|
||||
"host/bluedroid/stack/gatt/gatt_utils.c"
|
||||
"host/bluedroid/stack/hcic/hciblecmds.c"
|
||||
"host/bluedroid/stack/hcic/hcicmds.c"
|
||||
@@ -522,6 +525,7 @@ if(CONFIG_BT_ENABLED)
|
||||
host/nimble/nimble/nimble/host/services/dis/include
|
||||
host/nimble/nimble/nimble/host/services/gap/include
|
||||
host/nimble/nimble/nimble/host/services/gatt/include
|
||||
host/nimble/nimble/nimble/host/services/htp/include
|
||||
host/nimble/nimble/nimble/host/services/ias/include
|
||||
host/nimble/nimble/nimble/host/services/ipss/include
|
||||
host/nimble/nimble/nimble/host/services/lls/include
|
||||
@@ -537,6 +541,7 @@ if(CONFIG_BT_ENABLED)
|
||||
"host/nimble/nimble/nimble/host/services/ias/src/ble_svc_ias.c"
|
||||
"host/nimble/nimble/nimble/host/services/ipss/src/ble_svc_ipss.c"
|
||||
"host/nimble/nimble/nimble/host/services/ans/src/ble_svc_ans.c"
|
||||
"host/nimble/nimble/nimble/host/services/htp/src/ble_svc_htp.c"
|
||||
"host/nimble/nimble/nimble/host/services/gap/src/ble_svc_gap.c"
|
||||
"host/nimble/nimble/nimble/host/services/bas/src/ble_svc_bas.c"
|
||||
"host/nimble/nimble/nimble/host/services/dis/src/ble_svc_dis.c"
|
||||
@@ -676,13 +681,12 @@ if(CONFIG_BT_ENABLED)
|
||||
|
||||
endif()
|
||||
|
||||
# requirements can't depend on config
|
||||
idf_component_register(SRCS "${srcs}"
|
||||
INCLUDE_DIRS "${include_dirs}"
|
||||
PRIV_INCLUDE_DIRS "${priv_include_dirs}"
|
||||
REQUIRES esp_timer esp_wifi
|
||||
PRIV_REQUIRES nvs_flash soc esp_pm esp_phy mbedtls driver vfs
|
||||
LDFRAGMENTS "linker.lf")
|
||||
LDFRAGMENTS "${ldfragments}")
|
||||
|
||||
if(CONFIG_BT_ENABLED)
|
||||
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-implicit-fallthrough -Wno-unused-const-variable)
|
||||
|
||||
@@ -68,6 +68,17 @@ menu "Bluetooth"
|
||||
source "$IDF_PATH/components/bt/controller/$IDF_TARGET/Kconfig.in"
|
||||
endmenu
|
||||
|
||||
config BT_RELEASE_IRAM
|
||||
depends on BT_ENABLED && BT_LE_RELEASE_IRAM_SUPPORTED
|
||||
bool "Release Bluetooth text (READ DOCS FIRST)"
|
||||
default n
|
||||
help
|
||||
This option release Bluetooth text section and merge Bluetooth data, bss & text into
|
||||
a large free heap region when esp_bt_mem_release is called, total saving ~21kB or more of IRAM.
|
||||
ESP32-C2 only 3 configurable PMP entries available, rest of them are hard-coded.
|
||||
We cannot split the memory into 3 different regions (IRAM, BLE-IRAM, DRAM).
|
||||
So this option will disable the PMP (ESP_SYSTEM_PMP_IDRAM_SPLIT)
|
||||
|
||||
endmenu
|
||||
|
||||
menuconfig BLE_MESH
|
||||
|
||||
@@ -254,6 +254,32 @@ bool config_remove_section(config_t *config, const char *section)
|
||||
return list_remove(config->sections, sec);
|
||||
}
|
||||
|
||||
bool config_update_newest_section(config_t *config, const char *section)
|
||||
{
|
||||
assert(config != NULL);
|
||||
assert(section != NULL);
|
||||
|
||||
list_node_t *first_node = list_begin(config->sections);
|
||||
if (first_node == NULL) {
|
||||
return false;
|
||||
}
|
||||
section_t *first_sec = list_node(first_node);
|
||||
if (strcmp(first_sec->name, section) == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (const list_node_t *node = list_begin(config->sections); node != list_end(config->sections); node = list_next(node)) {
|
||||
section_t *sec = list_node(node);
|
||||
if (strcmp(sec->name, section) == 0) {
|
||||
list_delete(config->sections, sec);
|
||||
list_prepend(config->sections, sec);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool config_remove_key(config_t *config, const char *section, const char *key)
|
||||
{
|
||||
assert(config != NULL);
|
||||
|
||||
@@ -99,6 +99,11 @@ void config_set_string(config_t *config, const char *section, const char *key, c
|
||||
// Neither |config| nor |section| may be NULL.
|
||||
bool config_remove_section(config_t *config, const char *section);
|
||||
|
||||
// Updates |section| to be the first section in |config|. Return true if |section| is in
|
||||
// |config| and updated successfully, false otherwise.
|
||||
// Neither |config| nor |section| may be NULL.
|
||||
bool config_update_newest_section(config_t *config, const char *section);
|
||||
|
||||
// Removes one specific |key| residing in |section| of the |config|. Returns true
|
||||
// if the section and key were found and the key was removed, false otherwise.
|
||||
// None of |config|, |section|, or |key| may be NULL.
|
||||
|
||||
@@ -205,6 +205,11 @@ menu "HCI UART(H4) Options"
|
||||
help
|
||||
UART Baudrate for HCI. Please use standard baudrate.
|
||||
|
||||
config BTDM_CTRL_HCI_UART_FLOW_CTRL_EN
|
||||
bool "Enable UART flow control"
|
||||
depends on BTDM_CTRL_HCI_MODE_UART_H4
|
||||
default y
|
||||
|
||||
endmenu
|
||||
|
||||
menu "MODEM SLEEP Options"
|
||||
|
||||
@@ -235,6 +235,8 @@ extern int coex_wifi_channel_get(uint8_t *primary, uint8_t *secondary);
|
||||
extern int coex_register_wifi_channel_change_callback(void *cb);
|
||||
/* Shutdown */
|
||||
extern void esp_bt_controller_shutdown(void);
|
||||
extern void sdk_config_set_bt_pll_track_enable(bool enable);
|
||||
extern void sdk_config_set_uart_flow_ctrl_enable(bool enable);
|
||||
|
||||
extern char _bss_start_btdm;
|
||||
extern char _bss_end_btdm;
|
||||
@@ -909,7 +911,11 @@ static void *malloc_internal_wrapper(size_t size)
|
||||
|
||||
static int32_t IRAM_ATTR read_mac_wrapper(uint8_t mac[6])
|
||||
{
|
||||
return esp_read_mac(mac, ESP_MAC_BT);
|
||||
int ret = esp_read_mac(mac, ESP_MAC_BT);
|
||||
ESP_LOGI(BTDM_LOG_TAG, "Bluetooth MAC: %02x:%02x:%02x:%02x:%02x:%02x",
|
||||
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void IRAM_ATTR srand_wrapper(unsigned int seed)
|
||||
@@ -1567,6 +1573,12 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
btdm_controller_set_sleep_mode(BTDM_MODEM_SLEEP_MODE_NONE);
|
||||
#endif
|
||||
|
||||
#if CONFIG_BTDM_CTRL_HCI_UART_FLOW_CTRL_EN
|
||||
sdk_config_set_uart_flow_ctrl_enable(true);
|
||||
#else
|
||||
sdk_config_set_uart_flow_ctrl_enable(false);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM_ENABLE
|
||||
if (!s_btdm_allow_light_sleep) {
|
||||
if ((err = esp_pm_lock_create(ESP_PM_NO_LIGHT_SLEEP, 0, "btLS", &s_light_sleep_pm_lock)) != ESP_OK) {
|
||||
@@ -1718,6 +1730,8 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
|
||||
btdm_controller_enable_sleep(true);
|
||||
}
|
||||
|
||||
sdk_config_set_bt_pll_track_enable(true);
|
||||
|
||||
// inititalize bluetooth baseband
|
||||
btdm_check_and_init_bb();
|
||||
|
||||
|
||||
@@ -253,6 +253,33 @@ config BT_LE_CONTROLLER_TASK_STACK_SIZE
|
||||
help
|
||||
This configures stack size of NimBLE controller task
|
||||
|
||||
config BT_LE_CONTROLLER_LOG_ENABLED
|
||||
bool "Controller log enable"
|
||||
default n
|
||||
help
|
||||
Enable controller log
|
||||
|
||||
config BT_LE_CONTROLLER_LOG_CTRL_ENABLED
|
||||
bool "enable controller log module"
|
||||
depends on BT_LE_CONTROLLER_LOG_ENABLED
|
||||
default y
|
||||
help
|
||||
Enable controller log module
|
||||
|
||||
config BT_LE_CONTROLLER_LOG_HCI_ENABLED
|
||||
bool "enable HCI log module"
|
||||
depends on BT_LE_CONTROLLER_LOG_ENABLED
|
||||
default y
|
||||
help
|
||||
Enable hci log module
|
||||
|
||||
config BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
||||
bool "Controller log dump mode only"
|
||||
depends on BT_LE_CONTROLLER_LOG_ENABLED
|
||||
default y
|
||||
help
|
||||
Only operate in dump mode
|
||||
|
||||
config BT_LE_LL_RESOLV_LIST_SIZE
|
||||
int "BLE LL Resolving list size"
|
||||
range 1 5
|
||||
@@ -345,7 +372,7 @@ config BT_LE_MAX_CONNECTIONS
|
||||
choice BT_LE_COEX_PHY_CODED_TX_RX_TLIM
|
||||
prompt "Coexistence: limit on MAX Tx/Rx time for coded-PHY connection"
|
||||
default BT_LE_COEX_PHY_CODED_TX_RX_TLIM_DIS
|
||||
depends on !BT_NIMBLE_ENABLED
|
||||
depends on ESP32_WIFI_SW_COEXIST_ENABLE
|
||||
help
|
||||
When using PHY-Coded in BLE connection, limitation on max tx/rx time can be applied to
|
||||
better avoid dramatic performance deterioration of Wi-Fi.
|
||||
@@ -363,7 +390,7 @@ endchoice
|
||||
|
||||
config BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF
|
||||
int
|
||||
depends on !BT_NIMBLE_ENABLED
|
||||
default 0 if !ESP32_WIFI_SW_COEXIST_ENABLE
|
||||
default 1 if BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EN
|
||||
default 0 if BT_LE_COEX_PHY_CODED_TX_RX_TLIM_DIS
|
||||
|
||||
@@ -373,24 +400,45 @@ config BT_LE_SLEEP_ENABLE
|
||||
help
|
||||
Enable BLE sleep
|
||||
|
||||
choice BT_LE_WAKEUP_SOURCE
|
||||
prompt "BLE light sleep wakeup source"
|
||||
depends on BT_LE_SLEEP_ENABLE
|
||||
default BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
|
||||
config BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
|
||||
bool "Use ESP timer to wakeup CPU"
|
||||
help
|
||||
Use esp timer to wakeup CPU
|
||||
|
||||
config BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
|
||||
bool "Use BLE rtc timer to wakeup CPU"
|
||||
help
|
||||
Use BLE rtc timer to wakeup CPU
|
||||
endchoice
|
||||
|
||||
config BT_LE_USE_ESP_TIMER
|
||||
bool "Use Esp Timer for callout"
|
||||
depends on !BT_NIMBLE_ENABLED
|
||||
default y
|
||||
help
|
||||
Set this option to use Esp Timer which has higher priority timer instead of FreeRTOS timer
|
||||
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
|
||||
bool "BLE adv report flow control supported"
|
||||
default y
|
||||
help
|
||||
The function is mainly used to enable flow control for advertising reports. When it is enabled,
|
||||
advertising reports will be discarded by the controller if the number of unprocessed advertising
|
||||
reports exceeds the size of BLE adv report flow control.
|
||||
|
||||
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM
|
||||
int "BLE adv report flow control number"
|
||||
depends on BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
|
||||
range 50 1000
|
||||
default 100
|
||||
help
|
||||
The number of unprocessed advertising report that bluetooth host can save.If you set
|
||||
`BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a small value, this may cause adv packets lost.
|
||||
If you set `BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a large value, bluetooth host may cache a
|
||||
lot of adv packets and this may cause system memory run out. For example, if you set
|
||||
it to 50, the maximum memory consumed by host is 35 * 50 bytes. Please set
|
||||
`BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` according to your system free memory and handle adv
|
||||
packets as fast as possible, otherwise it will cause adv packets lost.
|
||||
|
||||
config BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD
|
||||
int "BLE adv lost event threshold value"
|
||||
depends on BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
|
||||
range 1 1000
|
||||
default 20
|
||||
help
|
||||
When adv report flow control is enabled, The ADV lost event will be generated when the number
|
||||
of ADV packets lost in the controller reaches this threshold. It is better to set a larger value.
|
||||
If you set `BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD` to a small value or printf every adv lost event, it
|
||||
may cause adv packets lost more.
|
||||
|
||||
config BT_LE_RELEASE_IRAM_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -46,6 +46,10 @@
|
||||
#include "hci/hci_hal.h"
|
||||
#endif
|
||||
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
#include "esp_private/pm_impl.h"
|
||||
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
|
||||
@@ -54,6 +58,8 @@
|
||||
|
||||
#include "soc/syscon_reg.h"
|
||||
#include "soc/dport_access.h"
|
||||
|
||||
#include "hal/efuse_ll.h"
|
||||
/* Macro definition
|
||||
************************************************************************
|
||||
*/
|
||||
@@ -70,12 +76,12 @@
|
||||
#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
|
||||
#endif // CONFIG_BT_BLUEDROID_ENABLED
|
||||
|
||||
|
||||
/* Types definition
|
||||
************************************************************************
|
||||
*/
|
||||
|
||||
struct osi_coex_funcs_t {
|
||||
uint32_t _magic;
|
||||
uint32_t _version;
|
||||
@@ -108,14 +114,21 @@ struct ext_funcs_t {
|
||||
uint32_t magic;
|
||||
};
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
/* External functions or variables
|
||||
************************************************************************
|
||||
*/
|
||||
|
||||
extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
|
||||
extern int coex_core_ble_conn_dyn_prio_get(bool *low, bool *high);
|
||||
extern int ble_controller_init(esp_bt_controller_config_t *cfg);
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
extern int ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
|
||||
extern int ble_log_deinit_async(void);
|
||||
extern void ble_log_async_output_dump_all(bool output);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
extern int ble_controller_deinit(void);
|
||||
extern int ble_controller_enable(uint8_t mode);
|
||||
extern int ble_controller_disable(void);
|
||||
@@ -131,6 +144,9 @@ extern uint32_t r_os_cputime_get32(void);
|
||||
extern uint32_t r_os_cputime_ticks_to_usecs(uint32_t ticks);
|
||||
extern void r_ble_lll_rfmgmt_set_sleep_cb(void *s_cb, void *w_cb, void *s_arg, void *w_arg, uint32_t us_to_enabled);
|
||||
extern void r_ble_rtc_wake_up_state_clr(void);
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
extern void esp_ble_set_wakeup_overhead(uint32_t overhead);
|
||||
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
|
||||
extern int os_msys_init(void);
|
||||
extern void os_msys_buf_free(void);
|
||||
extern int ble_sm_alg_gen_dhkey(const uint8_t *peer_pub_key_x,
|
||||
@@ -141,14 +157,14 @@ extern int ble_txpwr_set(esp_ble_enhanced_power_type_t power_type, uint16_t hand
|
||||
extern int ble_txpwr_get(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
|
||||
extern int ble_get_npl_element_info(esp_bt_controller_config_t *cfg, ble_npl_count_info_t * npl_info);
|
||||
extern void bt_track_pll_cap(void);
|
||||
extern uint32_t _bt_bss_start;
|
||||
|
||||
#if CONFIG_BT_RELEASE_IRAM
|
||||
extern uint32_t _iram_bt_text_start;
|
||||
extern uint32_t _bss_bt_end;
|
||||
#else
|
||||
extern uint32_t _bt_bss_end;
|
||||
extern uint32_t _nimble_bss_start;
|
||||
extern uint32_t _nimble_bss_end;
|
||||
extern uint32_t _nimble_data_start;
|
||||
extern uint32_t _nimble_data_end;
|
||||
extern uint32_t _bt_data_start;
|
||||
extern uint32_t _bt_data_end;
|
||||
extern uint32_t _bt_controller_data_start;
|
||||
#endif
|
||||
|
||||
/* Local Function Declaration
|
||||
*********************************************************************
|
||||
@@ -166,8 +182,9 @@ static int hci_uart_config_wrapper(int uart_no, int32_t speed, uint8_t databits,
|
||||
static int hci_uart_close_wrapper(int uart_no);
|
||||
static void hci_uart_blocking_tx_wrapper(int port, uint8_t data);
|
||||
static int hci_uart_init_wrapper(int uart_no, void *cfg);
|
||||
#endif
|
||||
static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler, void *arg, void **ret_handle_in);
|
||||
#endif // CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
|
||||
void *arg, void **ret_handle_in);
|
||||
static int esp_intr_free_wrapper(void **ret_handle);
|
||||
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
|
||||
static uint32_t osi_random_wrapper(void);
|
||||
@@ -175,29 +192,27 @@ static void esp_reset_rpa_moudle(void);
|
||||
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
|
||||
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
|
||||
const uint8_t *our_priv_key, uint8_t *out_dhkey);
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
/* Local variable definition
|
||||
***************************************************************************
|
||||
*/
|
||||
|
||||
/* Static variable declare */
|
||||
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
const static uint32_t log_bufs_size[] = {2048, 1024, 1024};
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
/* This variable tells if BLE is running */
|
||||
static bool s_ble_active = false;
|
||||
#ifdef CONFIG_PM_ENABLE
|
||||
static DRAM_ATTR esp_pm_lock_handle_t s_pm_lock = NULL;
|
||||
#define BTDM_MIN_TIMER_UNCERTAINTY_US (200)
|
||||
#endif /* #ifdef CONFIG_PM_ENABLE */
|
||||
#endif // CONFIG_PM_ENABLE
|
||||
|
||||
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
|
||||
#define BLE_RTC_DELAY_US (1800)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
|
||||
#define BLE_RTC_DELAY_US (0)
|
||||
static void ble_sleep_timer_callback(void *arg);
|
||||
static DRAM_ATTR esp_timer_handle_t s_ble_sleep_timer = NULL;
|
||||
#endif
|
||||
|
||||
|
||||
static const struct osi_coex_funcs_t s_osi_coex_funcs_ro = {
|
||||
@@ -240,8 +255,12 @@ static void IRAM_ATTR esp_reset_rpa_moudle(void)
|
||||
DPORT_CLEAR_PERI_REG_MASK(SYSTEM_CORE_RST_EN_REG, BLE_RPA_REST_BIT);
|
||||
}
|
||||
|
||||
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2)
|
||||
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
|
||||
uint32_t param1, uint32_t param2)
|
||||
{
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
esp_ble_controller_log_dump_all(true);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
BT_ASSERT_PRINT("BLE assert: line %d in function %s, param: 0x%x, 0x%x", ln, fn, param1, param2);
|
||||
assert(0);
|
||||
}
|
||||
@@ -255,17 +274,17 @@ static void coex_schm_status_bit_set_wrapper(uint32_t type, uint32_t status)
|
||||
{
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_schm_status_bit_set(type, status);
|
||||
#endif
|
||||
#endif // CONFIG_SW_COEXIST_ENABLE
|
||||
}
|
||||
|
||||
static void coex_schm_status_bit_clear_wrapper(uint32_t type, uint32_t status)
|
||||
{
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_schm_status_bit_clear(type, status);
|
||||
#endif
|
||||
#endif // CONFIG_SW_COEXIST_ENABLE
|
||||
}
|
||||
#ifdef CONFIG_BT_BLUEDROID_ENABLED
|
||||
|
||||
#ifdef CONFIG_BT_BLUEDROID_ENABLED
|
||||
bool esp_vhci_host_check_send_available(void)
|
||||
{
|
||||
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
|
||||
@@ -318,6 +337,7 @@ void esp_vhci_host_send_packet(uint8_t *data, uint16_t len)
|
||||
if (*(data) == DATA_TYPE_COMMAND) {
|
||||
struct ble_hci_cmd *cmd = NULL;
|
||||
cmd = (struct ble_hci_cmd *) ble_hci_trans_buf_alloc(BLE_HCI_TRANS_BUF_CMD);
|
||||
assert(cmd);
|
||||
memcpy((uint8_t *)cmd, data + 1, len - 1);
|
||||
ble_hci_trans_hs_cmd_tx((uint8_t *)cmd);
|
||||
}
|
||||
@@ -328,7 +348,6 @@ void esp_vhci_host_send_packet(uint8_t *data, uint16_t len)
|
||||
assert(os_mbuf_append(om, &data[1], len - 1) == 0);
|
||||
ble_hci_trans_hs_acl_tx(om);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
esp_err_t esp_vhci_host_register_callback(const esp_vhci_host_callback_t *callback)
|
||||
@@ -341,8 +360,7 @@ esp_err_t esp_vhci_host_register_callback(const esp_vhci_host_callback_t *callba
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // CONFIG_BT_BLUEDROID_ENABLED
|
||||
static int task_create_wrapper(void *task_func, const char *name, uint32_t stack_depth, void *param, uint32_t prio, void *task_handle, uint32_t core_id)
|
||||
{
|
||||
return (uint32_t)xTaskCreatePinnedToCore(task_func, name, stack_depth, param, prio, task_handle, (core_id < portNUM_PROCESSORS ? core_id : tskNO_AFFINITY));
|
||||
@@ -387,8 +405,9 @@ static int hci_uart_init_cbs_wrapper(int uart_no, hci_uart_tx_char tx_func,
|
||||
}
|
||||
|
||||
|
||||
static int hci_uart_config_wrapper(int port_num, int32_t baud_rate, uint8_t data_bits, uint8_t stop_bits,
|
||||
uart_parity_t parity, uart_hw_flowcontrol_t flow_ctl)
|
||||
static int hci_uart_config_wrapper(int port_num, int32_t baud_rate, uint8_t data_bits,
|
||||
uint8_t stop_bits,uart_parity_t parity,
|
||||
uart_hw_flowcontrol_t flow_ctl)
|
||||
{
|
||||
int rc = -1;
|
||||
rc = hci_uart_config(port_num, baud_rate, data_bits, stop_bits, parity, flow_ctl);
|
||||
@@ -435,41 +454,22 @@ static int esp_intr_free_wrapper(void **ret_handle)
|
||||
return rc;
|
||||
}
|
||||
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
void sleep_modem_light_sleep_overhead_set(uint32_t overhead)
|
||||
{
|
||||
esp_ble_set_wakeup_overhead(overhead);
|
||||
}
|
||||
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
|
||||
|
||||
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
|
||||
{
|
||||
if (!s_ble_active) {
|
||||
return;
|
||||
}
|
||||
#ifdef CONFIG_PM_ENABLE
|
||||
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
|
||||
uint32_t delta_tick;
|
||||
uint32_t us_to_sleep;
|
||||
uint32_t sleep_tick;
|
||||
uint32_t tick_invalid = *(uint32_t*)(arg);
|
||||
assert(arg != NULL);
|
||||
if (!tick_invalid) {
|
||||
sleep_tick = r_os_cputime_get32();
|
||||
// start a timer to wake up and acquire the pm_lock before modem_sleep awakes
|
||||
delta_tick = enable_tick - sleep_tick;
|
||||
if (delta_tick & 0x80000000) {
|
||||
return;
|
||||
}
|
||||
us_to_sleep = r_os_cputime_ticks_to_usecs(delta_tick);
|
||||
if (us_to_sleep <= BTDM_MIN_TIMER_UNCERTAINTY_US) {
|
||||
return;
|
||||
}
|
||||
esp_err_t err = esp_timer_start_once(s_ble_sleep_timer, us_to_sleep - BTDM_MIN_TIMER_UNCERTAINTY_US);
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ESP timer start failed\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
|
||||
|
||||
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
|
||||
r_ble_rtc_wake_up_state_clr();
|
||||
#endif
|
||||
esp_pm_lock_release(s_pm_lock);
|
||||
r_ble_rtc_wake_up_state_clr();
|
||||
#endif // CONFIG_PM_ENABLE
|
||||
esp_phy_disable();
|
||||
s_ble_active = false;
|
||||
@@ -488,16 +488,6 @@ IRAM_ATTR void controller_wakeup_cb(void *arg)
|
||||
s_ble_active = true;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_ENABLE
|
||||
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
|
||||
static void ble_sleep_timer_callback(void * arg)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
|
||||
#endif // CONFIG_PM_ENABLE
|
||||
|
||||
esp_err_t controller_sleep_init(void)
|
||||
{
|
||||
esp_err_t rc = 0;
|
||||
@@ -517,73 +507,43 @@ esp_err_t controller_sleep_init(void)
|
||||
if (rc != ESP_OK) {
|
||||
goto error;
|
||||
}
|
||||
esp_pm_lock_acquire(s_pm_lock);
|
||||
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
|
||||
esp_timer_create_args_t create_args = {
|
||||
.callback = ble_sleep_timer_callback,
|
||||
.arg = NULL,
|
||||
.name = "btSlp"
|
||||
};
|
||||
rc = esp_timer_create(&create_args, &s_ble_sleep_timer);
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
esp_sleep_enable_bt_wakeup();
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer");
|
||||
|
||||
rc = esp_pm_register_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
|
||||
if (rc != ESP_OK) {
|
||||
goto error;
|
||||
}
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is ESP timer");
|
||||
#endif //CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
|
||||
|
||||
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
|
||||
esp_sleep_enable_bt_wakeup();
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer");
|
||||
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
|
||||
|
||||
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
return rc;
|
||||
|
||||
error:
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
esp_sleep_disable_bt_wakeup();
|
||||
esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
|
||||
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
|
||||
/*lock should release first and then delete*/
|
||||
if (s_pm_lock != NULL) {
|
||||
esp_pm_lock_release(s_pm_lock);
|
||||
esp_pm_lock_delete(s_pm_lock);
|
||||
s_pm_lock = NULL;
|
||||
}
|
||||
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
|
||||
if (s_ble_sleep_timer != NULL) {
|
||||
esp_timer_stop(s_ble_sleep_timer);
|
||||
esp_timer_delete(s_ble_sleep_timer);
|
||||
s_ble_sleep_timer = NULL;
|
||||
}
|
||||
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
|
||||
|
||||
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
|
||||
esp_sleep_disable_bt_wakeup();
|
||||
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
|
||||
|
||||
#endif //CONFIG_PM_ENABLE
|
||||
return rc;
|
||||
}
|
||||
|
||||
void controller_sleep_deinit(void)
|
||||
{
|
||||
#ifdef CONFIG_PM_ENABLE
|
||||
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
|
||||
#ifdef CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
r_ble_rtc_wake_up_state_clr();
|
||||
esp_sleep_disable_bt_wakeup();
|
||||
#endif //CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
|
||||
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_AUTO);
|
||||
|
||||
esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
|
||||
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
#ifdef CONFIG_PM_ENABLE
|
||||
/*lock should release first and then delete*/
|
||||
if (s_ble_active) {
|
||||
esp_pm_lock_release(s_pm_lock);
|
||||
}
|
||||
|
||||
esp_pm_lock_delete(s_pm_lock);
|
||||
s_pm_lock = NULL;
|
||||
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
|
||||
if (s_ble_sleep_timer != NULL) {
|
||||
esp_timer_stop(s_ble_sleep_timer);
|
||||
esp_timer_delete(s_ble_sleep_timer);
|
||||
s_ble_sleep_timer = NULL;
|
||||
}
|
||||
#endif //CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
|
||||
#endif //CONFIG_PM_ENABLE
|
||||
}
|
||||
|
||||
@@ -674,29 +634,45 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
#endif
|
||||
esp_phy_modem_init();
|
||||
periph_module_enable(PERIPH_BT_MODULE);
|
||||
|
||||
// init phy
|
||||
esp_phy_enable();
|
||||
s_ble_active = true;
|
||||
|
||||
// init bb
|
||||
bt_bb_v2_init_cmplx(1);
|
||||
periph_module_reset(PERIPH_BT_MODULE);
|
||||
|
||||
if (ble_osi_coex_funcs_register((struct osi_coex_funcs_t *)&s_osi_coex_funcs_ro) != 0) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "osi coex funcs reg failed");
|
||||
ret = ESP_ERR_INVALID_ARG;
|
||||
goto free_controller;
|
||||
goto modem_deint;
|
||||
}
|
||||
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_init();
|
||||
#endif
|
||||
|
||||
ret = ble_controller_init(cfg);
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
|
||||
goto free_controller;
|
||||
goto modem_deint;
|
||||
}
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
interface_func_t bt_controller_log_interface;
|
||||
bt_controller_log_interface = esp_bt_controller_log_interface;
|
||||
uint8_t buffers = 0;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
|
||||
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
|
||||
buffers |= ESP_BLE_LOG_BUF_HCI;
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
||||
ret = ble_log_init_async(bt_controller_log_interface, false, buffers, (uint32_t *)log_bufs_size);
|
||||
#else
|
||||
ret = ble_log_init_async(bt_controller_log_interface, true, buffers, (uint32_t *)log_bufs_size);
|
||||
#endif // CONFIG_BT_CONTROLLER_LOG_DUMP
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
|
||||
goto controller_init_err;
|
||||
}
|
||||
#endif // CONFIG_BT_CONTROLLER_LOG_ENABLED
|
||||
|
||||
ret = controller_sleep_init();
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "controller_sleep_init failed %d", ret);
|
||||
@@ -717,9 +693,14 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
return ESP_OK;
|
||||
free_controller:
|
||||
controller_sleep_deinit();
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
controller_init_err:
|
||||
ble_log_deinit_async();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
ble_controller_deinit();
|
||||
esp_phy_disable();
|
||||
modem_deint:
|
||||
esp_phy_modem_deinit();
|
||||
periph_module_disable(PERIPH_BT_MODULE);
|
||||
#if CONFIG_BT_NIMBLE_ENABLED
|
||||
ble_npl_eventq_deinit(nimble_port_get_dflt_eventq());
|
||||
#endif // CONFIG_BT_NIMBLE_ENABLED
|
||||
@@ -741,13 +722,13 @@ esp_err_t esp_bt_controller_deinit(void)
|
||||
|
||||
controller_sleep_deinit();
|
||||
|
||||
if (s_ble_active) {
|
||||
esp_phy_disable();
|
||||
s_ble_active = false;
|
||||
}
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
ble_log_deinit_async();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
ble_controller_deinit();
|
||||
|
||||
periph_module_disable(PERIPH_BT_MODULE);
|
||||
|
||||
#if CONFIG_BT_NIMBLE_ENABLED
|
||||
/* De-initialize default event queue */
|
||||
ble_npl_eventq_deinit(nimble_port_get_dflt_eventq());
|
||||
@@ -782,6 +763,17 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "invalid controller state");
|
||||
return ESP_FAIL;
|
||||
}
|
||||
if (!s_ble_active) {
|
||||
#if CONFIG_PM_ENABLE
|
||||
esp_pm_lock_acquire(s_pm_lock);
|
||||
#endif // CONFIG_PM_ENABLE
|
||||
// init phy
|
||||
esp_phy_enable();
|
||||
s_ble_active = true;
|
||||
}
|
||||
// init bb
|
||||
bt_bb_v2_init_cmplx(1);
|
||||
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_enable();
|
||||
#endif
|
||||
@@ -797,6 +789,13 @@ error:
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_disable();
|
||||
#endif
|
||||
if (s_ble_active) {
|
||||
esp_phy_disable();
|
||||
#if CONFIG_PM_ENABLE
|
||||
esp_pm_lock_release(s_pm_lock);
|
||||
#endif // CONFIG_PM_ENABLE
|
||||
s_ble_active = false;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -809,6 +808,14 @@ esp_err_t esp_bt_controller_disable(void)
|
||||
if (ble_controller_disable() != 0) {
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
if (s_ble_active) {
|
||||
esp_phy_disable();
|
||||
#if CONFIG_PM_ENABLE
|
||||
esp_pm_lock_release(s_pm_lock);
|
||||
#endif // CONFIG_PM_ENABLE
|
||||
s_ble_active = false;
|
||||
}
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_disable();
|
||||
#endif
|
||||
@@ -839,32 +846,28 @@ esp_err_t esp_bt_mem_release(esp_bt_mode_t mode)
|
||||
{
|
||||
intptr_t mem_start, mem_end;
|
||||
|
||||
#if CONFIG_BT_RELEASE_IRAM && CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT
|
||||
/* Release Bluetooth text section and merge Bluetooth data, bss & text into a large free heap
|
||||
* region when esp_bt_mem_release is called, total saving ~21kB or more of IRAM. ESP32-C2 has
|
||||
* only 3 configurable PMP entries available, rest of them are hard-coded. We cannot split the
|
||||
* memory into 3 different regions (IRAM, BLE-IRAM, DRAM). So `ESP_SYSTEM_PMP_IDRAM_SPLIT` needs
|
||||
* to be disabled.
|
||||
*/
|
||||
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "`ESP_SYSTEM_PMP_IDRAM_SPLIT` should be disabled!");
|
||||
assert(0);
|
||||
#endif // CONFIG_BT_RELEASE_IRAM && CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT
|
||||
|
||||
if (mode & ESP_BT_MODE_BLE) {
|
||||
mem_start = (intptr_t)&_bt_bss_start;
|
||||
#if CONFIG_BT_RELEASE_IRAM
|
||||
mem_start = (intptr_t)MAP_IRAM_TO_DRAM((intptr_t)&_iram_bt_text_start);
|
||||
mem_end = (intptr_t)&_bss_bt_end;
|
||||
#else
|
||||
mem_start = (intptr_t)&_bt_controller_data_start;
|
||||
mem_end = (intptr_t)&_bt_bss_end;
|
||||
#endif // CONFIG_BT_RELEASE_IRAM
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "Release BT BSS [0x%08x] - [0x%08x]", mem_start, mem_end);
|
||||
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
|
||||
}
|
||||
|
||||
mem_start = (intptr_t)&_bt_data_start;
|
||||
mem_end = (intptr_t)&_bt_data_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "Release BT Data [0x%08x] - [0x%08x]", mem_start, mem_end);
|
||||
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
|
||||
}
|
||||
|
||||
mem_start = (intptr_t)&_nimble_bss_start;
|
||||
mem_end = (intptr_t)&_nimble_bss_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "Release NimBLE BSS [0x%08x] - [0x%08x]", mem_start, mem_end);
|
||||
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
|
||||
}
|
||||
|
||||
mem_start = (intptr_t)&_nimble_data_start;
|
||||
mem_end = (intptr_t)&_nimble_data_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "Release NimBLE Data [0x%08x] - [0x%08x]", mem_start, mem_end);
|
||||
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Release BLE [0x%08x] - [0x%08x], len %d", mem_start,
|
||||
mem_end, mem_end - mem_start);
|
||||
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
|
||||
}
|
||||
}
|
||||
@@ -994,6 +997,33 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
|
||||
return (esp_power_level_t)tx_level;
|
||||
}
|
||||
|
||||
uint8_t esp_ble_get_chip_rev_version(void)
|
||||
{
|
||||
return efuse_ll_get_chip_wafer_version_minor();
|
||||
}
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
|
||||
{
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
void esp_ble_controller_log_dump_all(bool output)
|
||||
{
|
||||
portMUX_TYPE spinlock;
|
||||
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
BT_ASSERT_PRINT("\r\n[DUMP_START:");
|
||||
ble_log_async_output_dump_all(output);
|
||||
BT_ASSERT_PRINT("]\r\n");
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
}
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
#if (!CONFIG_BT_NIMBLE_ENABLED) && (CONFIG_BT_CONTROLLER_ENABLED == true)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -40,7 +40,6 @@ extern "C" {
|
||||
#define DEFAULT_BT_NIMBLE_WHITELIST_SIZE MYNEWT_VAL(BLE_LL_WHITELIST_SIZE)
|
||||
#define DEFAULT_BT_LE_HCI_EVT_HI_BUF_COUNT MYNEWT_VAL(BLE_HCI_EVT_HI_BUF_COUNT)
|
||||
#define DEFAULT_BT_LE_HCI_EVT_LO_BUF_COUNT MYNEWT_VAL(BLE_HCI_EVT_LO_BUF_COUNT)
|
||||
#define DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF CONFIG_BT_NIMBLE_COEX_PHY_CODED_TX_RX_TLIM_EFF
|
||||
|
||||
#else
|
||||
|
||||
@@ -116,11 +115,9 @@ extern "C" {
|
||||
#define DEFAULT_BT_LE_HCI_EVT_LO_BUF_COUNT (8)
|
||||
#endif
|
||||
|
||||
#define DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF CONFIG_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#define DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF CONFIG_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF
|
||||
|
||||
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
@@ -78,15 +78,29 @@ config BT_CTRL_ADV_DUP_FILT_MAX
|
||||
help
|
||||
The maxinum number of suplicate scan filter
|
||||
|
||||
config BT_CTRL_HW_CCA
|
||||
bool "HW CCA check enable"
|
||||
default n
|
||||
choice BT_BLE_CCA_MODE
|
||||
prompt "BLE CCA mode"
|
||||
default BT_BLE_CCA_MODE_NONE
|
||||
help
|
||||
It enables HW CCA feature in controller
|
||||
Define BT BLE CCA mode
|
||||
|
||||
config BT_BLE_CCA_MODE_NONE
|
||||
bool "NONE"
|
||||
config BT_BLE_CCA_MODE_HW
|
||||
bool "Hardware"
|
||||
config BT_BLE_CCA_MODE_SW
|
||||
bool "Software"
|
||||
endchoice
|
||||
|
||||
config BT_BLE_CCA_MODE
|
||||
int
|
||||
default 0 if BT_BLE_CCA_MODE_NONE
|
||||
default 1 if BT_BLE_CCA_MODE_HW
|
||||
default 2 if BT_BLE_CCA_MODE_SW
|
||||
|
||||
config BT_CTRL_HW_CCA_VAL
|
||||
int "CCA threshold value"
|
||||
range 20 60
|
||||
range 20 100
|
||||
default 20
|
||||
help
|
||||
It is the threshold value of HW CCA, if the value is 30, it means CCA threshold is -30 dBm.
|
||||
@@ -265,20 +279,19 @@ choice BT_CTRL_SCAN_DUPL_TYPE
|
||||
config BT_CTRL_SCAN_DUPL_TYPE_DEVICE
|
||||
bool "Scan Duplicate By Device Address"
|
||||
help
|
||||
This way is to use advertiser address filtering. The adv packet of the same address is only
|
||||
allowed to be reported once
|
||||
Advertising packets with the same address, address type, and advertising type are reported once.
|
||||
|
||||
config BT_CTRL_SCAN_DUPL_TYPE_DATA
|
||||
bool "Scan Duplicate By Advertising Data"
|
||||
help
|
||||
This way is to use advertising data filtering. All same advertising data only allow to be reported
|
||||
once even though they are from different devices.
|
||||
Advertising packets with identical advertising data, address type, and advertising type
|
||||
are reported only once, even if they originate from different devices.
|
||||
|
||||
config BT_CTRL_SCAN_DUPL_TYPE_DATA_DEVICE
|
||||
bool "Scan Duplicate By Device Address And Advertising Data"
|
||||
help
|
||||
This way is to use advertising data and device address filtering. All different adv packets with
|
||||
the same address are allowed to be reported.
|
||||
Advertising packets with the same address, advertising data, address type,
|
||||
and advertising type are reported only once.
|
||||
endchoice
|
||||
|
||||
config BT_CTRL_SCAN_DUPL_TYPE
|
||||
@@ -351,7 +364,7 @@ endchoice
|
||||
|
||||
config BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EFF
|
||||
int
|
||||
default 0 if (!ESP32_WIFI_SW_COEXIST_ENABLE)
|
||||
default 0 if !ESP32_WIFI_SW_COEXIST_ENABLE
|
||||
default 1 if BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EN
|
||||
default 0 if BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_DIS
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -111,7 +111,7 @@ do{\
|
||||
} while(0)
|
||||
|
||||
#define OSI_FUNCS_TIME_BLOCKING 0xffffffff
|
||||
#define OSI_VERSION 0x00010006
|
||||
#define OSI_VERSION 0x00010007
|
||||
#define OSI_MAGIC_VALUE 0xFADEBEAD
|
||||
|
||||
/* Types definition
|
||||
@@ -193,6 +193,8 @@ struct osi_funcs_t {
|
||||
void (* _esp_hw_power_down)(void);
|
||||
void (* _esp_hw_power_up)(void);
|
||||
void (* _ets_backup_dma_copy)(uint32_t reg, uint32_t mem_addr, uint32_t num, bool to_rem);
|
||||
void (* _ets_delay_us)(uint32_t us);
|
||||
void (* _btdm_rom_table_ready)(void);
|
||||
};
|
||||
|
||||
|
||||
@@ -252,6 +254,8 @@ extern void esp_mac_bb_power_up(void);
|
||||
extern void ets_backup_dma_copy(uint32_t reg, uint32_t mem_addr, uint32_t num, bool to_mem);
|
||||
#endif
|
||||
|
||||
extern void btdm_cca_feature_enable(void);
|
||||
|
||||
extern uint32_t _bt_bss_start;
|
||||
extern uint32_t _bt_bss_end;
|
||||
extern uint32_t _btdm_bss_start;
|
||||
@@ -311,6 +315,7 @@ static void interrupt_off_wrapper(int intr_num);
|
||||
static void btdm_hw_mac_power_up_wrapper(void);
|
||||
static void btdm_hw_mac_power_down_wrapper(void);
|
||||
static void btdm_backup_dma_copy_wrapper(uint32_t reg, uint32_t mem_addr, uint32_t num, bool to_mem);
|
||||
static void btdm_funcs_table_ready_wrapper(void);
|
||||
|
||||
static void btdm_slp_tmr_callback(void *arg);
|
||||
|
||||
@@ -375,6 +380,8 @@ static const struct osi_funcs_t osi_funcs_ro = {
|
||||
._esp_hw_power_down = btdm_hw_mac_power_down_wrapper,
|
||||
._esp_hw_power_up = btdm_hw_mac_power_up_wrapper,
|
||||
._ets_backup_dma_copy = btdm_backup_dma_copy_wrapper,
|
||||
._ets_delay_us = esp_rom_delay_us,
|
||||
._btdm_rom_table_ready = btdm_funcs_table_ready_wrapper,
|
||||
};
|
||||
|
||||
static DRAM_ATTR struct osi_funcs_t *osi_funcs_p;
|
||||
@@ -899,6 +906,13 @@ static void async_wakeup_request_end(int event)
|
||||
return;
|
||||
}
|
||||
|
||||
static void btdm_funcs_table_ready_wrapper(void)
|
||||
{
|
||||
#if BT_BLE_CCA_MODE == 2
|
||||
btdm_cca_feature_enable();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void coex_schm_status_bit_set_wrapper(uint32_t type, uint32_t status)
|
||||
{
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
@@ -1327,14 +1341,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
periph_module_enable(PERIPH_BT_MODULE);
|
||||
periph_module_reset(PERIPH_BT_MODULE);
|
||||
|
||||
esp_phy_enable();
|
||||
s_lp_stat.phy_enabled = 1;
|
||||
|
||||
if (btdm_controller_init(cfg) != 0) {
|
||||
err = ESP_ERR_NO_MEM;
|
||||
goto error;
|
||||
}
|
||||
coex_pti_v2();
|
||||
|
||||
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
|
||||
|
||||
@@ -1364,11 +1374,6 @@ static void bt_controller_deinit_internal(void)
|
||||
{
|
||||
periph_module_disable(PERIPH_BT_MODULE);
|
||||
|
||||
if (s_lp_stat.phy_enabled) {
|
||||
esp_phy_disable();
|
||||
s_lp_stat.phy_enabled = 0;
|
||||
}
|
||||
|
||||
// deinit low power control resources
|
||||
do {
|
||||
|
||||
@@ -1462,6 +1467,12 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
/* Enable PHY when enabling controller to reduce power dissipation after controller init
|
||||
* Notice the init order: esp_phy_enable() -> bt_bb_v2_init_cmplx() -> coex_pti_v2()
|
||||
*/
|
||||
esp_phy_enable();
|
||||
s_lp_stat.phy_enabled = 1;
|
||||
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_enable();
|
||||
#endif
|
||||
@@ -1486,6 +1497,8 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
|
||||
goto error;
|
||||
}
|
||||
|
||||
coex_pti_v2();
|
||||
|
||||
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_ENABLED;
|
||||
|
||||
return ret;
|
||||
@@ -1508,6 +1521,10 @@ error:
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_disable();
|
||||
#endif
|
||||
if (s_lp_stat.phy_enabled) {
|
||||
esp_phy_disable();
|
||||
s_lp_stat.phy_enabled = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1526,6 +1543,10 @@ esp_err_t esp_bt_controller_disable(void)
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_disable();
|
||||
#endif
|
||||
if (s_lp_stat.phy_enabled) {
|
||||
esp_phy_disable();
|
||||
s_lp_stat.phy_enabled = 0;
|
||||
}
|
||||
|
||||
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
|
||||
|
||||
|
||||
@@ -345,7 +345,7 @@ config BT_LE_MAX_CONNECTIONS
|
||||
choice BT_LE_COEX_PHY_CODED_TX_RX_TLIM
|
||||
prompt "Coexistence: limit on MAX Tx/Rx time for coded-PHY connection"
|
||||
default BT_LE_COEX_PHY_CODED_TX_RX_TLIM_DIS
|
||||
depends on !BT_NIMBLE_ENABLED
|
||||
depends on ESP32_WIFI_SW_COEXIST_ENABLE
|
||||
help
|
||||
When using PHY-Coded in BLE connection, limitation on max tx/rx time can be applied to
|
||||
better avoid dramatic performance deterioration of Wi-Fi.
|
||||
@@ -363,7 +363,7 @@ endchoice
|
||||
|
||||
config BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF
|
||||
int
|
||||
depends on !BT_NIMBLE_ENABLED
|
||||
default 0 if !ESP32_WIFI_SW_COEXIST_ENABLE
|
||||
default 1 if BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EN
|
||||
default 0 if BT_LE_COEX_PHY_CODED_TX_RX_TLIM_DIS
|
||||
|
||||
|
||||
Submodule components/bt/controller/lib_esp32 updated: 26b2361bf7...cddb921d20
Submodule components/bt/controller/lib_esp32c2/esp32c2-bt-lib updated: c7c2303826...5dc39aabee
Submodule components/bt/controller/lib_esp32c3_family updated: d7513ebe88...bb9f0f59db
@@ -8,7 +8,6 @@ if BLE_MESH
|
||||
|
||||
config BLE_MESH_USE_DUPLICATE_SCAN
|
||||
bool "Support Duplicate Scan in BLE Mesh"
|
||||
depends on BT_BLUEDROID_ENABLED
|
||||
select BTDM_BLE_SCAN_DUPL if IDF_TARGET_ESP32
|
||||
select BTDM_BLE_MESH_SCAN_DUPL_EN if IDF_TARGET_ESP32
|
||||
select BT_CTRL_BLE_SCAN_DUPL if IDF_TARGET_ESP32C3
|
||||
|
||||
@@ -45,6 +45,8 @@ void btc_ble_mesh_time_scene_client_cb_handler(btc_msg_t *msg);
|
||||
|
||||
void btc_ble_mesh_time_scene_client_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
|
||||
|
||||
void btc_ble_mesh_time_scene_client_arg_deep_free(btc_msg_t *msg);
|
||||
|
||||
void btc_ble_mesh_time_scene_client_publish_callback(uint32_t opcode, struct bt_mesh_model *model,
|
||||
struct bt_mesh_msg_ctx *ctx,
|
||||
struct net_buf_simple *buf);
|
||||
|
||||
@@ -1615,6 +1615,7 @@ static void bt_mesh_bta_gattc_cb(tBTA_GATTC_EVT event, tBTA_GATTC *p_data)
|
||||
}
|
||||
break;
|
||||
case BTA_GATTC_CLOSE_EVT:
|
||||
bta_gattc_clcb_dealloc_by_conn_id(p_data->close.conn_id);
|
||||
BT_DBG("BTA_GATTC_CLOSE_EVT");
|
||||
break;
|
||||
case BTA_GATTC_CONNECT_EVT: {
|
||||
|
||||
@@ -197,6 +197,8 @@ static bool prov_bearers_valid(bt_mesh_prov_bearer_t bearers)
|
||||
|
||||
int bt_mesh_prov_enable(bt_mesh_prov_bearer_t bearers)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
if (bt_mesh_is_provisioned()) {
|
||||
BT_WARN("%s, Already", __func__);
|
||||
return -EALREADY;
|
||||
@@ -232,7 +234,11 @@ int bt_mesh_prov_enable(bt_mesh_prov_bearer_t bearers)
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_PB_ADV) &&
|
||||
(bearers & BLE_MESH_PROV_ADV)) {
|
||||
/* Make sure we're scanning for provisioning invitations */
|
||||
bt_mesh_scan_enable();
|
||||
err = bt_mesh_scan_enable();
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Enable unprovisioned beacon sending */
|
||||
bt_mesh_beacon_enable();
|
||||
}
|
||||
@@ -637,7 +643,10 @@ int bt_mesh_provisioner_enable(bt_mesh_prov_bearer_t bearers)
|
||||
bt_mesh_beacon_enable();
|
||||
}
|
||||
|
||||
bt_mesh_scan_enable();
|
||||
err = bt_mesh_scan_enable();
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017 Nordic Semiconductor ASA
|
||||
* SPDX-FileCopyrightText: 2015-2016 Intel Corporation
|
||||
* SPDX-FileContributor: 2018-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2018-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -88,7 +88,8 @@ int bt_mesh_host_init(void)
|
||||
int rc;
|
||||
|
||||
if (init == true) {
|
||||
return -EALREADY;
|
||||
BT_WARN("Already initialized host for mesh!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
rc = btc_init();
|
||||
@@ -1943,9 +1944,43 @@ int bt_mesh_encrypt_be(const uint8_t key[16], const uint8_t plaintext[16],
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN)
|
||||
int bt_mesh_update_exceptional_list(uint8_t sub_code, uint8_t type, void *info)
|
||||
int bt_mesh_update_exceptional_list(uint8_t sub_code, uint32_t type, void *info)
|
||||
{
|
||||
BT_ERR("Unsupported for NimBLE host");
|
||||
return 0;
|
||||
uint8_t value[6] = {0};
|
||||
int rc = 0;
|
||||
|
||||
#if MYNEWT_VAL(BLE_HCI_VS)
|
||||
struct ble_hci_vs_duplicate_exception_list_cp cmd;
|
||||
#endif
|
||||
|
||||
if ((sub_code > BLE_MESH_EXCEP_LIST_SUB_CODE_CLEAN) ||
|
||||
(sub_code < BLE_MESH_EXCEP_LIST_SUB_CODE_CLEAN &&
|
||||
type > BLE_MESH_EXCEP_LIST_TYPE_MESH_PROXY_ADV) ||
|
||||
(sub_code == BLE_MESH_EXCEP_LIST_SUB_CODE_CLEAN &&
|
||||
!(type & BLE_MESH_EXCEP_LIST_CLEAN_ALL_LIST))) {
|
||||
BT_ERR("%s, Invalid parameter", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (type == BLE_MESH_EXCEP_LIST_TYPE_MESH_LINK_ID) {
|
||||
if (!info) {
|
||||
BT_ERR("Invalid Provisioning Link ID");
|
||||
return -EINVAL;
|
||||
}
|
||||
sys_memcpy_swap(value, info, sizeof(uint32_t));
|
||||
}
|
||||
|
||||
BT_DBG("%s exceptional list, type 0x%08x", sub_code ? "Remove" : "Add", type);
|
||||
|
||||
#if MYNEWT_VAL(BLE_HCI_VS)
|
||||
cmd.operation = sub_code;
|
||||
cmd.type = htole32(type);
|
||||
memcpy(&cmd.device_info, value, 6);
|
||||
|
||||
rc = ble_hs_hci_send_vs_cmd(BLE_HCI_OCF_VS_DUPLICATE_EXCEPTION_LIST,
|
||||
&cmd, sizeof(cmd), NULL, 0);
|
||||
#endif
|
||||
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#include "provisioner_prov.h"
|
||||
#include "provisioner_main.h"
|
||||
|
||||
#define PROV_SVC_ADV_RX_CHECK(pre, cur) ((cur) < (pre) ? ((cur) + (UINT32_MAX - (pre)) >= 200) : ((cur) - (pre) >= 200))
|
||||
|
||||
#if CONFIG_BLE_MESH_PROVISIONER
|
||||
|
||||
_Static_assert(BLE_MESH_MAX_CONN >= CONFIG_BLE_MESH_PBG_SAME_TIME,
|
||||
@@ -3426,6 +3428,21 @@ int bt_mesh_provisioner_prov_deinit(bool erase)
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_DEINIT */
|
||||
|
||||
static bool bt_mesh_prov_svc_adv_filter(void)
|
||||
{
|
||||
static uint32_t timestamp = 0;
|
||||
static uint32_t pre_timestamp = 0;
|
||||
|
||||
timestamp = k_uptime_get_32();
|
||||
|
||||
if (PROV_SVC_ADV_RX_CHECK(pre_timestamp, timestamp)) {
|
||||
pre_timestamp = timestamp;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool is_unprov_dev_info_callback_to_app(bt_mesh_prov_bearer_t bearer, const uint8_t uuid[16],
|
||||
const bt_mesh_addr_t *addr, uint16_t oob_info, int8_t rssi)
|
||||
{
|
||||
@@ -3443,6 +3460,11 @@ static bool is_unprov_dev_info_callback_to_app(bt_mesh_prov_bearer_t bearer, con
|
||||
|
||||
if (i == ARRAY_SIZE(unprov_dev)) {
|
||||
BT_DBG("Device not in queue, notify to app layer");
|
||||
|
||||
if (adv_type == BLE_MESH_ADV_IND && bt_mesh_prov_svc_adv_filter()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (notify_unprov_adv_pkt_cb) {
|
||||
notify_unprov_adv_pkt_cb(addr->val, addr->type, adv_type, uuid, oob_info, bearer, rssi);
|
||||
}
|
||||
@@ -3470,7 +3492,7 @@ void bt_mesh_provisioner_unprov_beacon_recv(struct net_buf_simple *buf, int8_t r
|
||||
uint16_t oob_info = 0U;
|
||||
|
||||
if (!(prov_ctx.bearers & BLE_MESH_PROV_ADV)) {
|
||||
BT_WARN("Not support PB-ADV bearer");
|
||||
BT_INFO("Not support PB-ADV bearer");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3506,7 +3528,7 @@ void bt_mesh_provisioner_prov_adv_recv(struct net_buf_simple *buf,
|
||||
uint16_t oob_info = 0U;
|
||||
|
||||
if (!(prov_ctx.bearers & BLE_MESH_PROV_GATT)) {
|
||||
BT_WARN("Not support PB-GATT bearer");
|
||||
BT_INFO("Not support PB-GATT bearer");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,13 @@ config BT_CLASSIC_ENABLED
|
||||
help
|
||||
For now this option needs "SMP_ENABLE" to be set to yes
|
||||
|
||||
config BT_CLASSIC_BQB_ENABLED
|
||||
bool "Host Qualitifcation support for Classic Bluetooth"
|
||||
depends on BT_CLASSIC_ENABLED
|
||||
default n
|
||||
help
|
||||
This enables functionalities of Host qualification for Classic Bluetooth.
|
||||
|
||||
config BT_A2DP_ENABLE
|
||||
bool "A2DP"
|
||||
depends on BT_CLASSIC_ENABLED
|
||||
@@ -69,21 +76,23 @@ config BT_L2CAP_ENABLED
|
||||
This enables the Logical Link Control and Adaptation Layer Protocol.
|
||||
Only supported classic bluetooth.
|
||||
|
||||
config BT_HFP_ENABLE
|
||||
menuconfig BT_HFP_ENABLE
|
||||
bool "Hands Free/Handset Profile"
|
||||
depends on BT_CLASSIC_ENABLED
|
||||
default n
|
||||
help
|
||||
Hands Free Unit and Audio Gateway can be included simultaneously
|
||||
but they cannot run simultaneously due to internal limitations.
|
||||
|
||||
choice BT_HFP_ROLE
|
||||
prompt "Hands-free Profile Role configuration"
|
||||
config BT_HFP_CLIENT_ENABLE
|
||||
bool "Hands Free Unit"
|
||||
depends on BT_HFP_ENABLE
|
||||
default y
|
||||
|
||||
config BT_HFP_CLIENT_ENABLE
|
||||
bool "Hands Free Unit"
|
||||
|
||||
config BT_HFP_AG_ENABLE
|
||||
bool "Audio Gateway"
|
||||
endchoice
|
||||
config BT_HFP_AG_ENABLE
|
||||
bool "Audio Gateway"
|
||||
depends on BT_HFP_ENABLE
|
||||
default y
|
||||
|
||||
choice BT_HFP_AUDIO_DATA_PATH
|
||||
prompt "audio(SCO) data path"
|
||||
@@ -107,26 +116,26 @@ config BT_HFP_WBS_ENABLE
|
||||
This enables Wide Band Speech. Should disable it when SCO data path is PCM.
|
||||
Otherwise there will be no data transmited via GPIOs.
|
||||
|
||||
config BT_HID_ENABLED
|
||||
|
||||
menuconfig BT_HID_ENABLED
|
||||
bool "Classic BT HID"
|
||||
depends on BT_CLASSIC_ENABLED
|
||||
default n
|
||||
help
|
||||
This enables the BT HID Host
|
||||
|
||||
choice BT_HID_ROLE
|
||||
prompt "Profile Role configuration"
|
||||
config BT_HID_HOST_ENABLED
|
||||
bool "Classic BT HID Host"
|
||||
depends on BT_HID_ENABLED
|
||||
config BT_HID_HOST_ENABLED
|
||||
bool "Classic BT HID Host"
|
||||
help
|
||||
This enables the BT HID Host
|
||||
default n
|
||||
help
|
||||
This enables the BT HID Host
|
||||
|
||||
config BT_HID_DEVICE_ENABLED
|
||||
bool "Classic BT HID Device"
|
||||
help
|
||||
This enables the BT HID Device
|
||||
endchoice
|
||||
config BT_HID_DEVICE_ENABLED
|
||||
bool "Classic BT HID Device"
|
||||
depends on BT_HID_ENABLED
|
||||
help
|
||||
This enables the BT HID Device
|
||||
|
||||
config BT_SSP_ENABLED
|
||||
bool "Secure Simple Pairing"
|
||||
@@ -208,6 +217,27 @@ config BT_GATTS_SEND_SERVICE_CHANGE_MODE
|
||||
default 1 if BT_GATTS_SEND_SERVICE_CHANGE_MANUAL
|
||||
default 0
|
||||
|
||||
config BT_GATTS_ROBUST_CACHING_ENABLED
|
||||
bool "Enable Robust Caching on Server Side"
|
||||
depends on BT_GATTS_ENABLE
|
||||
default n
|
||||
help
|
||||
This option enable gatt robust caching feature on server
|
||||
|
||||
config BT_GATTS_DEVICE_NAME_WRITABLE
|
||||
bool "Allow to write device name by GATT clients"
|
||||
depends on BT_GATTS_ENABLE
|
||||
default n
|
||||
help
|
||||
Enabling this option allows remote GATT clients to write device name
|
||||
|
||||
config BT_GATTS_APPEARANCE_WRITABLE
|
||||
bool "Allow to write appearance by GATT clients"
|
||||
depends on BT_GATTS_ENABLE
|
||||
default n
|
||||
help
|
||||
Enabling this option allows remote GATT clients to write appearance
|
||||
|
||||
config BT_GATTC_ENABLE
|
||||
bool "Include GATT client module(GATTC)"
|
||||
depends on BT_BLE_ENABLED
|
||||
@@ -223,6 +253,14 @@ config BT_GATTC_MAX_CACHE_CHAR
|
||||
help
|
||||
Maximum GATTC cache characteristic count
|
||||
|
||||
config BT_GATTC_NOTIF_REG_MAX
|
||||
int "Max gattc notify(indication) register number"
|
||||
depends on BT_GATTC_ENABLE
|
||||
range 1 64
|
||||
default 5
|
||||
help
|
||||
Maximum GATTC notify(indication) register number
|
||||
|
||||
config BT_GATTC_CACHE_NVS_FLASH
|
||||
bool "Save gattc cache data to nvs flash"
|
||||
depends on BT_GATTC_ENABLE
|
||||
@@ -1093,6 +1131,15 @@ config BT_BLE_RPA_SUPPORTED
|
||||
For other BLE chips, devices support network privacy mode and device privacy mode,
|
||||
users can switch the two modes according to their own needs. So this option is enabled by default.
|
||||
|
||||
config BT_BLE_RPA_TIMEOUT
|
||||
int "Timeout of resolvable private address"
|
||||
depends on BT_BLUEDROID_ENABLED
|
||||
range 1 3600
|
||||
default 900
|
||||
help
|
||||
This set RPA timeout of Controller and Host.
|
||||
Default is 900 s (15 minutes). Range is 1 s to 1 hour (3600 s).
|
||||
|
||||
config BT_BLE_50_FEATURES_SUPPORTED
|
||||
bool "Enable BLE 5.0 features"
|
||||
depends on (BT_BLUEDROID_ENABLED && (IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 || SOC_ESP_NIMBLE_CONTROLLER))
|
||||
@@ -1106,3 +1153,24 @@ config BT_BLE_42_FEATURES_SUPPORTED
|
||||
default n
|
||||
help
|
||||
This enables BLE 4.2 features.
|
||||
|
||||
config BT_BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER
|
||||
bool "Enable BLE periodic advertising sync transfer feature"
|
||||
depends on (BT_BLUEDROID_ENABLED && BT_BLE_50_FEATURES_SUPPORTED && SOC_ESP_NIMBLE_CONTROLLER)
|
||||
default n
|
||||
help
|
||||
This enables BLE periodic advertising sync transfer feature
|
||||
|
||||
config BT_BLE_FEAT_PERIODIC_ADV_ENH
|
||||
bool "Enable periodic adv enhancements(adi support)"
|
||||
depends on (BT_BLUEDROID_ENABLED && BT_BLE_50_FEATURES_SUPPORTED && SOC_ESP_NIMBLE_CONTROLLER)
|
||||
default n
|
||||
help
|
||||
Enable the periodic advertising enhancements
|
||||
|
||||
config BT_BLE_HIGH_DUTY_ADV_INTERVAL
|
||||
bool "Enable BLE high duty advertising interval feature"
|
||||
depends on BT_BLUEDROID_ENABLED
|
||||
default n
|
||||
help
|
||||
This enable BLE high duty advertising interval feature
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -122,6 +122,19 @@ esp_err_t esp_ble_gap_stop_advertising(void)
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_clear_advertising(void)
|
||||
{
|
||||
btc_msg_t msg;
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_ACT_CLEAR_ADV;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
esp_err_t esp_ble_gap_update_conn_params(esp_ble_conn_update_params_t *params)
|
||||
@@ -138,7 +151,7 @@ esp_err_t esp_ble_gap_update_conn_params(esp_ble_conn_update_params_t *params)
|
||||
if (ESP_BLE_IS_VALID_PARAM(params->min_int, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
|
||||
ESP_BLE_IS_VALID_PARAM(params->max_int, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
|
||||
ESP_BLE_IS_VALID_PARAM(params->timeout, ESP_BLE_CONN_SUP_TOUT_MIN, ESP_BLE_CONN_SUP_TOUT_MAX) &&
|
||||
(params->latency <= ESP_BLE_CONN_LATENCY_MAX || params->latency == ESP_BLE_CONN_PARAM_UNDEF) &&
|
||||
(params->latency <= ESP_BLE_CONN_LATENCY_MAX) &&
|
||||
((params->timeout * 10) >= ((1 + params->latency) * ((params->max_int * 5) >> 1))) && params->min_int <= params->max_int) {
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
@@ -354,7 +367,7 @@ esp_err_t esp_ble_gap_set_prefer_conn_params(esp_bd_addr_t bd_addr,
|
||||
if (ESP_BLE_IS_VALID_PARAM(min_conn_int, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
|
||||
ESP_BLE_IS_VALID_PARAM(max_conn_int, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
|
||||
ESP_BLE_IS_VALID_PARAM(supervision_tout, ESP_BLE_CONN_SUP_TOUT_MIN, ESP_BLE_CONN_SUP_TOUT_MAX) &&
|
||||
(slave_latency <= ESP_BLE_CONN_LATENCY_MAX || slave_latency == ESP_BLE_CONN_PARAM_UNDEF) &&
|
||||
(slave_latency <= ESP_BLE_CONN_LATENCY_MAX) &&
|
||||
((supervision_tout * 10) >= ((1 + slave_latency) * ((max_conn_int * 5) >> 1))) && min_conn_int <= max_conn_int) {
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
@@ -431,8 +444,7 @@ esp_err_t esp_ble_gap_config_adv_data_raw(uint8_t *raw_data, uint32_t raw_data_l
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
if (raw_data == NULL
|
||||
|| (raw_data_len <= 0 || raw_data_len > ESP_BLE_ADV_DATA_LEN_MAX)) {
|
||||
if ((raw_data_len != 0 && raw_data == NULL) || raw_data_len > ESP_BLE_ADV_DATA_LEN_MAX) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
@@ -471,8 +483,7 @@ esp_err_t esp_ble_gap_config_scan_rsp_data_raw(uint8_t *raw_data, uint32_t raw_d
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
if (raw_data == NULL
|
||||
|| (raw_data_len <= 0 || raw_data_len > ESP_BLE_SCAN_RSP_DATA_LEN_MAX)) {
|
||||
if ((raw_data_len != 0 && raw_data == NULL) || raw_data_len > ESP_BLE_ADV_DATA_LEN_MAX) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
@@ -578,7 +589,11 @@ esp_err_t esp_ble_gap_set_security_param(esp_ble_sm_param_t param_type,
|
||||
LOG_ERROR("ESP_BLE_APP_ENC_KEY_SIZE is deprecated, use ESP_GATT_PERM_ENCRYPT_KEY_SIZE in characteristic definition");
|
||||
return ESP_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
if (param_type == ESP_BLE_SM_MAX_KEY_SIZE || param_type == ESP_BLE_SM_MIN_KEY_SIZE) {
|
||||
if (((uint8_t *)value)[0] > 16 || ((uint8_t *)value)[0] < 7) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
}
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_gap_args_t arg;
|
||||
|
||||
@@ -730,6 +745,38 @@ esp_err_t esp_ble_oob_req_reply(esp_bd_addr_t bd_addr, uint8_t *TK, uint8_t len)
|
||||
btc_gap_ble_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_sc_oob_req_reply(esp_bd_addr_t bd_addr, uint8_t p_c[16], uint8_t p_r[16])
|
||||
{
|
||||
if (!p_c || !p_r) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_gap_args_t arg;
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_SC_OOB_REQ_REPLY_EVT;
|
||||
memcpy(arg.sc_oob_req_reply.bd_addr, bd_addr, ESP_BD_ADDR_LEN);
|
||||
arg.sc_oob_req_reply.p_c = p_c;
|
||||
arg.sc_oob_req_reply.p_r = p_r;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), btc_gap_ble_arg_deep_copy,
|
||||
btc_gap_ble_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_create_sc_oob_data(void)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_SC_CR_OOB_DATA_EVT;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif /* #if (SMP_INCLUDED == TRUE) */
|
||||
|
||||
esp_err_t esp_ble_gap_disconnect(esp_bd_addr_t remote_device)
|
||||
@@ -1021,8 +1068,13 @@ esp_err_t esp_ble_gap_periodic_adv_set_params(uint8_t instance, const esp_ble_ga
|
||||
|
||||
}
|
||||
|
||||
#if (CONFIG_BT_BLE_FEAT_PERIODIC_ADV_ENH)
|
||||
esp_err_t esp_ble_gap_config_periodic_adv_data_raw(uint8_t instance, uint16_t length,
|
||||
const uint8_t *data, bool only_update_did)
|
||||
#else
|
||||
esp_err_t esp_ble_gap_config_periodic_adv_data_raw(uint8_t instance, uint16_t length,
|
||||
const uint8_t *data)
|
||||
#endif
|
||||
{
|
||||
btc_msg_t msg;
|
||||
btc_ble_5_gap_args_t arg;
|
||||
@@ -1036,13 +1088,22 @@ esp_err_t esp_ble_gap_config_periodic_adv_data_raw(uint8_t instance, uint16_t le
|
||||
arg.periodic_adv_cfg_data.instance = instance;
|
||||
arg.periodic_adv_cfg_data.len = length;
|
||||
arg.periodic_adv_cfg_data.data = (uint8_t *)data;
|
||||
#if (CONFIG_BT_BLE_FEAT_PERIODIC_ADV_ENH)
|
||||
arg.periodic_adv_cfg_data.only_update_did = only_update_did;
|
||||
#else
|
||||
arg.periodic_adv_cfg_data.only_update_did = false;
|
||||
#endif
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), btc_gap_ble_arg_deep_copy,
|
||||
btc_gap_ble_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
|
||||
}
|
||||
|
||||
#if (CONFIG_BT_BLE_FEAT_PERIODIC_ADV_ENH)
|
||||
esp_err_t esp_ble_gap_periodic_adv_start(uint8_t instance,bool include_adi)
|
||||
#else
|
||||
esp_err_t esp_ble_gap_periodic_adv_start(uint8_t instance)
|
||||
#endif
|
||||
{
|
||||
btc_msg_t msg;
|
||||
btc_ble_5_gap_args_t arg;
|
||||
@@ -1053,6 +1114,11 @@ esp_err_t esp_ble_gap_periodic_adv_start(uint8_t instance)
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_PERIODIC_ADV_START;
|
||||
|
||||
#if (CONFIG_BT_BLE_FEAT_PERIODIC_ADV_ENH)
|
||||
arg.periodic_adv_start.include_adi = include_adi;
|
||||
#else
|
||||
arg.periodic_adv_start.include_adi = false;
|
||||
#endif
|
||||
arg.periodic_adv_start.instance = instance;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
@@ -1267,7 +1333,7 @@ esp_err_t esp_ble_gap_prefer_ext_connect_params_set(esp_bd_addr_t addr,
|
||||
if (ESP_BLE_IS_VALID_PARAM(phy_1m_conn_params->interval_min, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
|
||||
ESP_BLE_IS_VALID_PARAM(phy_1m_conn_params->interval_max, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
|
||||
ESP_BLE_IS_VALID_PARAM(phy_1m_conn_params->supervision_timeout, ESP_BLE_CONN_SUP_TOUT_MIN, ESP_BLE_CONN_SUP_TOUT_MAX) &&
|
||||
(phy_1m_conn_params->latency <= ESP_BLE_CONN_LATENCY_MAX || phy_1m_conn_params->latency == ESP_BLE_CONN_PARAM_UNDEF) &&
|
||||
(phy_1m_conn_params->latency <= ESP_BLE_CONN_LATENCY_MAX) &&
|
||||
((phy_1m_conn_params->supervision_timeout * 10) >= ((1 + phy_1m_conn_params->latency) * ((phy_1m_conn_params->interval_max * 5) >> 1))) &&
|
||||
(phy_1m_conn_params->interval_min <= phy_1m_conn_params->interval_max)) {
|
||||
|
||||
@@ -1291,7 +1357,7 @@ esp_err_t esp_ble_gap_prefer_ext_connect_params_set(esp_bd_addr_t addr,
|
||||
if (ESP_BLE_IS_VALID_PARAM(phy_2m_conn_params->interval_min, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
|
||||
ESP_BLE_IS_VALID_PARAM(phy_2m_conn_params->interval_max, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
|
||||
ESP_BLE_IS_VALID_PARAM(phy_2m_conn_params->supervision_timeout, ESP_BLE_CONN_SUP_TOUT_MIN, ESP_BLE_CONN_SUP_TOUT_MAX) &&
|
||||
(phy_2m_conn_params->latency <= ESP_BLE_CONN_LATENCY_MAX || phy_2m_conn_params->latency == ESP_BLE_CONN_PARAM_UNDEF) &&
|
||||
(phy_2m_conn_params->latency <= ESP_BLE_CONN_LATENCY_MAX) &&
|
||||
((phy_2m_conn_params->supervision_timeout * 10) >= ((1 + phy_2m_conn_params->latency) * ((phy_2m_conn_params->interval_max * 5) >> 1))) &&
|
||||
(phy_2m_conn_params->interval_min <= phy_2m_conn_params->interval_max)) {
|
||||
|
||||
@@ -1315,7 +1381,7 @@ esp_err_t esp_ble_gap_prefer_ext_connect_params_set(esp_bd_addr_t addr,
|
||||
if (ESP_BLE_IS_VALID_PARAM(phy_coded_conn_params->interval_min, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
|
||||
ESP_BLE_IS_VALID_PARAM(phy_coded_conn_params->interval_max, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
|
||||
ESP_BLE_IS_VALID_PARAM(phy_coded_conn_params->supervision_timeout, ESP_BLE_CONN_SUP_TOUT_MIN, ESP_BLE_CONN_SUP_TOUT_MAX) &&
|
||||
(phy_coded_conn_params->latency <= ESP_BLE_CONN_LATENCY_MAX || phy_coded_conn_params->latency == ESP_BLE_CONN_PARAM_UNDEF) &&
|
||||
(phy_coded_conn_params->latency <= ESP_BLE_CONN_LATENCY_MAX) &&
|
||||
((phy_coded_conn_params->supervision_timeout * 10) >= ((1 + phy_coded_conn_params->latency) * ((phy_coded_conn_params->interval_max * 5) >> 1))) &&
|
||||
(phy_coded_conn_params->interval_min <= phy_coded_conn_params->interval_max)) {
|
||||
|
||||
@@ -1339,3 +1405,95 @@ esp_err_t esp_ble_gap_prefer_ext_connect_params_set(esp_bd_addr_t addr,
|
||||
}
|
||||
|
||||
#endif //#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
esp_err_t esp_ble_gap_periodic_adv_recv_enable(uint16_t sync_handle, uint8_t enable)
|
||||
{
|
||||
btc_msg_t msg;
|
||||
btc_ble_5_gap_args_t arg;
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_PERIODIC_ADV_RECV_ENABLE;
|
||||
|
||||
arg.periodic_adv_recv_en.sync_handle = sync_handle;
|
||||
arg.periodic_adv_recv_en.enable = enable;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_periodic_adv_sync_trans(esp_bd_addr_t addr, uint16_t service_data, uint16_t sync_handle)
|
||||
{
|
||||
btc_msg_t msg;
|
||||
btc_ble_5_gap_args_t arg;
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
if (addr == NULL) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_PERIODIC_ADV_SYNC_TRANS;
|
||||
|
||||
memcpy(arg.periodic_adv_sync_trans.addr, addr, sizeof(esp_bd_addr_t));
|
||||
arg.periodic_adv_sync_trans.service_data = service_data;
|
||||
arg.periodic_adv_sync_trans.sync_handle = sync_handle;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_periodic_adv_set_info_trans(esp_bd_addr_t addr, uint16_t service_data, uint8_t adv_handle)
|
||||
{
|
||||
btc_msg_t msg;
|
||||
btc_ble_5_gap_args_t arg;
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
if (addr == NULL) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_PERIODIC_ADV_SET_INFO_TRANS;
|
||||
|
||||
memcpy(arg.periodic_adv_set_info_trans.addr, addr, sizeof(esp_bd_addr_t));
|
||||
arg.periodic_adv_set_info_trans.service_data = service_data;
|
||||
arg.periodic_adv_set_info_trans.adv_handle = adv_handle;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_set_periodic_adv_sync_trans_params(esp_bd_addr_t addr, const esp_ble_gap_past_params_t *params)
|
||||
{
|
||||
btc_msg_t msg;
|
||||
btc_ble_5_gap_args_t arg;
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
if (params == NULL) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_SET_PERIODIC_ADV_SYNC_TRANS_PARAMS;
|
||||
|
||||
if (addr) {
|
||||
memcpy(arg.set_periodic_adv_sync_trans_params.addr, addr, sizeof(esp_bd_addr_t));
|
||||
} else {
|
||||
memset(arg.set_periodic_adv_sync_trans_params.addr, 0, sizeof(esp_bd_addr_t));
|
||||
}
|
||||
memcpy(&arg.set_periodic_adv_sync_trans_params.params, params, sizeof(esp_ble_gap_past_params_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif //#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
|
||||
@@ -412,6 +412,10 @@ esp_err_t esp_bt_gap_set_qos(esp_bd_addr_t remote_bda, uint32_t t_poll)
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (t_poll < ESP_BT_GAP_TPOLL_MIN || t_poll > ESP_BT_GAP_TPOLL_MAX) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BT;
|
||||
msg.act = BTC_GAP_BT_ACT_SET_QOS;
|
||||
|
||||
@@ -447,6 +447,41 @@ esp_err_t esp_ble_gattc_read_multiple(esp_gatt_if_t gattc_if,
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gattc_read_multiple_variable(esp_gatt_if_t gattc_if,
|
||||
uint16_t conn_id, esp_gattc_multi_t *read_multi,
|
||||
esp_gatt_auth_req_t auth_req)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_gattc_args_t arg;
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
tGATT_TCB *p_tcb = gatt_get_tcb_by_idx(conn_id);
|
||||
if (!gatt_check_connection_state_by_tcb(p_tcb)) {
|
||||
LOG_WARN("%s, The connection not created.", __func__);
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (L2CA_CheckIsCongest(L2CAP_ATT_CID, p_tcb->peer_bda)) {
|
||||
LOG_DEBUG("%s, the l2cap chanel is congest.", __func__);
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GATTC;
|
||||
msg.act = BTC_GATTC_ACT_READ_MULTIPLE_VARIABLE_CHAR;
|
||||
arg.read_multiple.conn_id = BTC_GATT_CREATE_CONN_ID(gattc_if, conn_id);
|
||||
arg.read_multiple.num_attr = read_multi->num_attr;
|
||||
arg.read_multiple.auth_req = auth_req;
|
||||
|
||||
if (read_multi->num_attr > 0) {
|
||||
memcpy(arg.read_multiple.handles, read_multi->handles, sizeof(uint16_t)*read_multi->num_attr);
|
||||
} else {
|
||||
LOG_ERROR("%s(), the num_attr should not be 0.", __func__);
|
||||
return ESP_FAIL;
|
||||
}
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gattc_read_char_descr (esp_gatt_if_t gattc_if,
|
||||
uint16_t conn_id, uint16_t handle,
|
||||
|
||||
@@ -421,4 +421,17 @@ static esp_err_t esp_ble_gatts_add_char_desc_param_check(esp_attr_value_t *char_
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gatts_show_local_database(void)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GATTS;
|
||||
msg.act = BTC_GATTS_ACT_SHOW_LOCAL_DATABASE;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
#endif ///GATTS_INCLUDED
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -171,6 +171,9 @@ esp_err_t esp_hf_ag_volume_control(esp_bd_addr_t remote_addr, esp_hf_volume_cont
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
if (volume < 0 || volume > 15) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
btc_msg_t msg;
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_HF;
|
||||
@@ -237,6 +240,9 @@ esp_err_t esp_hf_ag_devices_status_indchange(esp_bd_addr_t remote_addr,
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
if (signal < 0 || signal > 5) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
btc_msg_t msg;
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_HF;
|
||||
@@ -255,6 +261,27 @@ esp_err_t esp_hf_ag_devices_status_indchange(esp_bd_addr_t remote_addr,
|
||||
return (state == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
esp_err_t esp_hf_ag_ciev_report(esp_bd_addr_t remote_addr, esp_hf_ciev_report_type_t ind_type, int value)
|
||||
{
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
btc_msg_t msg;
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_HF;
|
||||
msg.act = BTC_HF_CIEV_REPORT_EVT;
|
||||
|
||||
btc_hf_args_t arg;
|
||||
memset(&arg, 0, sizeof(btc_hf_args_t));
|
||||
memcpy(&(arg.ciev_rep.remote_addr), remote_addr, sizeof(esp_bd_addr_t));
|
||||
arg.ciev_rep.ind.type = ind_type;
|
||||
arg.ciev_rep.ind.value = value;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t state = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL);
|
||||
return (state == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
esp_err_t esp_hf_ag_cind_response(esp_bd_addr_t remote_addr,
|
||||
esp_hf_call_status_t call_state,
|
||||
esp_hf_call_setup_status_t call_setup_state,
|
||||
@@ -264,6 +291,10 @@ esp_err_t esp_hf_ag_cind_response(esp_bd_addr_t remote_addr,
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
if (signal < 0 || signal > 5 || batt_lev < 0 || batt_lev > 5) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
btc_msg_t msg;
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_HF;
|
||||
@@ -337,11 +368,14 @@ esp_err_t esp_hf_ag_clcc_response(esp_bd_addr_t remote_addr, int index, esp_hf_c
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
esp_err_t esp_hf_ag_cnum_response(esp_bd_addr_t remote_addr, char *number, esp_hf_subscriber_service_type_t type)
|
||||
esp_err_t esp_hf_ag_cnum_response(esp_bd_addr_t remote_addr, char *number, int number_type, esp_hf_subscriber_service_type_t service_type)
|
||||
{
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
if (number == NULL || number_type < 128 || number_type > 175) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
btc_msg_t msg;
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_HF;
|
||||
@@ -351,7 +385,8 @@ esp_err_t esp_hf_ag_cnum_response(esp_bd_addr_t remote_addr, char *number, esp_h
|
||||
memset(&arg, 0, sizeof(btc_hf_args_t));
|
||||
memcpy(&(arg.cnum_rep), remote_addr, sizeof(esp_bd_addr_t));
|
||||
arg.cnum_rep.number = number; //deep_copy
|
||||
arg.cnum_rep.type = type;
|
||||
arg.cnum_rep.number_type = number_type;
|
||||
arg.cnum_rep.service_type = service_type;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t),
|
||||
@@ -512,10 +547,30 @@ esp_err_t esp_hf_ag_register_data_callback(esp_hf_incoming_data_cb_t recv, esp_h
|
||||
}
|
||||
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE)
|
||||
esp_err_t esp_hf_ag_pkt_stat_nums_get(uint16_t sync_conn_handle)
|
||||
{
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
btc_msg_t msg;
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_HF;
|
||||
msg.act = BTC_HF_REQUEST_PKT_STAT_EVT;
|
||||
|
||||
btc_hf_args_t arg;
|
||||
memset(&arg, 0, sizeof(btc_hf_args_t));
|
||||
arg.pkt_sync_hd.sync_conn_handle = sync_conn_handle;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL);
|
||||
return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
void esp_hf_ag_outgoing_data_ready(void)
|
||||
{
|
||||
btc_hf_ci_sco_data();
|
||||
}
|
||||
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE ) */
|
||||
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE) */
|
||||
|
||||
#endif // BTC_HF_INCLUDED
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -515,8 +515,27 @@ esp_err_t esp_hf_client_register_data_callback(esp_hf_client_incoming_data_cb_t
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE)
|
||||
esp_err_t esp_hf_client_pkt_stat_nums_get(uint16_t sync_conn_handle)
|
||||
{
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
btc_msg_t msg;
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_HF_CLIENT;
|
||||
msg.act = BTC_HF_CLIENT_REQUEST_PKT_STAT_EVT;
|
||||
|
||||
btc_hf_client_args_t arg;
|
||||
memset(&arg, 0, sizeof(btc_hf_client_args_t));
|
||||
arg.pkt_sync_hd.sync_conn_handle = sync_conn_handle;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_hf_client_args_t), NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE )
|
||||
void esp_hf_client_outgoing_data_ready(void)
|
||||
{
|
||||
BTA_HfClientCiData();
|
||||
@@ -537,6 +556,6 @@ int32_t esp_hf_client_pcm_resample(void *src, uint32_t in_bytes, void *dst)
|
||||
return BTA_DmPcmResample(src, in_bytes, dst);
|
||||
}
|
||||
|
||||
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE ) */
|
||||
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE) */
|
||||
|
||||
#endif /* BTC_HF_CLIENT_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -241,7 +241,7 @@ typedef int32_t (* esp_a2d_source_data_cb_t)(uint8_t *buf, int32_t len);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: if callback is a NULL function pointer
|
||||
*
|
||||
*/
|
||||
@@ -258,7 +258,7 @@ esp_err_t esp_a2d_register_callback(esp_a2d_cb_t callback);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: if callback is a NULL function pointer
|
||||
*
|
||||
*/
|
||||
@@ -275,7 +275,7 @@ esp_err_t esp_a2d_sink_register_data_callback(esp_a2d_sink_data_cb_t callback);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: if the initialization request is sent successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -290,7 +290,7 @@ esp_err_t esp_a2d_sink_init(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: if the deinitialization request is sent successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -306,7 +306,7 @@ esp_err_t esp_a2d_sink_deinit(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: connect request is sent to lower layer successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -322,7 +322,7 @@ esp_err_t esp_a2d_sink_connect(esp_bd_addr_t remote_bda);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -339,7 +339,7 @@ esp_err_t esp_a2d_sink_disconnect(esp_bd_addr_t remote_bda);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: delay value is sent to lower layer successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -352,7 +352,7 @@ esp_err_t esp_a2d_sink_set_delay_value(uint16_t delay_value);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: if the request is sent successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -368,7 +368,7 @@ esp_err_t esp_a2d_sink_get_delay_value(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: control command is sent to lower layer successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -385,7 +385,7 @@ esp_err_t esp_a2d_media_ctrl(esp_a2d_media_ctrl_t ctrl);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: if the initialization request is sent to lower layer successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -400,7 +400,7 @@ esp_err_t esp_a2d_source_init(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -417,7 +417,7 @@ esp_err_t esp_a2d_source_deinit(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: if callback is a NULL function pointer
|
||||
*
|
||||
*/
|
||||
@@ -433,7 +433,7 @@ esp_err_t esp_a2d_source_register_data_callback(esp_a2d_source_data_cb_t callbac
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: connect request is sent to lower layer successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -448,7 +448,7 @@ esp_err_t esp_a2d_source_connect(esp_bd_addr_t remote_bda);
|
||||
* @param[in] remote_bda: remote bluetooth device address
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -47,7 +47,6 @@ typedef enum {
|
||||
ESP_BT_STATUS_MEMORY_FULL = 20, /* relate to BT_STATUS_MEMORY_FULL in bt_def.h */
|
||||
ESP_BT_STATUS_EIR_TOO_LARGE, /* relate to BT_STATUS_EIR_TOO_LARGE in bt_def.h */
|
||||
ESP_BT_STATUS_HCI_SUCCESS = ESP_BT_STATUS_BASE_FOR_HCI_ERR,
|
||||
ESP_BT_STATUS_HCI_PENDING,
|
||||
ESP_BT_STATUS_HCI_ILLEGAL_COMMAND,
|
||||
ESP_BT_STATUS_HCI_NO_CONNECTION,
|
||||
ESP_BT_STATUS_HCI_HW_FAILURE,
|
||||
@@ -126,18 +125,20 @@ typedef uint8_t esp_link_key[ESP_BT_OCTET16_LEN]; /* Link Key */
|
||||
/// Default GATT interface id
|
||||
#define ESP_DEFAULT_GATT_IF 0xff
|
||||
|
||||
#if BLE_HIGH_DUTY_ADV_INTERVAL
|
||||
#define ESP_BLE_PRIM_ADV_INT_MIN 0x000008 /*!< Minimum advertising interval for undirected and low duty cycle directed advertising */
|
||||
#else
|
||||
#define ESP_BLE_PRIM_ADV_INT_MIN 0x000020 /*!< Minimum advertising interval for undirected and low duty cycle directed advertising */
|
||||
#endif
|
||||
#define ESP_BLE_PRIM_ADV_INT_MAX 0xFFFFFF /*!< Maximum advertising interval for undirected and low duty cycle directed advertising */
|
||||
#define ESP_BLE_CONN_INT_MIN 0x0006 /*!< relate to BTM_BLE_CONN_INT_MIN in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_CONN_INT_MAX 0x0C80 /*!< relate to BTM_BLE_CONN_INT_MAX in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_CONN_LATENCY_MAX 499 /*!< relate to ESP_BLE_CONN_LATENCY_MAX in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_CONN_SUP_TOUT_MIN 0x000A /*!< relate to BTM_BLE_CONN_SUP_TOUT_MIN in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_CONN_SUP_TOUT_MAX 0x0C80 /*!< relate to ESP_BLE_CONN_SUP_TOUT_MAX in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_CONN_PARAM_UNDEF 0xffff /* use this value when a specific value not to be overwritten */ /* relate to ESP_BLE_CONN_PARAM_UNDEF in stack/btm_ble_api.h */
|
||||
#define ESP_BLE_SCAN_PARAM_UNDEF 0xffffffff /* relate to ESP_BLE_SCAN_PARAM_UNDEF in stack/btm_ble_api.h */
|
||||
|
||||
/// Check the param is valid or not
|
||||
#define ESP_BLE_IS_VALID_PARAM(x, min, max) (((x) >= (min) && (x) <= (max)) || ((x) == ESP_BLE_CONN_PARAM_UNDEF))
|
||||
#define ESP_BLE_IS_VALID_PARAM(x, min, max) (((x) >= (min) && (x) <= (max)) )
|
||||
|
||||
/// UUID type
|
||||
typedef struct {
|
||||
@@ -167,10 +168,10 @@ typedef uint8_t esp_bd_addr_t[ESP_BD_ADDR_LEN];
|
||||
|
||||
/// BLE device address type
|
||||
typedef enum {
|
||||
BLE_ADDR_TYPE_PUBLIC = 0x00,
|
||||
BLE_ADDR_TYPE_RANDOM = 0x01,
|
||||
BLE_ADDR_TYPE_RPA_PUBLIC = 0x02,
|
||||
BLE_ADDR_TYPE_RPA_RANDOM = 0x03,
|
||||
BLE_ADDR_TYPE_PUBLIC = 0x00, /*!< Public Device Address */
|
||||
BLE_ADDR_TYPE_RANDOM = 0x01, /*!< Random Device Address. To set this address, use the function esp_ble_gap_set_rand_addr(esp_bd_addr_t rand_addr) */
|
||||
BLE_ADDR_TYPE_RPA_PUBLIC = 0x02, /*!< Resolvable Private Address (RPA) with public identity address */
|
||||
BLE_ADDR_TYPE_RPA_RANDOM = 0x03, /*!< Resolvable Private Address (RPA) with random identity address. To set this address, use the function esp_ble_gap_set_rand_addr(esp_bd_addr_t rand_addr) */
|
||||
} esp_ble_addr_type_t;
|
||||
|
||||
/// white list address type
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -133,7 +133,7 @@ typedef enum {
|
||||
ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT, /*!< When scan parameters set complete, the event comes */
|
||||
ESP_GAP_BLE_SCAN_RESULT_EVT, /*!< When one scan result ready, the event comes each time */
|
||||
ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT, /*!< When raw advertising data set complete, the event comes */
|
||||
ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT, /*!< When raw advertising data set complete, the event comes */
|
||||
ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT, /*!< When raw scan response data set complete, the event comes */
|
||||
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 */
|
||||
//BLE_INCLUDED
|
||||
@@ -202,6 +202,14 @@ typedef enum {
|
||||
ESP_GAP_BLE_SC_OOB_REQ_EVT, /*!< Secure Connection OOB request event */
|
||||
ESP_GAP_BLE_SC_CR_LOC_OOB_EVT, /*!< Secure Connection create OOB data complete event */
|
||||
ESP_GAP_BLE_GET_DEV_NAME_COMPLETE_EVT, /*!< When getting BT device name complete, the event comes */
|
||||
//BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER
|
||||
ESP_GAP_BLE_PERIODIC_ADV_RECV_ENABLE_COMPLETE_EVT, /*!< when set periodic advertising receive enable complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_TRANS_COMPLETE_EVT, /*!< when periodic advertising sync transfer complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_SET_INFO_TRANS_COMPLETE_EVT, /*!< when periodic advertising set info transfer complete, the event comes */
|
||||
ESP_GAP_BLE_SET_PAST_PARAMS_COMPLETE_EVT, /*!< when set periodic advertising sync transfer params complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_TRANS_RECV_EVT, /*!< when periodic advertising sync transfer received, the event comes */
|
||||
// BLE_INCLUDED
|
||||
ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT, /*!< When clear advertising complete, the event comes */
|
||||
ESP_GAP_BLE_EVT_MAX, /*!< when maximum advertising event complete, the event comes */
|
||||
} esp_gap_ble_cb_event_t;
|
||||
|
||||
@@ -586,6 +594,13 @@ typedef struct {
|
||||
esp_bt_octet16_t dhk; /*!< the 16 bits of the dh key value */
|
||||
} esp_ble_local_id_keys_t; /*!< the structure of the ble local id keys value type*/
|
||||
|
||||
/**
|
||||
* @brief structure type of the ble local oob data value
|
||||
*/
|
||||
typedef struct {
|
||||
esp_bt_octet16_t oob_c; /*!< the 128 bits of confirmation value */
|
||||
esp_bt_octet16_t oob_r; /*!< the 128 bits of randomizer value */
|
||||
} esp_ble_local_oob_data_t;
|
||||
|
||||
/**
|
||||
* @brief Structure associated with ESP_AUTH_CMPL_EVT
|
||||
@@ -612,6 +627,7 @@ typedef union
|
||||
esp_ble_sec_req_t ble_req; /*!< BLE SMP related request */
|
||||
esp_ble_key_t ble_key; /*!< BLE SMP keys used when pairing */
|
||||
esp_ble_local_id_keys_t ble_id_keys; /*!< BLE IR event */
|
||||
esp_ble_local_oob_data_t oob_data; /*!< BLE SMP secure connection OOB data */
|
||||
esp_ble_auth_cmpl_t auth_cmpl; /*!< Authentication complete indication. */
|
||||
} esp_ble_sec_t; /*!< BLE security type */
|
||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
@@ -660,6 +676,8 @@ typedef enum {
|
||||
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_BEACON_TYPE, /*!< BLE mesh beacon AD type, the format is | Len | 0x2B | Beacon Type | Beacon Data | */
|
||||
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_PROV_SRV_ADV, /*!< BLE mesh provisioning service uuid, the format is | 0x02 | 0x01 | flags | 0x03 | 0x03 | 0x1827 | .... |` */
|
||||
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_PROXY_SRV_ADV, /*!< BLE mesh adv with proxy service uuid, the format is | 0x02 | 0x01 | flags | 0x03 | 0x03 | 0x1828 | .... |` */
|
||||
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_PROXY_SOLIC_ADV, /*!< BLE mesh adv with proxy service uuid, the format is | 0x02 | 0x01 | flags | 0x03 | 0x03 | 0x1859 | .... |` */
|
||||
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_URI_ADV, /*!< BLE mesh URI adv, the format is ...| Len | 0x24 | data |... */
|
||||
} esp_ble_duplicate_exceptional_info_type_t;
|
||||
|
||||
typedef enum {
|
||||
@@ -667,7 +685,9 @@ typedef enum {
|
||||
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_LINK_ID_LIST = BLE_BIT(1), /*!< duplicate scan exceptional mesh link ID list */
|
||||
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_BEACON_TYPE_LIST = BLE_BIT(2), /*!< duplicate scan exceptional mesh beacon type list */
|
||||
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_PROV_SRV_ADV_LIST = BLE_BIT(3), /*!< duplicate scan exceptional mesh adv with provisioning service uuid */
|
||||
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_PROXY_SRV_ADV_LIST = BLE_BIT(4), /*!< duplicate scan exceptional mesh adv with provisioning service uuid */
|
||||
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_PROXY_SRV_ADV_LIST = BLE_BIT(4), /*!< duplicate scan exceptional mesh adv with proxy service uuid */
|
||||
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_PROXY_SOLIC_ADV_LIST = BLE_BIT(5), /*!< duplicate scan exceptional mesh adv with proxy solicitation PDU uuid */
|
||||
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_URI_ADV_LIST = BLE_BIT(6), /*!< duplicate scan exceptional URI list */
|
||||
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_ALL_LIST = 0xFFFF, /*!< duplicate scan exceptional all list */
|
||||
} esp_duplicate_scan_exceptional_list_type_t;
|
||||
|
||||
@@ -902,6 +922,25 @@ typedef struct {
|
||||
|
||||
#endif //#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
/// Periodic advertising sync trans mode
|
||||
#define ESP_BLE_GAP_PAST_MODE_NO_SYNC_EVT (0x00) /*!< No attempt is made to sync and no periodic adv sync transfer received event */
|
||||
#define ESP_BLE_GAP_PAST_MODE_NO_REPORT_EVT (0x01) /*!< An periodic adv sync transfer received event and no periodic adv report events */
|
||||
#define ESP_BLE_GAP_PAST_MODE_DUP_FILTER_DISABLED (0x02) /*!< Periodic adv report events will be enabled with duplicate filtering disabled */
|
||||
#define ESP_BLE_GAP_PAST_MODE_DUP_FILTER_ENABLED (0x03) /*!< Periodic adv report events will be enabled with duplicate filtering enabled */
|
||||
typedef uint8_t esp_ble_gap_past_mode_t;
|
||||
|
||||
/**
|
||||
* @brief periodic adv sync transfer parameters
|
||||
*/
|
||||
typedef struct {
|
||||
esp_ble_gap_past_mode_t mode; /*!< periodic advertising sync transfer mode */
|
||||
uint16_t skip; /*!< the number of periodic advertising packets that can be skipped */
|
||||
uint16_t sync_timeout; /*!< synchronization timeout for the periodic advertising train */
|
||||
uint8_t cte_type; /*!< periodic advertising sync transfer CET type */
|
||||
} esp_ble_gap_past_params_t;
|
||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
|
||||
/**
|
||||
* @brief Gap callback parameters union
|
||||
*/
|
||||
@@ -988,6 +1027,12 @@ typedef union {
|
||||
struct ble_adv_stop_cmpl_evt_param {
|
||||
esp_bt_status_t status; /*!< Indicate adv stop operation success status */
|
||||
} adv_stop_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT */
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT
|
||||
*/
|
||||
struct ble_adv_clear_cmpl_evt_param {
|
||||
esp_bt_status_t status; /*!< Indicate adv clear operation success status */
|
||||
} adv_clear_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT */
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT
|
||||
@@ -1300,6 +1345,50 @@ typedef union {
|
||||
esp_ble_gap_periodic_adv_report_t params; /*!< periodic advertising report parameters */
|
||||
} period_adv_report; /*!< Event parameter of ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT */
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_PERIODIC_ADV_RECV_ENABLE_COMPLETE_EVT
|
||||
*/
|
||||
struct ble_periodic_adv_recv_enable_cmpl_param {
|
||||
esp_bt_status_t status; /*!< Set periodic advertising receive enable status */
|
||||
} period_adv_recv_enable; /*!< Event parameter of ESP_GAP_BLE_PERIODIC_ADV_RECV_ENABLE_COMPLETE_EVT */
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_PERIODIC_ADV_SYNC_TRANS_COMPLETE_EVT
|
||||
*/
|
||||
struct ble_periodic_adv_sync_trans_cmpl_param {
|
||||
esp_bt_status_t status; /*!< Periodic advertising sync transfer status */
|
||||
esp_bd_addr_t bda; /*!< The remote device address */
|
||||
} period_adv_sync_trans; /*!< Event parameter of ESP_GAP_BLE_PERIODIC_ADV_SYNC_TRANS_COMPLETE_EVT */
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_PERIODIC_ADV_SET_INFO_TRANS_COMPLETE_EVT
|
||||
*/
|
||||
struct ble_periodic_adv_set_info_trans_cmpl_param {
|
||||
esp_bt_status_t status; /*!< Periodic advertising set info transfer status */
|
||||
esp_bd_addr_t bda; /*!< The remote device address */
|
||||
} period_adv_set_info_trans; /*!< Event parameter of ESP_GAP_BLE_PERIODIC_ADV_SET_INFO_TRANS_COMPLETE_EVT */
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_SET_PAST_PARAMS_COMPLETE_EVT
|
||||
*/
|
||||
struct ble_set_past_params_cmpl_param {
|
||||
esp_bt_status_t status; /*!< Set periodic advertising sync transfer params status */
|
||||
esp_bd_addr_t bda; /*!< The remote device address */
|
||||
} set_past_params; /*!< Event parameter of ESP_GAP_BLE_SET_PAST_PARAMS_COMPLETE_EVT */
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_PERIODIC_ADV_SYNC_TRANS_RECV_EVT
|
||||
*/
|
||||
struct ble_periodic_adv_sync_trans_recv_param {
|
||||
esp_bt_status_t status; /*!< Periodic advertising sync transfer received status */
|
||||
esp_bd_addr_t bda; /*!< The remote device address */
|
||||
uint16_t service_data; /*!< The value provided by the peer device */
|
||||
uint16_t sync_handle; /*!< Periodic advertising sync handle */
|
||||
uint8_t adv_sid; /*!< Periodic advertising set id */
|
||||
uint8_t adv_addr_type; /*!< Periodic advertiser address type */
|
||||
esp_bd_addr_t adv_addr; /*!< Periodic advertiser address */
|
||||
esp_ble_gap_phy_t adv_phy; /*!< Periodic advertising PHY */
|
||||
uint16_t adv_interval; /*!< Periodic advertising interval */
|
||||
uint8_t adv_clk_accuracy; /*!< Periodic advertising clock accuracy */
|
||||
} past_received; /*!< Event parameter of ESP_GAP_BLE_PERIODIC_ADV_SYNC_TRANS_RECV_EVT */
|
||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
} esp_ble_gap_cb_param_t;
|
||||
|
||||
/**
|
||||
@@ -1424,9 +1513,17 @@ esp_err_t esp_ble_gap_update_conn_params(esp_ble_conn_update_params_t *params);
|
||||
esp_err_t esp_ble_gap_set_pkt_data_len(esp_bd_addr_t remote_device, uint16_t tx_data_length);
|
||||
|
||||
/**
|
||||
* @brief This function sets the static Random Address and Non-Resolvable Private Address for the application
|
||||
* @brief This function allows configuring either a Non-Resolvable Private Address or a Static Random Address
|
||||
*
|
||||
* @param[in] rand_addr: the random address which should be setting
|
||||
* @param[in] rand_addr: The address to be configured. Refer to the table below for possible address subtypes:
|
||||
*
|
||||
* | address [47:46] | Address Type |
|
||||
* |-----------------|--------------------------|
|
||||
* | 0b00 | Non-Resolvable Private |
|
||||
* | | Address |
|
||||
* |-----------------|--------------------------|
|
||||
* | 0b11 | Static Random Address |
|
||||
* |-----------------|--------------------------|
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK : success
|
||||
@@ -1448,7 +1545,7 @@ esp_err_t esp_ble_gap_clear_rand_addr(void);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Enable/disable privacy on the local device
|
||||
* @brief Enable/disable privacy (including address resolution) on the local device
|
||||
*
|
||||
* @param[in] privacy_enable - enable/disable privacy on remote device.
|
||||
*
|
||||
@@ -1529,6 +1626,7 @@ esp_err_t esp_ble_gap_set_prefer_conn_params(esp_bd_addr_t bd_addr,
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
/**
|
||||
* @brief Set device name to the local device
|
||||
* Note: This API don't affect the advertising data
|
||||
*
|
||||
* @param[in] name - device name.
|
||||
*
|
||||
@@ -1577,7 +1675,7 @@ uint8_t *esp_ble_resolve_adv_data(uint8_t *adv_data, uint8_t type, uint8_t *leng
|
||||
* @brief This function is called to set raw advertising data. User need to fill
|
||||
* ADV data by self.
|
||||
*
|
||||
* @param[in] raw_data : raw advertising data
|
||||
* @param[in] raw_data : raw advertising data with the format: [Length 1][Data Type 1][Data 1][Length 2][Data Type 2][Data 2] ...
|
||||
* @param[in] raw_data_len : raw advertising data length , less than 31 bytes
|
||||
*
|
||||
* @return
|
||||
@@ -1790,6 +1888,29 @@ esp_err_t esp_ble_get_bond_device_list(int *dev_num, esp_ble_bond_dev_t *dev_lis
|
||||
*/
|
||||
esp_err_t esp_ble_oob_req_reply(esp_bd_addr_t bd_addr, uint8_t *TK, uint8_t len);
|
||||
|
||||
/**
|
||||
* @brief This function is called to provide the OOB data for
|
||||
* SMP in response to ESP_GAP_BLE_SC_OOB_REQ_EVT
|
||||
*
|
||||
* @param[in] bd_addr: BD address of the peer device.
|
||||
* @param[in] p_c: Confirmation value, it shall be a 128-bit random number
|
||||
* @param[in] p_r: Randomizer value, it should be a 128-bit random number
|
||||
*
|
||||
* @return - ESP_OK : success
|
||||
* - other : failed
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_sc_oob_req_reply(esp_bd_addr_t bd_addr, uint8_t p_c[16], uint8_t p_r[16]);
|
||||
|
||||
/**
|
||||
* @brief This function is called to create the OOB data for
|
||||
* SMP when secure connection
|
||||
*
|
||||
* @return - ESP_OK : success
|
||||
* - other : failed
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_create_sc_oob_data(void);
|
||||
#endif /* #if (SMP_INCLUDED == TRUE) */
|
||||
|
||||
/**
|
||||
@@ -2007,6 +2128,22 @@ esp_err_t esp_ble_gap_ext_adv_set_clear(void);
|
||||
*/
|
||||
esp_err_t esp_ble_gap_periodic_adv_set_params(uint8_t instance, const esp_ble_gap_periodic_adv_params_t *params);
|
||||
|
||||
#if (CONFIG_BT_BLE_FEAT_PERIODIC_ADV_ENH)
|
||||
/**
|
||||
* @brief This function is used to set the data used in periodic advertising PDUs.
|
||||
*
|
||||
* @param[in] instance : identifies the advertising set whose periodic advertising parameters are being configured.
|
||||
* @param[in] length : the length of periodic data
|
||||
* @param[in] data : periodic data information
|
||||
* @param[in] only_update_did : If true, only the Advertising DID of the periodic advertising will be updated, and the length and data parameters will be ignored.
|
||||
*
|
||||
* @return - ESP_OK : success
|
||||
* - other : failed
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_gap_config_periodic_adv_data_raw(uint8_t instance, uint16_t length,
|
||||
const uint8_t *data, bool only_update_did);
|
||||
#else
|
||||
/**
|
||||
* @brief This function is used to set the data used in periodic advertising PDUs.
|
||||
*
|
||||
@@ -2020,6 +2157,21 @@ esp_err_t esp_ble_gap_periodic_adv_set_params(uint8_t instance, const esp_ble_ga
|
||||
*/
|
||||
esp_err_t esp_ble_gap_config_periodic_adv_data_raw(uint8_t instance, uint16_t length,
|
||||
const uint8_t *data);
|
||||
#endif
|
||||
|
||||
#if (CONFIG_BT_BLE_FEAT_PERIODIC_ADV_ENH)
|
||||
/**
|
||||
* @brief This function is used to request the Controller to enable the periodic advertising for the advertising set specified
|
||||
*
|
||||
* @param[in] instance : Used to identify an advertising set
|
||||
* @param[in] include_adi : If true, the ADI (Advertising Data Info) field will be included in AUX_SYNC_IND PDUs
|
||||
*
|
||||
* @return - ESP_OK : success
|
||||
* - other : failed
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_gap_periodic_adv_start(uint8_t instance,bool include_adi);
|
||||
#else
|
||||
/**
|
||||
* @brief This function is used to request the Controller to enable the periodic advertising for the advertising set specified
|
||||
*
|
||||
@@ -2030,6 +2182,7 @@ esp_err_t esp_ble_gap_config_periodic_adv_data_raw(uint8_t instance, uint16_t le
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_gap_periodic_adv_start(uint8_t instance);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief This function is used to request the Controller to disable the periodic advertising for the advertising set specified
|
||||
@@ -2166,6 +2319,71 @@ esp_err_t esp_ble_gap_prefer_ext_connect_params_set(esp_bd_addr_t addr,
|
||||
|
||||
#endif //#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
/**
|
||||
* @brief This function is used to set periodic advertising receive enable
|
||||
*
|
||||
* @param[in] sync_handle : Handle of periodic advertising sync
|
||||
* @param[in] enable : Determines whether reporting and duplicate filtering are enabled or disabled
|
||||
*
|
||||
* @return - ESP_OK : success
|
||||
* - other : failed
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_gap_periodic_adv_recv_enable(uint16_t sync_handle, uint8_t enable);
|
||||
|
||||
/**
|
||||
* @brief This function is used to transfer periodic advertising sync
|
||||
*
|
||||
* @param[in] addr : Peer device address
|
||||
* @param[in] service_data : Service data used by Host
|
||||
* @param[in] sync_handle : Handle of periodic advertising sync
|
||||
*
|
||||
* @return - ESP_OK : success
|
||||
* - other : failed
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_gap_periodic_adv_sync_trans(esp_bd_addr_t addr,
|
||||
uint16_t service_data, uint16_t sync_handle);
|
||||
|
||||
/**
|
||||
* @brief This function is used to transfer periodic advertising set info
|
||||
*
|
||||
* @param[in] addr : Peer device address
|
||||
* @param[in] service_data : Service data used by Host
|
||||
* @param[in] adv_handle : Handle of advertising set
|
||||
*
|
||||
* @return - ESP_OK : success
|
||||
* - other : failed
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_gap_periodic_adv_set_info_trans(esp_bd_addr_t addr,
|
||||
uint16_t service_data, uint8_t adv_handle);
|
||||
|
||||
/**
|
||||
* @brief This function is used to set periodic advertising sync transfer params
|
||||
*
|
||||
* @param[in] addr : Peer device address
|
||||
* @param[in] params : Params of periodic advertising sync transfer
|
||||
*
|
||||
* @return - ESP_OK : success
|
||||
* - other : failed
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_gap_set_periodic_adv_sync_trans_params(esp_bd_addr_t addr,
|
||||
const esp_ble_gap_past_params_t *params);
|
||||
#endif //#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
|
||||
/**
|
||||
* @brief This function is used to clear legacy advertising
|
||||
*
|
||||
*
|
||||
* @return - ESP_OK : success
|
||||
* - other : failed
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_gap_clear_advertising(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -106,6 +106,7 @@ typedef struct {
|
||||
bool fec_required; /*!< FEC is required or not, true by default */
|
||||
bool include_txpower; /*!< EIR data include TX power, false by default */
|
||||
bool include_uuid; /*!< EIR data include UUID, false by default */
|
||||
bool include_name; /*!< EIR data include device name, true by default */
|
||||
uint8_t flag; /*!< EIR flags, see ESP_BT_EIR_FLAG for details, EIR will not include flag if it is 0, 0 by default */
|
||||
uint16_t manufacturer_len; /*!< Manufacturer data length, 0 by default */
|
||||
uint8_t *p_manufacturer_data; /*!< Manufacturer data point */
|
||||
@@ -230,6 +231,11 @@ typedef enum {
|
||||
#define ESP_BT_GAP_MIN_INQ_LEN (0x01) /*!< Minimum inquiry duration, unit is 1.28s */
|
||||
#define ESP_BT_GAP_MAX_INQ_LEN (0x30) /*!< Maximum inquiry duration, unit is 1.28s */
|
||||
|
||||
/** Minimum, Default and Maximum poll interval **/
|
||||
#define ESP_BT_GAP_TPOLL_MIN (0x0006) /*!< Minimum poll interval, unit is 625 microseconds */
|
||||
#define ESP_BT_GAP_TPOLL_DFT (0x0028) /*!< Default poll interval, unit is 625 microseconds */
|
||||
#define ESP_BT_GAP_TPOLL_MAX (0x1000) /*!< Maximum poll interval, unit is 625 microseconds */
|
||||
|
||||
/// GAP state callback parameters
|
||||
typedef union {
|
||||
/**
|
||||
|
||||
@@ -60,6 +60,7 @@ typedef enum {
|
||||
ESP_GATTC_SET_ASSOC_EVT = 44, /*!< When the ble gattc set the associated address complete, the event comes */
|
||||
ESP_GATTC_GET_ADDR_LIST_EVT = 45, /*!< When the ble get gattc address list in cache finish, the event comes */
|
||||
ESP_GATTC_DIS_SRVC_CMPL_EVT = 46, /*!< When the ble discover service complete, the event comes */
|
||||
ESP_GATTC_READ_MULTI_VAR_EVT = 47, /*!< When read multiple variable characteristic complete, the event comes */
|
||||
} esp_gattc_cb_event_t;
|
||||
|
||||
|
||||
@@ -125,7 +126,7 @@ typedef union {
|
||||
} search_res; /*!< Gatt client callback param of ESP_GATTC_SEARCH_RES_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_GATTC_READ_CHAR_EVT, ESP_GATTC_READ_DESCR_EVT
|
||||
* @brief ESP_GATTC_READ_CHAR_EVT, ESP_GATTC_READ_DESCR_EVT, ESP_GATTC_READ_MULTIPLE_EVT, ESP_GATTC_READ_MULTI_VAR_EVT
|
||||
*/
|
||||
struct gattc_read_char_evt_param {
|
||||
|
||||
@@ -358,6 +359,7 @@ esp_err_t esp_ble_gattc_send_mtu_req (esp_gatt_if_t gattc_if, uint16_t conn_id);
|
||||
* @brief This function is called to get service from local cache.
|
||||
* This function report service search result by a callback
|
||||
* event, and followed by a service search complete event.
|
||||
* Note: 128-bit base UUID will automatically be converted to a 16-bit UUID in the search results. Other types of UUID remain unchanged.
|
||||
*
|
||||
* @param[in] gattc_if: Gatt client access interface.
|
||||
* @param[in] conn_id: connection ID.
|
||||
@@ -651,6 +653,23 @@ esp_err_t esp_ble_gattc_read_multiple(esp_gatt_if_t gattc_if,
|
||||
uint16_t conn_id, esp_gattc_multi_t *read_multi,
|
||||
esp_gatt_auth_req_t auth_req);
|
||||
|
||||
/**
|
||||
* @brief This function is called to read multiple variable length characteristic or
|
||||
* characteristic descriptors.
|
||||
*
|
||||
* @param[in] gattc_if: Gatt client access interface.
|
||||
* @param[in] conn_id : connection ID.
|
||||
* @param[in] read_multi : pointer to the read multiple parameter.
|
||||
* @param[in] auth_req : authenticate request type
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - other: failed
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_gattc_read_multiple_variable(esp_gatt_if_t gattc_if,
|
||||
uint16_t conn_id, esp_gattc_multi_t *read_multi,
|
||||
esp_gatt_auth_req_t auth_req);
|
||||
|
||||
/**
|
||||
* @brief This function is called to read a characteristics descriptor.
|
||||
|
||||
@@ -464,6 +464,7 @@ esp_err_t esp_ble_gatts_stop_service(uint16_t service_handle);
|
||||
/**
|
||||
* @brief Send indicate or notify to GATT client.
|
||||
* Set param need_confirm as false will send notification, otherwise indication.
|
||||
* Note: the size of indicate or notify data need less than MTU size,see "esp_ble_gattc_send_mtu_req".
|
||||
*
|
||||
* @param[in] gatts_if: GATT server access interface
|
||||
* @param[in] conn_id - connection id to indicate.
|
||||
@@ -572,6 +573,16 @@ esp_err_t esp_ble_gatts_close(esp_gatt_if_t gatts_if, uint16_t conn_id);
|
||||
*/
|
||||
esp_err_t esp_ble_gatts_send_service_change_indication(esp_gatt_if_t gatts_if, esp_bd_addr_t remote_bda);
|
||||
|
||||
/**
|
||||
* @brief Print local database (GATT service table)
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK : success
|
||||
* - other : failed
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_gatts_show_local_database(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -62,13 +62,22 @@ typedef enum
|
||||
ESP_HF_DIAL_EVT, /*!< Origin an outgoing call with specific number or the dial the last number */
|
||||
ESP_HF_WBS_RESPONSE_EVT, /*!< Codec Status */
|
||||
ESP_HF_BCS_RESPONSE_EVT, /*!< Final Codec Choice */
|
||||
ESP_HF_PKT_STAT_NUMS_GET_EVT, /*!< Request number of packet different status */
|
||||
} esp_hf_cb_event_t;
|
||||
|
||||
/// Dial type of ESP_HF_DIAL_EVT
|
||||
typedef enum
|
||||
{
|
||||
ESP_HF_DIAL_NUM = 0, /*!< Dial with a phone number */
|
||||
ESP_HF_DIAL_VOIP, /*!< Dial with VoIP */
|
||||
ESP_HF_DIAL_MEM, /*!< Dial with a memory position */
|
||||
} esp_hf_dial_type_t;
|
||||
|
||||
/// HFP AG callback parameters
|
||||
typedef union
|
||||
{
|
||||
/**
|
||||
* @brief ESP_HS_CONNECTION_STATE_EVT
|
||||
* @brief ESP_HF_CONNECTION_STATE_EVT
|
||||
*/
|
||||
struct hf_conn_stat_param {
|
||||
esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */
|
||||
@@ -83,6 +92,7 @@ typedef union
|
||||
struct hf_audio_stat_param {
|
||||
esp_bd_addr_t remote_addr; /*!< Remote bluetooth device address */
|
||||
esp_hf_audio_state_t state; /*!< Audio connection state */
|
||||
uint16_t sync_conn_handle; /*!< (e)SCO connection handle */
|
||||
} audio_stat; /*!< AG callback param of ESP_HF_AUDIO_STATE_EVT */
|
||||
|
||||
/**
|
||||
@@ -97,6 +107,7 @@ typedef union
|
||||
* @brief ESP_HF_VOLUME_CONTROL_EVT
|
||||
*/
|
||||
struct hf_volume_control_param {
|
||||
esp_bd_addr_t remote_addr; /*!< Remote bluetooth device address */
|
||||
esp_hf_volume_type_t type; /*!< Volume control target, speaker or microphone */
|
||||
int volume; /*!< Gain, ranges from 0 to 15 */
|
||||
} volume_control; /*!< AG callback param of ESP_HF_VOLUME_CONTROL_EVT */
|
||||
@@ -105,48 +116,89 @@ typedef union
|
||||
* @brief ESP_HF_UNAT_RESPONSE_EVT
|
||||
*/
|
||||
struct hf_unat_rep_param {
|
||||
esp_bd_addr_t remote_addr; /*!< Remote bluetooth device address */
|
||||
char *unat; /*!< Unknown AT command string */
|
||||
}unat_rep; /*!< AG callback param of ESP_HF_UNAT_RESPONSE_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_HF_CIND_RESPONSE_EVT
|
||||
*/
|
||||
struct hf_cind_param {
|
||||
esp_hf_call_status_t call_status; /*!< call status indicator */
|
||||
esp_hf_call_setup_status_t call_setup_status; /*!< call setup status indicator */
|
||||
esp_hf_network_state_t svc; /*!< bluetooth proprietary call hold status indicator */
|
||||
int signal_strength; /*!< bluetooth proprietary call hold status indicator */
|
||||
esp_hf_roaming_status_t roam; /*!< bluetooth proprietary call hold status indicator */
|
||||
int battery_level; /*!< battery charge value, ranges from 0 to 5 */
|
||||
esp_hf_call_held_status_t call_held_status; /*!< bluetooth proprietary call hold status indicator */
|
||||
} cind; /*!< AG callback param of ESP_HF_CIND_RESPONSE_EVT */
|
||||
} unat_rep; /*!< AG callback param of ESP_HF_UNAT_RESPONSE_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_HF_DIAL_EVT
|
||||
*/
|
||||
struct hf_out_call_param {
|
||||
esp_bd_addr_t remote_addr; /*!< remote bluetooth device address */
|
||||
esp_hf_dial_type_t type; /*!< dial type */
|
||||
char *num_or_loc; /*!< location in phone memory */
|
||||
} out_call; /*!< AG callback param of ESP_HF_DIAL_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_HF_IND_UPDATE_EVT
|
||||
*/
|
||||
struct hf_ind_upd_param {
|
||||
esp_bd_addr_t remote_addr; /*!< remote bluetooth device address */
|
||||
} ind_upd; /*!< AG callback param of ESP_HF_IND_UPDATE_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_HF_CIND_RESPONSE_EVT
|
||||
*/
|
||||
struct hf_cind_rep_param {
|
||||
esp_bd_addr_t remote_addr; /*!< remote bluetooth device address */
|
||||
} cind_rep; /*!< AG callback param of ESP_HF_CIND_RESPONSE_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_HF_COPS_RESPONSE_EVT
|
||||
*/
|
||||
struct hf_cops_rep_param {
|
||||
esp_bd_addr_t remote_addr; /*!< remote bluetooth device address */
|
||||
} cops_rep; /*!< AG callback param of ESP_HF_COPS_RESPONSE_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_HF_CLCC_RESPONSE_EVT
|
||||
*/
|
||||
struct hf_clcc_rep_param {
|
||||
esp_bd_addr_t remote_addr; /*!< remote bluetooth device address */
|
||||
} clcc_rep; /*!< AG callback param of ESP_HF_CLCC_RESPONSE_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_HF_CNUM_RESPONSE_EVT
|
||||
*/
|
||||
struct hf_cnum_rep_param {
|
||||
esp_bd_addr_t remote_addr; /*!< remote bluetooth device address */
|
||||
} cnum_rep; /*!< AG callback param of ESP_HF_CNUM_RESPONSE_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_HF_VTS_RESPONSE_EVT
|
||||
*/
|
||||
struct hf_vts_rep_param {
|
||||
esp_bd_addr_t remote_addr; /*!< Remote bluetooth device address */
|
||||
char *code; /*!< MTF code from HF Client */
|
||||
}vts_rep; /*!< AG callback param of ESP_HF_VTS_RESPONSE_EVT */
|
||||
} vts_rep; /*!< AG callback param of ESP_HF_VTS_RESPONSE_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_HF_NREC_RESPONSE_EVT
|
||||
*/
|
||||
struct hf_nrec_param {
|
||||
esp_hf_nrec_t state; /*!< NREC enabled or disabled */
|
||||
esp_bd_addr_t remote_addr; /*!< Remote bluetooth device address */
|
||||
esp_hf_nrec_t state; /*!< NREC enabled or disabled */
|
||||
} nrec; /*!< AG callback param of ESP_HF_NREC_RESPONSE_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_HF_ATA_RESPONSE_EVT
|
||||
*/
|
||||
struct hf_ata_rep_param {
|
||||
esp_bd_addr_t remote_addr; /*!< remote bluetooth device address */
|
||||
} ata_rep; /*!< AG callback param of ESP_HF_ATA_RESPONSE_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_HF_CHUP_RESPONSE_EVT
|
||||
*/
|
||||
struct hf_chup_rep_param {
|
||||
esp_bd_addr_t remote_addr; /*!< remote bluetooth device address */
|
||||
} chup_rep; /*!< AG callback param of ESP_HF_CHUP_RESPONSE_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_HF_WBS_RESPONSE_EVT
|
||||
*/
|
||||
struct hf_wbs_rep_param {
|
||||
esp_bd_addr_t remote_addr; /*!< Remote bluetooth device address */
|
||||
esp_hf_wbs_config_t codec; /*!< codec mode CVSD or mSBC */
|
||||
} wbs_rep; /*!< AG callback param of ESP_HF_WBS_RESPONSE_EVT */
|
||||
|
||||
@@ -154,9 +206,23 @@ typedef union
|
||||
* @brief ESP_HF_BCS_RESPONSE_EVT
|
||||
*/
|
||||
struct hf_bcs_rep_param {
|
||||
esp_bd_addr_t remote_addr; /*!< Remote bluetooth device address */
|
||||
esp_hf_wbs_config_t mode; /*!< codec mode CVSD or mSBC */
|
||||
} bcs_rep; /*!< AG callback param of ESP_HF_BCS_RESPONSE_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_HF_PKT_STAT_NUMS_GET_EVT
|
||||
*/
|
||||
struct ag_pkt_status_nums {
|
||||
uint32_t rx_total; /*!< the total number of packets received */
|
||||
uint32_t rx_correct; /*!< the total number of packets data correctly received */
|
||||
uint32_t rx_err; /*!< the total number of packets data with possible invalid */
|
||||
uint32_t rx_none; /*!< the total number of packets data no received */
|
||||
uint32_t rx_lost; /*!< the total number of packets data partially lost */
|
||||
uint32_t tx_total; /*!< the total number of packets send */
|
||||
uint32_t tx_discarded; /*!< the total number of packets send lost */
|
||||
} pkt_nums; /*!< AG callback param of ESP_HF_PKT_STAT_NUMS_GET_EVT */
|
||||
|
||||
} esp_hf_cb_param_t; /*!< HFP AG callback param compound*/
|
||||
|
||||
/**
|
||||
@@ -208,7 +274,7 @@ typedef void (* esp_hf_cb_t) (esp_hf_cb_event_t event, esp_hf_cb_param_t *param)
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: if callback is a NULL function pointer
|
||||
*
|
||||
*/
|
||||
@@ -221,7 +287,7 @@ esp_err_t esp_hf_ag_register_callback(esp_hf_cb_t callback);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: if the initialization request is sent successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -234,7 +300,7 @@ esp_err_t esp_hf_ag_init(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -249,7 +315,7 @@ esp_err_t esp_hf_ag_deinit(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: connect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -264,7 +330,7 @@ esp_err_t esp_hf_ag_slc_connect(esp_bd_addr_t remote_bda);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -278,8 +344,8 @@ esp_err_t esp_hf_ag_slc_disconnect(esp_bd_addr_t remote_bda);
|
||||
* @param[in] remote_bda: remote bluetooth device address
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: audio connect request is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -293,8 +359,8 @@ esp_err_t esp_hf_ag_audio_connect(esp_bd_addr_t remote_bda);
|
||||
* @param[in] remote_bda: remote bluetooth device address
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: audio disconnect request is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -310,8 +376,8 @@ esp_err_t esp_hf_ag_audio_disconnect(esp_bd_addr_t remote_bda);
|
||||
* @param[in] value: 0 - voice recognition disabled, 1- voice recognition enabled
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: response of volume recognition is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -329,14 +395,15 @@ esp_err_t esp_hf_ag_vra_control(esp_bd_addr_t remote_bda, esp_hf_vr_state_t valu
|
||||
* @param[in] volume: gain of the speaker of microphone, ranges 0 to 15
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: volume synchronization control is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_ARG: if arguments are invalid
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_hf_ag_volume_control(esp_bd_addr_t remote_bda, esp_hf_volume_control_target_t type, int volume);
|
||||
|
||||
/**
|
||||
/**
|
||||
*
|
||||
* @brief Handle Unknown AT command from HFP Client.
|
||||
* As a precondition to use this API, Service Level Connection shall exist with HFP client.
|
||||
@@ -346,14 +413,14 @@ esp_err_t esp_hf_ag_volume_control(esp_bd_addr_t remote_bda, esp_hf_volume_contr
|
||||
* @param[in] unat: User AT command response to HF Client.
|
||||
* It will response "ERROR" by default if unat is NULL.
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: response of unknown AT command is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_hf_ag_unknown_at_send(esp_bd_addr_t remote_addr, char *unat);
|
||||
|
||||
/**
|
||||
/**
|
||||
*
|
||||
* @brief Unsolicited send extend AT error code to HFP Client.
|
||||
* As a precondition to use this API, Service Level Connection shall exist with HFP client.
|
||||
@@ -362,14 +429,14 @@ esp_err_t esp_hf_ag_unknown_at_send(esp_bd_addr_t remote_addr, char *unat);
|
||||
* @param[in] response_code: AT command response code
|
||||
* @param[in] error_code: CME error code
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: extend error code is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_hf_ag_cmee_send(esp_bd_addr_t remote_bda, esp_hf_at_response_code_t response_code, esp_hf_cme_err_t error_code);
|
||||
|
||||
/**
|
||||
/**
|
||||
*
|
||||
* @brief Unsolicited send device status notification to HFP Client.
|
||||
* As a precondition to use this API, Service Level Connection shall exist with HFP client.
|
||||
@@ -380,16 +447,36 @@ esp_err_t esp_hf_ag_cmee_send(esp_bd_addr_t remote_bda, esp_hf_at_response_code_
|
||||
* @param[in] ntk_state: network service state
|
||||
* @param[in] signal: signal strength from 0 to 5
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: device status notification is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_ARG: if arguments are invalid
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_hf_ag_devices_status_indchange(esp_bd_addr_t remote_addr, esp_hf_call_status_t call_state,
|
||||
esp_hf_call_setup_status_t call_setup_state,
|
||||
esp_hf_network_state_t ntk_state, int signal);
|
||||
esp_hf_call_setup_status_t call_setup_state,
|
||||
esp_hf_network_state_t ntk_state, int signal) __attribute__((
|
||||
deprecated("Please use esp_hf_ag_ciev_report")
|
||||
));
|
||||
|
||||
/**
|
||||
/**
|
||||
*
|
||||
* @brief Send indicator report "+CIEV: <ind> <value>" to HFP Client. "CIEV" means “indicator events reporting",
|
||||
* and all indicator types can be sent one type at a time.
|
||||
* As a precondition to use this API, Service Level Connection shall exist with HFP client.
|
||||
*
|
||||
* @param[in] remote_addr: remote bluetooth device address
|
||||
* @param[in] ind_type: indicator type
|
||||
* @param[in] value: indicator value
|
||||
* @return
|
||||
* - ESP_OK: indicator report is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_hf_ag_ciev_report(esp_bd_addr_t remote_addr, esp_hf_ciev_report_type_t ind_type, int value);
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Response to device individual indicators to HFP Client.
|
||||
* As a precondition to use this API, Service Level Connection shall exist with HFP client.
|
||||
@@ -403,8 +490,9 @@ esp_err_t esp_hf_ag_devices_status_indchange(esp_bd_addr_t remote_addr, esp_hf_c
|
||||
* @param[in] batt_lev: battery level from 0 to 5
|
||||
* @param[in] call_held_status: call held status
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: response to device individual indicators is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_ARG: if the arguments are invalid
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -422,8 +510,8 @@ esp_err_t esp_hf_ag_cind_response(esp_bd_addr_t remote_addr,
|
||||
* @param[in] remote_addr: remote bluetooth device address
|
||||
* @param[in] name: current operator name
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: reponse for AT+COPS command is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -435,7 +523,7 @@ esp_err_t esp_hf_ag_cops_response(esp_bd_addr_t remote_addr, char *name);
|
||||
* As a precondition to use this API, Service Level Connection shall exist with HFP client.
|
||||
*
|
||||
* @param[in] remote_addr: remote bluetooth device address
|
||||
* @param[in] index: the index of current call
|
||||
* @param[in] index: the index of current call, starting with 1, finishing response with 0 (send OK)
|
||||
* @param[in] dir: call direction (incoming/outgoing)
|
||||
* @param[in] current_call_state: current call state
|
||||
* @param[in] mode: current call mode (voice/data/fax)
|
||||
@@ -443,8 +531,8 @@ esp_err_t esp_hf_ag_cops_response(esp_bd_addr_t remote_addr, char *name);
|
||||
* @param[in] number: current call number
|
||||
* @param[in] type: international type or unknow
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: response to AT+CLCC command is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -459,14 +547,18 @@ esp_err_t esp_hf_ag_clcc_response(esp_bd_addr_t remote_addr, int index, esp_hf_c
|
||||
*
|
||||
* @param[in] remote_addr: remote bluetooth device address
|
||||
* @param[in] number: registration number
|
||||
* @param[in] type: service type (unknown/voice/fax)
|
||||
* @param[in] number_type: value of number type from
|
||||
* 128-143: national or international, may contain prefix and/or escape digits
|
||||
* 144-159: international, includes country code prefix, add "+" if needed
|
||||
* 160-175: national, but no prefix nor escape digits
|
||||
* @param[in] service_type: service type (unknown/voice/fax)
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: response for AT+CNUM command is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_hf_ag_cnum_response(esp_bd_addr_t remote_addr, char *number, esp_hf_subscriber_service_type_t type);
|
||||
esp_err_t esp_hf_ag_cnum_response(esp_bd_addr_t remote_addr, char *number, int number_type, esp_hf_subscriber_service_type_t service_type);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -476,8 +568,9 @@ esp_err_t esp_hf_ag_cnum_response(esp_bd_addr_t remote_addr, char *number, esp_h
|
||||
* @param[in] remote_addr: remote bluetooth device address
|
||||
* @param[in] state: in-band ring tone state
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: information of in-band ring tone is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_ARG: if arguments are invalid
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -496,8 +589,8 @@ esp_err_t esp_hf_ag_bsir(esp_bd_addr_t remote_addr, esp_hf_in_band_ring_state_t
|
||||
* @param[in] number: number of the incoming call
|
||||
* @param[in] call_addr_type: call address type
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: answer incoming call is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -518,8 +611,8 @@ esp_err_t esp_hf_ag_answer_call(esp_bd_addr_t remote_addr, int num_active, int n
|
||||
* @param[in] number: number of the incoming call
|
||||
* @param[in] call_addr_type: call address type
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: reject incoming call is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -531,6 +624,9 @@ esp_err_t esp_hf_ag_reject_call(esp_bd_addr_t remote_addr, int num_active, int n
|
||||
*
|
||||
* @brief Initiate a call from AG.
|
||||
* As a precondition to use this API, Service Level Connection shall exist with HFP client.
|
||||
* If the AG is driven by the HF to call esp_hf_ag_out_call, it needs to response an OK or ERROR
|
||||
* to HF. But if the AG is actively calling esp_hf_ag_out_call, it does not need to take a response
|
||||
* to HF.
|
||||
*
|
||||
* @param[in] remote_addr: remote bluetooth device address
|
||||
* @param[in] num_active: the number of active call
|
||||
@@ -540,8 +636,8 @@ esp_err_t esp_hf_ag_reject_call(esp_bd_addr_t remote_addr, int num_active, int n
|
||||
* @param[in] number: number of the outgoing call
|
||||
* @param[in] call_addr_type: call address type
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: a call initiation is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -562,8 +658,8 @@ esp_err_t esp_hf_ag_out_call(esp_bd_addr_t remote_addr, int num_active, int num_
|
||||
* @param[in] number: number of the call
|
||||
* @param[in] call_addr_type: call address type
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: end an ongoing call is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -580,12 +676,28 @@ esp_err_t esp_hf_ag_end_call(esp_bd_addr_t remote_addr, int num_active, int num_
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: if callback is a NULL function pointer
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_hf_ag_register_data_callback(esp_hf_incoming_data_cb_t recv, esp_hf_outgoing_data_cb_t send);
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Get the number of packets received and sent
|
||||
*
|
||||
* This function is only used in the case that Voice Over HCI is enabled and the audio state is connected.
|
||||
* When the operation is completed, the callback function will be called with ESP_HF_PKT_STAT_NUMS_GET_EVT.
|
||||
*
|
||||
* @param[in] sync_conn_handle: the (e)SCO connection handle
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: if the request is sent successfully
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_hf_ag_pkt_stat_nums_get(uint16_t sync_conn_handle);
|
||||
|
||||
/**
|
||||
* @brief Trigger the lower-layer to fetch and send audio data.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -96,6 +96,7 @@ typedef enum {
|
||||
ESP_HF_CLIENT_BSIR_EVT, /*!< setting of in-band ring tone */
|
||||
ESP_HF_CLIENT_BINP_EVT, /*!< requested number of last voice tag from AG */
|
||||
ESP_HF_CLIENT_RING_IND_EVT, /*!< ring indication event */
|
||||
ESP_HF_CLIENT_PKT_STAT_NUMS_GET_EVT, /*!< requested number of packet different status */
|
||||
} esp_hf_client_cb_event_t;
|
||||
|
||||
/// HFP client callback parameters
|
||||
@@ -116,6 +117,7 @@ typedef union {
|
||||
struct hf_client_audio_stat_param {
|
||||
esp_hf_client_audio_state_t state; /*!< audio connection state */
|
||||
esp_bd_addr_t remote_bda; /*!< remote bluetooth device address */
|
||||
uint16_t sync_conn_handle; /*!< (e)SCO connection handle */
|
||||
} audio_stat; /*!< HF callback param of ESP_HF_CLIENT_AUDIO_STATE_EVT */
|
||||
|
||||
/**
|
||||
@@ -251,6 +253,19 @@ typedef union {
|
||||
const char *number; /*!< phone number corresponding to the last voice tag in the HF */
|
||||
} binp; /*!< HF callback param of ESP_HF_CLIENT_BINP_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_HF_CLIENT_PKT_STAT_NUMS_GET_EVT
|
||||
*/
|
||||
struct hf_client_pkt_status_nums {
|
||||
uint32_t rx_total; /*!< the total number of packets received */
|
||||
uint32_t rx_correct; /*!< the total number of packets data correctly received */
|
||||
uint32_t rx_err; /*!< the total number of packets data with possible invalid */
|
||||
uint32_t rx_none; /*!< the total number of packets data no received */
|
||||
uint32_t rx_lost; /*!< the total number of packets data partially lost */
|
||||
uint32_t tx_total; /*!< the total number of packets send */
|
||||
uint32_t tx_discarded; /*!< the total number of packets send lost */
|
||||
} pkt_nums; /*!< HF callback param of ESP_HF_CLIENT_PKT_STAT_NUMS_GET_EVT */
|
||||
|
||||
} esp_hf_client_cb_param_t; /*!< HFP client callback parameters */
|
||||
|
||||
/**
|
||||
@@ -298,7 +313,7 @@ typedef void (* esp_hf_client_cb_t)(esp_hf_client_cb_event_t event, esp_hf_clien
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: if callback is a NULL function pointer
|
||||
*
|
||||
*/
|
||||
@@ -311,7 +326,7 @@ esp_err_t esp_hf_client_register_callback(esp_hf_client_cb_t callback);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: if the initialization request is sent successfully
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -324,7 +339,7 @@ esp_err_t esp_hf_client_init(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -339,7 +354,7 @@ esp_err_t esp_hf_client_deinit(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: connect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -354,7 +369,7 @@ esp_err_t esp_hf_client_connect(esp_bd_addr_t remote_bda);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -367,8 +382,8 @@ esp_err_t esp_hf_client_disconnect(esp_bd_addr_t remote_bda);
|
||||
*
|
||||
* @param[in] remote_bda: remote bluetooth device address
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: connect audio request is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -381,8 +396,8 @@ esp_err_t esp_hf_client_connect_audio(esp_bd_addr_t remote_bda);
|
||||
*
|
||||
* @param[in] remote_bda: remote bluetooth device address
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: disconnect audio request is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -394,8 +409,8 @@ esp_err_t esp_hf_client_disconnect_audio(esp_bd_addr_t remote_bda);
|
||||
* As a precondition to use this API, Service Level Connection shall exist with AG.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: starting voice recognition is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -407,8 +422,8 @@ esp_err_t esp_hf_client_start_voice_recognition(void);
|
||||
* As a precondition to use this API, Service Level Connection shall exist with AG.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: stoping voice recognition is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -423,8 +438,8 @@ esp_err_t esp_hf_client_stop_voice_recognition(void);
|
||||
* @param[in] volume: gain of the speaker of microphone, ranges 0 to 15
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: volume update is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -438,8 +453,8 @@ esp_err_t esp_hf_client_volume_update(esp_hf_volume_control_target_t type, int v
|
||||
* @param[in] number: number string of the call. If NULL, the last number is called(aka re-dial)
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: a call placing is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -453,8 +468,8 @@ esp_err_t esp_hf_client_dial(const char *number);
|
||||
* @param[in] location: location of the number in the memory
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: a memory call placing is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -471,8 +486,8 @@ esp_err_t esp_hf_client_dial_memory(int location);
|
||||
* ESP_HF_CHLD_TYPE_REL_X or ESP_HF_CHLD_TYPE_PRIV_X
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: command AT+CHLD is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -486,8 +501,8 @@ esp_err_t esp_hf_client_send_chld_cmd(esp_hf_chld_type_t chld, int idx);
|
||||
* @param[in] btrh: response and hold action to send
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: command AT+BTRH is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -499,8 +514,8 @@ esp_err_t esp_hf_client_send_btrh_cmd(esp_hf_btrh_cmd_t btrh);
|
||||
* As a precondition to use this API, Service Level Connection shall exist with AG.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: a call answering is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -508,12 +523,12 @@ esp_err_t esp_hf_client_answer_call(void);
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Reject an incoming call(send AT+CHUP command).
|
||||
* @brief Reject an incoming call or terminate an ongoing call(send AT+CHUP command).
|
||||
* As a precondition to use this API, Service Level Connection shall exist with AG.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: the call rejecting is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -525,8 +540,8 @@ esp_err_t esp_hf_client_reject_call(void);
|
||||
* As a precondition to use this API, Service Level Connection shall exist with AG.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: query of current calls is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -538,8 +553,8 @@ esp_err_t esp_hf_client_query_current_calls(void);
|
||||
* As a precondition to use this API, Service Level Connection shall exist with AG.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: query of current operator name is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -551,8 +566,8 @@ esp_err_t esp_hf_client_query_current_operator_name(void);
|
||||
* As a precondition to use this API, Service Level Connection shall exist with AG
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: the retrieving of subscriber information is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -566,8 +581,8 @@ esp_err_t esp_hf_client_retrieve_subscriber_info(void);
|
||||
* @param[in] code: dtmf code, single ascii character in the set 0-9, #, *, A-D
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: the DTMF codes are sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -587,7 +602,7 @@ esp_err_t esp_hf_client_send_dtmf(char code);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: Feature enable request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -605,7 +620,7 @@ esp_err_t esp_hf_client_send_xapl(char *information, uint32_t features);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: battery level is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -617,8 +632,8 @@ esp_err_t esp_hf_client_send_iphoneaccev(uint32_t bat_level, bool docked);
|
||||
* As a precondition to use this API, Service Level Connection shall exist with AG.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: disconnect request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_OK: the phone number request corresponding to last voice tag recorded is sent to lower layer
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -631,7 +646,7 @@ esp_err_t esp_hf_client_request_last_voice_tag_number(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: NREC=0 request is sent to lower layer
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
@@ -648,13 +663,29 @@ esp_err_t esp_hf_client_send_nrec(void);
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: if callback is a NULL function pointer
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_hf_client_register_data_callback(esp_hf_client_incoming_data_cb_t recv,
|
||||
esp_hf_client_outgoing_data_cb_t send);
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Get the number of packets received and sent
|
||||
* This function is only used in the case that Voice Over HCI is enabled and the audio state is connected.
|
||||
* When the operation is completed, the callback function will be called with ESP_HF_CLIENT_PKT_STAT_NUMS_GET_EVT.
|
||||
*
|
||||
* @param[in] sync_conn_handle: the (e)SCO connection handle
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: if the request is sent successfully
|
||||
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
|
||||
* - ESP_FAIL: others
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_hf_client_pkt_stat_nums_get(uint16_t sync_conn_handle);
|
||||
|
||||
/**
|
||||
* @brief Trigger the lower-layer to fetch and send audio data.
|
||||
* This function is only only used in the case that Voice Over HCI is enabled. After this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -51,6 +51,17 @@ typedef enum
|
||||
ESP_HF_NETWORK_STATE_AVAILABLE
|
||||
} esp_hf_network_state_t;
|
||||
|
||||
/// +CIEV report type
|
||||
typedef enum {
|
||||
ESP_HF_IND_TYPE_CALL = 1, /*!< position of call indicator */
|
||||
ESP_HF_IND_TYPE_CALLSETUP, /*!< position of callsetup indicator */
|
||||
ESP_HF_IND_TYPE_SERVICE, /*!< position of service indicator */
|
||||
ESP_HF_IND_TYPE_SIGNAL, /*!< position of signal strength indicator, range: 0-5 */
|
||||
ESP_HF_IND_TYPE_ROAM, /*!< position of roaming indicator */
|
||||
ESP_HF_IND_TYPE_BATTCHG, /*!< position of battery charge indicator, range: 0-5 */
|
||||
ESP_HF_IND_TYPE_CALLHELD /*!< position of callheld indicator */
|
||||
} esp_hf_ciev_report_type_t;
|
||||
|
||||
/** +CIEV Service type */
|
||||
typedef enum
|
||||
{
|
||||
@@ -60,7 +71,7 @@ typedef enum
|
||||
|
||||
/// +CIND call status indicator values
|
||||
typedef enum {
|
||||
ESP_HF_CALL_STATUS_NO_CALLS = 0, /*!< no call in progress */
|
||||
ESP_HF_CALL_STATUS_NO_CALLS = 0, /*!< no call in progress */
|
||||
ESP_HF_CALL_STATUS_CALL_IN_PROGRESS = 1, /*!< call is present(active or held) */
|
||||
} esp_hf_call_status_t;
|
||||
|
||||
@@ -124,7 +135,7 @@ typedef enum {
|
||||
/// +CNUM service type of the phone number
|
||||
typedef enum {
|
||||
ESP_HF_SUBSCRIBER_SERVICE_TYPE_UNKNOWN = 0, /*!< unknown */
|
||||
ESP_HF_SUBSCRIBER_SERVICE_TYPE_VOICE, /*!< voice service */
|
||||
ESP_HF_SUBSCRIBER_SERVICE_TYPE_VOICE = 4, /*!< voice service */
|
||||
ESP_HF_SUBSCRIBER_SERVICE_TYPE_FAX, /*!< fax service */
|
||||
} esp_hf_subscriber_service_type_t;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
@@ -16,6 +16,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/// maximum size of HID Device report descriptor
|
||||
#define BTHH_MAX_DSC_LEN 884
|
||||
|
||||
/**
|
||||
@@ -26,34 +27,33 @@ typedef enum {
|
||||
ESP_HIDH_CONN_STATE_CONNECTING, /*!< connecting state */
|
||||
ESP_HIDH_CONN_STATE_DISCONNECTED, /*!< disconnected state */
|
||||
ESP_HIDH_CONN_STATE_DISCONNECTING, /*!< disconnecting state */
|
||||
ESP_HIDH_CONN_STATE_UNKNOWN /*!< unknown state(initial state) */
|
||||
ESP_HIDH_CONN_STATE_UNKNOWN /*!< unknown state (initial state) */
|
||||
} esp_hidh_connection_state_t;
|
||||
|
||||
/**
|
||||
* @brief HID handshake error code and vendor-defined result code
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_HIDH_OK,
|
||||
ESP_HIDH_HS_HID_NOT_READY, /*!< handshake error : device not ready */
|
||||
ESP_HIDH_HS_INVALID_RPT_ID, /*!< handshake error : invalid report ID */
|
||||
ESP_HIDH_HS_TRANS_NOT_SPT, /*!< handshake error : transaction not spt */
|
||||
ESP_HIDH_HS_INVALID_PARAM, /*!< handshake error : invalid paremeter */
|
||||
ESP_HIDH_HS_ERROR, /*!< handshake error : unspecified HS error */
|
||||
ESP_HIDH_ERR, /*!< general ESP HH error */
|
||||
ESP_HIDH_OK, /*!< successful */
|
||||
ESP_HIDH_HS_HID_NOT_READY, /*!< handshake error: device not ready */
|
||||
ESP_HIDH_HS_INVALID_RPT_ID, /*!< handshake error: invalid report ID */
|
||||
ESP_HIDH_HS_TRANS_NOT_SPT, /*!< handshake error: HID device does not support the request */
|
||||
ESP_HIDH_HS_INVALID_PARAM, /*!< handshake error: parameter value does not meet the expected criteria of called function or API */
|
||||
ESP_HIDH_HS_ERROR, /*!< handshake error: HID device could not identify the error condition */
|
||||
ESP_HIDH_ERR, /*!< general ESP HID Host error */
|
||||
ESP_HIDH_ERR_SDP, /*!< SDP error */
|
||||
ESP_HIDH_ERR_PROTO, /*!< SET_Protocol error,
|
||||
only used in ESP_HIDH_OPEN_EVT callback */
|
||||
|
||||
ESP_HIDH_ERR_DB_FULL, /*!< device database full error, used in
|
||||
ESP_HIDH_OPEN_EVT/ESP_HIDH_ADD_DEV_EVT */
|
||||
ESP_HIDH_ERR_PROTO, /*!< SET_PROTOCOL error, only used in ESP_HIDH_OPEN_EVT callback */
|
||||
ESP_HIDH_ERR_DB_FULL, /*!< device database full, used in ESP_HIDH_OPEN_EVT/ESP_HIDH_ADD_DEV_EVT */
|
||||
ESP_HIDH_ERR_TOD_UNSPT, /*!< type of device not supported */
|
||||
ESP_HIDH_ERR_NO_RES, /*!< out of system resources */
|
||||
ESP_HIDH_ERR_AUTH_FAILED, /*!< authentication fail */
|
||||
ESP_HIDH_ERR_HDL, /*!< connection handle error */
|
||||
ESP_HIDH_ERR_SEC, /*!< encryption error */
|
||||
// self_defined
|
||||
ESP_HIDH_BUSY, /*!< Temporarily can not handle this request. */
|
||||
ESP_HIDH_NO_DATA, /*!< No data. */
|
||||
ESP_HIDH_NEED_INIT, /*!< HIDH module shall init first */
|
||||
ESP_HIDH_NEED_DEINIT, /*!< HIDH module shall deinit first */
|
||||
ESP_HIDH_NO_CONNECTION, /*!< connection may have been closed */
|
||||
ESP_HIDH_BUSY, /*!< vendor-defined: temporarily can not handle this request */
|
||||
ESP_HIDH_NO_DATA, /*!< vendor-defined: no data. */
|
||||
ESP_HIDH_NEED_INIT, /*!< vendor-defined: HIDH module shall initialize first */
|
||||
ESP_HIDH_NEED_DEINIT, /*!< vendor-defined: HIDH module shall de-deinitialize first */
|
||||
ESP_HIDH_NO_CONNECTION, /*!< vendor-defined: connection may have been closed */
|
||||
} esp_hidh_status_t;
|
||||
|
||||
/**
|
||||
@@ -79,35 +79,58 @@ typedef enum {
|
||||
* @brief HID host callback function events
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_HIDH_INIT_EVT = 0, /*!< When HID host is initialized, the event comes */
|
||||
ESP_HIDH_DEINIT_EVT, /*!< When HID host is deinitialized, the event comes */
|
||||
ESP_HIDH_OPEN_EVT, /*!< When HID host connection opened, the event comes */
|
||||
ESP_HIDH_CLOSE_EVT, /*!< When HID host connection closed, the event comes */
|
||||
ESP_HIDH_GET_RPT_EVT, /*!< When Get_Report command is called, the event comes */
|
||||
ESP_HIDH_SET_RPT_EVT, /*!< When Set_Report command is called, the event comes */
|
||||
ESP_HIDH_GET_PROTO_EVT, /*!< When Get_Protocol command is called, the event comes */
|
||||
ESP_HIDH_SET_PROTO_EVT, /*!< When Set_Protocol command is called, the event comes */
|
||||
ESP_HIDH_GET_IDLE_EVT, /*!< When Get_Idle command is called, the event comes */
|
||||
ESP_HIDH_SET_IDLE_EVT, /*!< When Set_Idle command is called, the event comes */
|
||||
ESP_HIDH_GET_DSCP_EVT, /*!< When HIDH is initialized, the event comes */
|
||||
ESP_HIDH_ADD_DEV_EVT, /*!< When a device is added, the event comes */
|
||||
ESP_HIDH_RMV_DEV_EVT, /*!< When a device is removed, the event comes */
|
||||
ESP_HIDH_VC_UNPLUG_EVT, /*!< When virtually unplugged, the event comes */
|
||||
ESP_HIDH_DATA_EVT, /*!< When send data on interrupt channel, the event comes */
|
||||
ESP_HIDH_DATA_IND_EVT, /*!< When receive data on interrupt channel, the event comes */
|
||||
ESP_HIDH_SET_INFO_EVT /*!< When set the HID device descriptor, the event comes */
|
||||
ESP_HIDH_INIT_EVT = 0, /*!< when HID host is initialized, the event comes */
|
||||
ESP_HIDH_DEINIT_EVT, /*!< when HID host is deinitialized, the event comes */
|
||||
ESP_HIDH_OPEN_EVT, /*!< when HID host connection opened, the event comes */
|
||||
ESP_HIDH_CLOSE_EVT, /*!< when HID host connection closed, the event comes */
|
||||
ESP_HIDH_GET_RPT_EVT, /*!< when Get_Report command is called, the event comes */
|
||||
ESP_HIDH_SET_RPT_EVT, /*!< when Set_Report command is called, the event comes */
|
||||
ESP_HIDH_GET_PROTO_EVT, /*!< when Get_Protocol command is called, the event comes */
|
||||
ESP_HIDH_SET_PROTO_EVT, /*!< when Set_Protocol command is called, the event comes */
|
||||
ESP_HIDH_GET_IDLE_EVT, /*!< when Get_Idle command is called, the event comes */
|
||||
ESP_HIDH_SET_IDLE_EVT, /*!< when Set_Idle command is called, the event comes */
|
||||
ESP_HIDH_GET_DSCP_EVT, /*!< when HIDH is initialized, the event comes */
|
||||
ESP_HIDH_ADD_DEV_EVT, /*!< when a device is added, the event comes */
|
||||
ESP_HIDH_RMV_DEV_EVT, /*!< when a device is removed, the event comes */
|
||||
ESP_HIDH_VC_UNPLUG_EVT, /*!< when virtually unplugged, the event comes */
|
||||
ESP_HIDH_DATA_EVT, /*!< when send data on interrupt channel, the event comes */
|
||||
ESP_HIDH_DATA_IND_EVT, /*!< when receive data on interrupt channel, the event comes */
|
||||
ESP_HIDH_SET_INFO_EVT /*!< when set the HID device descriptor, the event comes */
|
||||
} esp_hidh_cb_event_t;
|
||||
|
||||
/**
|
||||
* @brief HID device information from HID Device Service Record and Device ID Service Record
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_HIDH_DEV_ATTR_VIRTUAL_CABLE = 0x0001, /*!< whether Virtual Cables is supported */
|
||||
ESP_HIDH_DEV_ATTR_NORMALLY_CONNECTABLE = 0x0002, /*!< whether device is in Page Scan mode when there is no active connection */
|
||||
ESP_HIDH_DEV_ATTR_RECONNECT_INITIATE = 0x0004, /*!< whether the HID device inititates the reconnection process */
|
||||
} esp_hidh_dev_attr_t;
|
||||
|
||||
/**
|
||||
* @brief application ID(non-zero) for each type of device
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_HIDH_APP_ID_MOUSE = 1, /*!< pointing device */
|
||||
ESP_HIDH_APP_ID_KEYBOARD = 2, /*!< keyboard */
|
||||
ESP_HIDH_APP_ID_REMOTE_CONTROL = 3, /*!< remote control */
|
||||
ESP_HIDH_APP_ID_JOYSTICK = 5, /*!< joystick */
|
||||
ESP_HIDH_APP_ID_GAMEPAD = 6, /*!< gamepad*/
|
||||
} esp_hidh_dev_app_id_t;
|
||||
|
||||
/**
|
||||
* @brief HID device information from HID Device Service Record and Device ID Service Record
|
||||
*/
|
||||
typedef struct {
|
||||
int attr_mask;
|
||||
uint8_t sub_class;
|
||||
uint8_t app_id;
|
||||
int vendor_id;
|
||||
int product_id;
|
||||
int version;
|
||||
uint8_t ctry_code;
|
||||
int dl_len;
|
||||
uint8_t dsc_list[BTHH_MAX_DSC_LEN];
|
||||
int attr_mask; /*!< device attribute bit mask, refer to esp_hidh_dev_attr_t */
|
||||
uint8_t sub_class; /*!< HID device subclass */
|
||||
uint8_t app_id; /*!< application ID, refer to esp_hidh_dev_app_id_t */
|
||||
int vendor_id; /*!< Device ID information: vendor ID */
|
||||
int product_id; /*!< Device ID information: product ID */
|
||||
int version; /*!< Device ID information: version */
|
||||
uint8_t ctry_code; /*!< SDP attrbutes of HID devices: HID country code (https://www.usb.org/sites/default/files/hid1_11.pdf) */
|
||||
int dl_len; /*!< SDP attrbutes of HID devices: HID device descriptor length */
|
||||
uint8_t dsc_list[BTHH_MAX_DSC_LEN]; /*!< SDP attrbutes of HID devices: HID device descriptor definition */
|
||||
} esp_hidh_hid_info_t;
|
||||
|
||||
/**
|
||||
@@ -258,8 +281,8 @@ typedef union {
|
||||
uint16_t vendor_id; /*!< Vendor ID */
|
||||
uint16_t product_id; /*!< Product ID */
|
||||
uint16_t version; /*!< Version */
|
||||
uint16_t ssr_max_latency; /*!< SSR max latency */
|
||||
uint16_t ssr_min_tout; /*!< SSR min timeout */
|
||||
uint16_t ssr_max_latency; /*!< SSR max latency in slots */
|
||||
uint16_t ssr_min_tout; /*!< SSR min timeout in slots */
|
||||
uint8_t ctry_code; /*!< Country Code */
|
||||
uint16_t dl_len; /*!< Device descriptor length */
|
||||
uint8_t *dsc_list; /*!< Device descriptor pointer */
|
||||
@@ -315,7 +338,7 @@ esp_err_t esp_bt_hid_host_init(void);
|
||||
esp_err_t esp_bt_hid_host_deinit(void);
|
||||
|
||||
/**
|
||||
* @brief Connect to hid device. When the operation is complete the callback
|
||||
* @brief Connect to HID device. When the operation is complete the callback
|
||||
* function will be called with ESP_HIDH_OPEN_EVT.
|
||||
*
|
||||
* @param[in] bd_addr: Remote device bluetooth device address.
|
||||
@@ -326,7 +349,7 @@ esp_err_t esp_bt_hid_host_deinit(void);
|
||||
esp_err_t esp_bt_hid_host_connect(esp_bd_addr_t bd_addr);
|
||||
|
||||
/**
|
||||
* @brief Disconnect from hid device. When the operation is complete the callback
|
||||
* @brief Disconnect from HID device. When the operation is complete the callback
|
||||
* function will be called with ESP_HIDH_CLOSE_EVT.
|
||||
*
|
||||
* @param[in] bd_addr: Remote device bluetooth device address.
|
||||
|
||||
@@ -232,7 +232,7 @@ void bta_ar_dereg_avct(tBTA_SYS_ID sys_id)
|
||||
**
|
||||
******************************************************************************/
|
||||
void bta_ar_reg_avrc(UINT16 service_uuid, char *service_name, char *provider_name,
|
||||
UINT16 categories, tBTA_SYS_ID sys_id)
|
||||
UINT16 categories, tBTA_SYS_ID sys_id, BOOLEAN browsing_en)
|
||||
{
|
||||
UINT8 mask = bta_ar_id (sys_id);
|
||||
UINT8 temp[8], *p;
|
||||
@@ -245,7 +245,7 @@ void bta_ar_reg_avrc(UINT16 service_uuid, char *service_name, char *provider_nam
|
||||
if (bta_ar_cb.sdp_tg_handle == 0) {
|
||||
bta_ar_cb.tg_registered = mask;
|
||||
bta_ar_cb.sdp_tg_handle = SDP_CreateRecord();
|
||||
AVRC_AddRecord(service_uuid, service_name, provider_name, categories, bta_ar_cb.sdp_tg_handle);
|
||||
AVRC_AddRecord(service_uuid, service_name, provider_name, categories, bta_ar_cb.sdp_tg_handle, browsing_en);
|
||||
bta_sys_add_uuid(service_uuid);
|
||||
}
|
||||
/* only one TG is allowed (first-come, first-served).
|
||||
@@ -255,7 +255,7 @@ void bta_ar_reg_avrc(UINT16 service_uuid, char *service_name, char *provider_nam
|
||||
categories = bta_ar_cb.ct_categories[0] | bta_ar_cb.ct_categories[1];
|
||||
if (bta_ar_cb.sdp_ct_handle == 0) {
|
||||
bta_ar_cb.sdp_ct_handle = SDP_CreateRecord();
|
||||
AVRC_AddRecord(service_uuid, service_name, provider_name, categories, bta_ar_cb.sdp_ct_handle);
|
||||
AVRC_AddRecord(service_uuid, service_name, provider_name, categories, bta_ar_cb.sdp_ct_handle, browsing_en);
|
||||
bta_sys_add_uuid(service_uuid);
|
||||
} else {
|
||||
/* multiple CTs are allowed.
|
||||
|
||||
@@ -62,6 +62,11 @@
|
||||
#define BTA_AV_RECONFIG_RETRY 6
|
||||
#endif
|
||||
|
||||
/* avdt_handle to send abort command for AVDTP BQB test */
|
||||
#if A2D_SRC_BQB_INCLUDED
|
||||
static uint8_t s_avdt_bqb_handle;
|
||||
#endif /* CONFIG_BT_BQB_ENABLED */
|
||||
|
||||
static void bta_av_st_rc_timer(tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data);
|
||||
|
||||
/* state machine states */
|
||||
@@ -733,8 +738,7 @@ static void bta_av_adjust_seps_idx(tBTA_AV_SCB *p_scb, UINT8 avdt_handle)
|
||||
for (xx = 0; xx < BTA_AV_MAX_SEPS; xx++) {
|
||||
APPL_TRACE_DEBUG("av_handle: %d codec_type: %d",
|
||||
p_scb->seps[xx].av_handle, p_scb->seps[xx].codec_type);
|
||||
if ((p_scb->seps[xx].av_handle && p_scb->codec_type == p_scb->seps[xx].codec_type)
|
||||
&& (p_scb->seps[xx].av_handle == avdt_handle)) {
|
||||
if ((p_scb->seps[xx].av_handle) && (p_scb->seps[xx].av_handle == avdt_handle)) {
|
||||
p_scb->sep_idx = xx;
|
||||
p_scb->avdt_handle = p_scb->seps[xx].av_handle;
|
||||
break;
|
||||
@@ -1027,6 +1031,7 @@ void bta_av_cleanup(tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
|
||||
p_scb->wait = 0;
|
||||
p_scb->num_disc_snks = 0;
|
||||
p_scb->disc_rsn = 0;
|
||||
p_scb->avdt_handle = 0;
|
||||
bta_sys_stop_timer(&p_scb->timer);
|
||||
if (p_scb->deregistring) {
|
||||
/* remove stream */
|
||||
@@ -1415,6 +1420,10 @@ void bta_av_str_opened (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
|
||||
}
|
||||
}
|
||||
|
||||
#if A2D_SRC_BQB_INCLUDED
|
||||
s_avdt_bqb_handle = p_scb->avdt_handle;
|
||||
#endif /* A2D_SRC_BQB_INCLUDED */
|
||||
|
||||
#if 0 /* TODO: implement the property enable/disable */
|
||||
// This code is used to pass PTS TC for AVDTP ABORT
|
||||
char value[PROPERTY_VALUE_MAX] = {0};
|
||||
@@ -1426,6 +1435,22 @@ void bta_av_str_opened (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
|
||||
#endif /* #if 0*/
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function avdt_bqb_abort
|
||||
**
|
||||
** Description Send AVDT abort request for BQB test
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
#if A2D_SRC_BQB_INCLUDED
|
||||
void avdt_bqb_abort(void)
|
||||
{
|
||||
AVDT_AbortReq(s_avdt_bqb_handle);
|
||||
}
|
||||
#endif /* A2D_SRC_BQB_INCLUDED */
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_av_security_ind
|
||||
|
||||
@@ -1861,8 +1861,8 @@ void bta_av_dereg_comp(tBTA_AV_DATA *p_data)
|
||||
bta_sys_remove_uuid(UUID_SERVCLASS_VIDEO_SOURCE);
|
||||
}
|
||||
|
||||
/* make sure that the timer is not active */
|
||||
bta_sys_stop_timer(&p_scb->timer);
|
||||
/* free the delay timer for AVRC CT */
|
||||
bta_sys_free_timer(&p_scb->timer);
|
||||
list_free(p_scb->a2d_list);
|
||||
p_scb->a2d_list = NULL;
|
||||
utl_freebuf((void **)&p_cb->p_scb[p_scb->hdi]);
|
||||
|
||||
@@ -94,7 +94,8 @@ const tBTA_AV_CFG bta_av_cfg = {
|
||||
6, /* AVDTP audio channel max data queue size */
|
||||
BTA_AV_MAX_VDP_MTU, /* AVDTP video transport channel MTU at L2CAP */
|
||||
600, /* AVDTP video transport channel flush timeout */
|
||||
FALSE, /* TRUE, to accept AVRC 1.3 group nevigation command */
|
||||
FALSE, /* TRUE, to accept AVRC 1.3 group nevigation command */
|
||||
FALSE, /* FALSE, does not support browsing channel */
|
||||
2, /* company id count in p_meta_co_ids */
|
||||
BTA_AV_RC_PASS_RSP_CODE,/* the default response code for pass through commands */
|
||||
bta_av_meta_caps_co_ids,/* the metadata Get Capabilities response for company id */
|
||||
|
||||
@@ -585,10 +585,10 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data)
|
||||
(UINT8)(bta_av_cb.sec_mask & (~BTA_SEC_AUTHORIZE)), BTA_ID_AV);
|
||||
if (p_data->api_reg.tsep == AVDT_TSEP_SRC) {
|
||||
bta_ar_reg_avrc(UUID_SERVCLASS_AV_REM_CTRL_TARGET, "AV Remote Control Target\n", NULL,
|
||||
p_bta_av_cfg->avrc_src_tg_cat, BTA_ID_AV);
|
||||
p_bta_av_cfg->avrc_src_tg_cat, BTA_ID_AV, p_bta_av_cfg->avrc_br);
|
||||
} else {
|
||||
bta_ar_reg_avrc(UUID_SERVCLASS_AV_REM_CTRL_TARGET, "AV Remote Control Target\n", NULL,
|
||||
p_bta_av_cfg->avrc_snk_tg_cat, BTA_ID_AV);
|
||||
p_bta_av_cfg->avrc_snk_tg_cat, BTA_ID_AV, p_bta_av_cfg->avrc_br);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -721,10 +721,10 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data)
|
||||
/* create an SDP record as AVRC CT. */
|
||||
if (p_data->api_reg.tsep == AVDT_TSEP_SRC) {
|
||||
bta_ar_reg_avrc(UUID_SERVCLASS_AV_REMOTE_CONTROL, "AV Remote Control Controller\n", NULL,
|
||||
p_bta_av_cfg->avrc_src_ct_cat, BTA_ID_AV);
|
||||
p_bta_av_cfg->avrc_src_ct_cat, BTA_ID_AV, p_bta_av_cfg->avrc_br);
|
||||
} else {
|
||||
bta_ar_reg_avrc(UUID_SERVCLASS_AV_REMOTE_CONTROL, "AV Remote Control Controller\n", NULL,
|
||||
p_bta_av_cfg->avrc_snk_ct_cat, BTA_ID_AV);
|
||||
p_bta_av_cfg->avrc_snk_ct_cat, BTA_ID_AV, p_bta_av_cfg->avrc_br);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1251,9 +1251,11 @@ BOOLEAN bta_av_hdl_event(BT_HDR *p_msg)
|
||||
} else {
|
||||
APPL_TRACE_VERBOSE("handle=0x%x\n", p_msg->layer_specific);
|
||||
tBTA_AV_SCB *p_scb = bta_av_hndl_to_scb(p_msg->layer_specific);
|
||||
p_scb->disc_rsn = p_msg->offset;
|
||||
/* stream state machine events */
|
||||
bta_av_ssm_execute(p_scb, p_msg->event, (tBTA_AV_DATA *) p_msg);
|
||||
if (p_scb) {
|
||||
p_scb->disc_rsn = p_msg->offset;
|
||||
/* stream state machine events */
|
||||
bta_av_ssm_execute(p_scb, p_msg->event, (tBTA_AV_DATA *) p_msg);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -788,6 +788,7 @@ void bta_dm_config_eir (tBTA_DM_MSG *p_data)
|
||||
tBTA_DM_API_CONFIG_EIR *config_eir = &p_data->config_eir;
|
||||
|
||||
p_bta_dm_eir_cfg->bta_dm_eir_fec_required = config_eir->eir_fec_required;
|
||||
p_bta_dm_eir_cfg->bta_dm_eir_included_name = config_eir->eir_included_name;
|
||||
p_bta_dm_eir_cfg->bta_dm_eir_included_uuid = config_eir->eir_included_uuid;
|
||||
p_bta_dm_eir_cfg->bta_dm_eir_included_tx_power = config_eir->eir_included_tx_power;
|
||||
p_bta_dm_eir_cfg->bta_dm_eir_flags = config_eir->eir_flags;
|
||||
@@ -982,10 +983,6 @@ static void bta_dm_process_remove_device(BD_ADDR bd_addr, tBT_TRANSPORT transpor
|
||||
|
||||
BTM_SecDeleteDevice(bd_addr, transport);
|
||||
|
||||
#if (BLE_INCLUDED == TRUE && GATTC_INCLUDED == TRUE)
|
||||
/* remove all cached GATT information */
|
||||
BTA_GATTC_Refresh(bd_addr, false);
|
||||
#endif
|
||||
if (bta_dm_cb.p_sec_cback) {
|
||||
tBTA_DM_SEC sec_event;
|
||||
bdcpy(sec_event.link_down.bd_addr, bd_addr);
|
||||
@@ -1140,8 +1137,6 @@ void bta_dm_close_acl(tBTA_DM_MSG *p_data)
|
||||
#if (BLE_INCLUDED == TRUE && GATTC_INCLUDED == TRUE)
|
||||
/* need to remove all pending background connection if any */
|
||||
BTA_GATTC_CancelOpen(0, p_remove_acl->bd_addr, FALSE);
|
||||
/* remove all cached GATT information */
|
||||
BTA_GATTC_Refresh(p_remove_acl->bd_addr, false);
|
||||
#endif
|
||||
}
|
||||
/* otherwise, no action needed */
|
||||
@@ -1448,6 +1443,40 @@ void bta_dm_oob_reply(tBTA_DM_MSG *p_data)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_sc_oob_reply
|
||||
**
|
||||
** Description This function is called to provide the OOB data for
|
||||
** SMP in response to BLE secure connection OOB request.
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_dm_sc_oob_reply(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
#if (BLE_INCLUDED)
|
||||
BTM_BleSecureConnectionOobDataReply(p_data->sc_oob_reply.bd_addr, p_data->sc_oob_reply.c, p_data->sc_oob_reply.r);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_sc_create_oob_data
|
||||
**
|
||||
** Description This function is called to create the OOB data for
|
||||
** SMP when secure connection.
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_dm_sc_create_oob_data(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
#if (BLE_INCLUDED)
|
||||
BTM_BleSecureConnectionCreateOobData();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_ci_io_req_act
|
||||
@@ -3636,8 +3665,6 @@ void bta_dm_acl_change(tBTA_DM_MSG *p_data)
|
||||
#if (BLE_INCLUDED == TRUE && GATTC_INCLUDED == TRUE)
|
||||
/* need to remove all pending background connection */
|
||||
BTA_GATTC_CancelOpen(0, p_bda, FALSE);
|
||||
/* remove all cached GATT information */
|
||||
BTA_GATTC_Refresh(p_bda, false);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -3815,8 +3842,6 @@ static BOOLEAN bta_dm_remove_sec_dev_entry(BD_ADDR remote_bd_addr)
|
||||
#if (BLE_INCLUDED == TRUE && GATTC_INCLUDED == TRUE)
|
||||
/* need to remove all pending background connection */
|
||||
BTA_GATTC_CancelOpen(0, remote_bd_addr, FALSE);
|
||||
/* remove all cached GATT information */
|
||||
BTA_GATTC_Refresh(remote_bd_addr, false);
|
||||
#endif
|
||||
}
|
||||
return is_device_deleted;
|
||||
@@ -4015,15 +4040,20 @@ static void bta_dm_set_eir (char *local_name)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* if local name is not provided, get it from controller */
|
||||
if ( local_name == NULL ) {
|
||||
if ( BTM_ReadLocalDeviceName( &local_name ) != BTM_SUCCESS ) {
|
||||
APPL_TRACE_ERROR("Fail to read local device name for EIR");
|
||||
}
|
||||
}
|
||||
#endif // BTA_EIR_CANNED_UUID_LIST
|
||||
|
||||
if (p_bta_dm_eir_cfg->bta_dm_eir_included_name) {
|
||||
/* if local name is not provided, get it from controller */
|
||||
if ( local_name == NULL ) {
|
||||
if ( BTM_ReadLocalDeviceName( &local_name ) != BTM_SUCCESS ) {
|
||||
APPL_TRACE_ERROR("Fail to read local device name for EIR");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
local_name = NULL;
|
||||
}
|
||||
|
||||
|
||||
/* Allocate a buffer to hold HCI command */
|
||||
if ((p_buf = (BT_HDR *)osi_malloc(BTM_CMD_BUF_SIZE)) == NULL) {
|
||||
APPL_TRACE_ERROR("bta_dm_set_eir couldn't allocate buffer");
|
||||
@@ -4068,15 +4098,16 @@ static void bta_dm_set_eir (char *local_name)
|
||||
}
|
||||
}
|
||||
|
||||
UINT8_TO_STREAM(p, local_name_len + 1);
|
||||
UINT8_TO_STREAM(p, data_type);
|
||||
eir_type[eir_type_num++] = data_type;
|
||||
|
||||
|
||||
if (local_name != NULL) {
|
||||
UINT8_TO_STREAM(p, local_name_len + 1);
|
||||
UINT8_TO_STREAM(p, data_type);
|
||||
eir_type[eir_type_num++] = data_type;
|
||||
memcpy(p, local_name, local_name_len);
|
||||
p += local_name_len;
|
||||
free_eir_length -= local_name_len + 2;
|
||||
}
|
||||
free_eir_length -= local_name_len + 2;
|
||||
|
||||
/* if UUIDs are provided in configuration */
|
||||
if (p_bta_dm_eir_cfg->bta_dm_eir_included_uuid) {
|
||||
@@ -4187,7 +4218,7 @@ static void bta_dm_set_eir (char *local_name)
|
||||
for (custom_uuid_idx = 0; custom_uuid_idx < BTA_EIR_SERVER_NUM_CUSTOM_UUID; custom_uuid_idx++) {
|
||||
if (bta_dm_cb.custom_uuid[custom_uuid_idx].len == LEN_UUID_128) {
|
||||
if ( num_uuid < max_num_uuid ) {
|
||||
ARRAY16_TO_STREAM(p, bta_dm_cb.custom_uuid[custom_uuid_idx].uu.uuid128);
|
||||
ARRAY_TO_STREAM(p, bta_dm_cb.custom_uuid[custom_uuid_idx].uu.uuid128, LEN_UUID_128);
|
||||
num_uuid++;
|
||||
} else {
|
||||
data_type = BTM_EIR_MORE_128BITS_UUID_TYPE;
|
||||
@@ -4275,13 +4306,24 @@ static void bta_dm_set_eir (char *local_name)
|
||||
}
|
||||
}
|
||||
|
||||
if ( free_eir_length ) {
|
||||
/* If there is no other data to be sent in the EIR packet, the Host shall
|
||||
* send a name tag with zero length and the type field set to indicate
|
||||
* that this is the complete name (i.e., total of 2 octets with length =
|
||||
* 1).
|
||||
*/
|
||||
if (eir_type_num == 0) {
|
||||
UINT8_TO_STREAM(p, 1);
|
||||
UINT8_TO_STREAM(p, BTM_EIR_COMPLETE_LOCAL_NAME_TYPE);
|
||||
free_eir_length -= 2;
|
||||
}
|
||||
|
||||
if (free_eir_length) {
|
||||
UINT8_TO_STREAM(p, 0); /* terminator of significant part */
|
||||
}
|
||||
|
||||
tBTM_STATUS btm_status = BTM_WriteEIR( p_buf, p_bta_dm_eir_cfg->bta_dm_eir_fec_required );
|
||||
|
||||
if ( btm_status == BTM_MODE_UNSUPPORTED) {
|
||||
if (btm_status == BTM_MODE_UNSUPPORTED) {
|
||||
status = BTA_WRONG_MODE;
|
||||
} else if (btm_status != BTM_SUCCESS) {
|
||||
status = BTA_FAILURE;
|
||||
@@ -4373,21 +4415,38 @@ static void bta_dm_eir_search_services( tBTM_INQ_RESULTS *p_result,
|
||||
** Returns None
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_dm_eir_update_uuid(UINT16 uuid16, BOOLEAN adding)
|
||||
void bta_dm_eir_update_uuid(tBT_UUID uuid, BOOLEAN adding)
|
||||
{
|
||||
/* if this UUID is not advertised in EIR */
|
||||
if ( !BTM_HasEirService( p_bta_dm_eir_cfg->uuid_mask, uuid16 )) {
|
||||
return;
|
||||
}
|
||||
/* 32 and 128-bit UUIDs go to the bta_dm_cb.custom_uuid array */
|
||||
if ((uuid.len == LEN_UUID_32) || (uuid.len == LEN_UUID_128)) {
|
||||
if (adding) {
|
||||
if (BTM_HasCustomEirService(bta_dm_cb.custom_uuid, uuid)) {
|
||||
APPL_TRACE_EVENT("UUID is already added for EIR");
|
||||
return;
|
||||
}
|
||||
APPL_TRACE_EVENT("Adding %d-bit UUID into EIR", uuid.len * 8);
|
||||
|
||||
if ( adding ) {
|
||||
APPL_TRACE_EVENT("Adding UUID=0x%04X into EIR", uuid16);
|
||||
BTM_AddCustomEirService(bta_dm_cb.custom_uuid, uuid);
|
||||
} else {
|
||||
APPL_TRACE_EVENT("Removing %d-bit UUID from EIR", uuid.len * 8);
|
||||
|
||||
BTM_AddEirService( bta_dm_cb.eir_uuid, uuid16 );
|
||||
BTM_RemoveCustomEirService(bta_dm_cb.custom_uuid, uuid);
|
||||
}
|
||||
} else {
|
||||
APPL_TRACE_EVENT("Removing UUID=0x%04X from EIR", uuid16);
|
||||
/* if this UUID is not advertised in EIR */
|
||||
if (!BTM_HasEirService(p_bta_dm_eir_cfg->uuid_mask, uuid.uu.uuid16)) {
|
||||
return;
|
||||
}
|
||||
|
||||
BTM_RemoveEirService( bta_dm_cb.eir_uuid, uuid16 );
|
||||
if (adding) {
|
||||
APPL_TRACE_EVENT("Adding UUID=0x%04X into EIR", uuid.uu.uuid16);
|
||||
|
||||
BTM_AddEirService(bta_dm_cb.eir_uuid, uuid.uu.uuid16);
|
||||
} else {
|
||||
APPL_TRACE_EVENT("Removing UUID=0x%04X from EIR", uuid.uu.uuid16);
|
||||
|
||||
BTM_RemoveEirService(bta_dm_cb.eir_uuid, uuid.uu.uuid16);
|
||||
}
|
||||
}
|
||||
#if CLASSIC_BT_INCLUDED
|
||||
bta_dm_set_eir (NULL);
|
||||
@@ -4732,6 +4791,17 @@ static UINT8 bta_dm_ble_smp_cback (tBTM_LE_EVT event, BD_ADDR bda, tBTM_LE_EVT_D
|
||||
bta_dm_cb.p_sec_cback(BTA_DM_BLE_OOB_REQ_EVT, &sec_event);
|
||||
break;
|
||||
|
||||
case BTM_LE_SC_OOB_REQ_EVT:
|
||||
bdcpy(sec_event.ble_req.bd_addr, bda);
|
||||
bta_dm_cb.p_sec_cback(BTA_DM_BLE_SC_OOB_REQ_EVT, &sec_event);
|
||||
break;
|
||||
|
||||
case BTM_LE_SC_LOC_OOB_EVT:
|
||||
memcpy(sec_event.local_oob_data.local_oob_c, p_data->local_oob_data.commitment, BT_OCTET16_LEN);
|
||||
memcpy(sec_event.local_oob_data.local_oob_r, p_data->local_oob_data.randomizer, BT_OCTET16_LEN);
|
||||
bta_dm_cb.p_sec_cback(BTA_DM_BLE_SC_CR_LOC_OOB_EVT, &sec_event);
|
||||
break;
|
||||
|
||||
case BTM_LE_NC_REQ_EVT:
|
||||
bdcpy(sec_event.key_notif.bd_addr, bda);
|
||||
BCM_STRNCPY_S((char *)sec_event.key_notif.bd_name,bta_dm_get_remname(), BD_NAME_LEN);
|
||||
@@ -5057,7 +5127,7 @@ void bta_dm_ble_update_conn_params (tBTA_DM_MSG *p_data)
|
||||
*******************************************************************************/
|
||||
void bta_dm_ble_disconnect (tBTA_DM_MSG *p_data)
|
||||
{
|
||||
L2CA_RemoveFixedChnl(L2CAP_ATT_CID, p_data->ble_disconnect.remote_bda);
|
||||
L2CA_BleDisconnect(p_data->ble_disconnect.remote_bda);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -5598,6 +5668,16 @@ void btm_dm_ble_multi_adv_disable(tBTA_DM_MSG *p_data)
|
||||
p_data->ble_multi_adv_disable.inst_id, p_ref, BTA_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_clear_adv(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
if (BTM_BleClearAdv(p_data->ble_clear_adv.p_clear_adv_cback) == FALSE) {
|
||||
if (p_data->ble_clear_adv.p_clear_adv_cback) {
|
||||
(*p_data->ble_clear_adv.p_clear_adv_cback)(BTA_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
void bta_dm_ble_gap_read_phy(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
@@ -5679,7 +5759,8 @@ void bta_dm_ble_gap_periodic_adv_cfg_data_raw(tBTA_DM_MSG *p_data)
|
||||
|
||||
BTM_BlePeriodicAdvCfgDataRaw(p_data->ble_cfg_periodic_adv_data.instance,
|
||||
p_data->ble_cfg_periodic_adv_data.length,
|
||||
p_data->ble_cfg_periodic_adv_data.data);
|
||||
p_data->ble_cfg_periodic_adv_data.data,
|
||||
p_data->ble_cfg_periodic_adv_data.only_update_did);
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_periodic_adv_enable(tBTA_DM_MSG *p_data)
|
||||
@@ -5778,6 +5859,37 @@ void bta_dm_ble_gap_set_prefer_ext_conn_params(tBTA_DM_MSG *p_data)
|
||||
}
|
||||
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
void bta_dm_ble_gap_periodic_adv_recv_enable(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BlePeriodicAdvRecvEnable(p_data->ble_periodic_adv_recv_enable.sync_handle,
|
||||
p_data->ble_periodic_adv_recv_enable.enable);
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_periodic_adv_sync_trans(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BlePeriodicAdvSyncTrans(p_data->ble_periodic_adv_sync_trans.addr,
|
||||
p_data->ble_periodic_adv_sync_trans.service_data,
|
||||
p_data->ble_periodic_adv_sync_trans.sync_handle);
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_periodic_adv_set_info_trans(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BlePeriodicAdvSetInfoTrans(p_data->ble_periodic_adv_set_info_trans.addr,
|
||||
p_data->ble_periodic_adv_set_info_trans.service_data,
|
||||
p_data->ble_periodic_adv_set_info_trans.adv_hanlde);
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_set_periodic_adv_sync_trans_params(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BleSetPeriodicAdvSyncTransParams(p_data->ble_set_past_params.addr,
|
||||
p_data->ble_set_past_params.params.mode,
|
||||
p_data->ble_set_past_params.params.skip,
|
||||
p_data->ble_set_past_params.params.sync_timeout,
|
||||
p_data->ble_set_past_params.params.cte_type);
|
||||
}
|
||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_ble_setup_storage
|
||||
|
||||
@@ -226,6 +226,7 @@ void BTA_DmConfigEir(tBTA_DM_EIR_CONF *eir_config)
|
||||
p_msg->hdr.event = BTA_DM_API_CONFIG_EIR_EVT;
|
||||
|
||||
p_msg->eir_fec_required = eir_config->bta_dm_eir_fec_required;
|
||||
p_msg->eir_included_name = eir_config->bta_dm_eir_included_name;
|
||||
p_msg->eir_included_tx_power = eir_config->bta_dm_eir_included_tx_power;
|
||||
p_msg->eir_included_uuid = eir_config->bta_dm_eir_included_uuid;
|
||||
p_msg->eir_flags = eir_config->bta_dm_eir_flags;
|
||||
@@ -671,7 +672,7 @@ void BTA_DmLocalOob(void)
|
||||
** Function BTA_DmOobReply
|
||||
**
|
||||
** This function is called to provide the OOB data for
|
||||
** SMP in response to BTM_LE_OOB_REQ_EVT
|
||||
** SMP in response to BTA_LE_OOB_REQ_EVT
|
||||
**
|
||||
** Parameters: bd_addr - Address of the peer device
|
||||
** len - length of simple pairing Randomizer C
|
||||
@@ -696,6 +697,55 @@ void BTA_DmOobReply(BD_ADDR bd_addr, UINT8 len, UINT8 *p_value)
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmSecureConnectionOobReply
|
||||
**
|
||||
** This function is called to provide the OOB data for
|
||||
** SMP in response to BTA_LE_OOB_REQ_EVT
|
||||
**
|
||||
** Parameters: bd_addr - Address of the peer device
|
||||
** p_c - Pointer to Confirmation
|
||||
** p_r - Pointer to Randomizer
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_DmSecureConnectionOobReply(BD_ADDR bd_addr, UINT8 *p_c, UINT8 *p_r)
|
||||
{
|
||||
tBTA_DM_API_SC_OOB_REPLY *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_SC_OOB_REPLY *) osi_malloc(sizeof(tBTA_DM_API_OOB_REPLY))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_SC_OOB_REPLY_EVT;
|
||||
if((p_c == NULL) || (p_r == NULL)) {
|
||||
return;
|
||||
}
|
||||
memcpy(p_msg->bd_addr, bd_addr, BD_ADDR_LEN);
|
||||
memcpy(p_msg->c, p_c, BT_OCTET16_LEN);
|
||||
memcpy(p_msg->r, p_r, BT_OCTET16_LEN);
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmSecureConnectionCreateOobData
|
||||
**
|
||||
** This function is called to create the OOB data for
|
||||
** SMP when secure connection
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_DmSecureConnectionCreateOobData(void)
|
||||
{
|
||||
tBTA_DM_API_SC_CR_OOB_DATA *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_SC_CR_OOB_DATA *) osi_malloc(sizeof(tBTA_DM_API_SC_CR_OOB_DATA))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_SC_CR_OOB_DATA_EVT;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
#endif /* BTM_OOB_INCLUDED */
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -1695,6 +1745,29 @@ extern void BTA_DmBleBroadcast (BOOLEAN start, tBTA_START_STOP_ADV_CMPL_CBACK *p
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleClearAdv
|
||||
**
|
||||
** Description This function is called to clear Advertising
|
||||
**
|
||||
** Parameters p_adv_data_cback : clear adv complete callback.
|
||||
**
|
||||
** Returns None
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_DmBleClearAdv (tBTA_CLEAR_ADV_CMPL_CBACK *p_clear_adv_cback)
|
||||
{
|
||||
tBTA_DM_API_CLEAR_ADV *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_CLEAR_ADV *)
|
||||
osi_malloc(sizeof(tBTA_DM_API_CLEAR_ADV))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_CLEAR_ADV_EVT;
|
||||
p_msg->p_clear_adv_cback = p_clear_adv_cback;
|
||||
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -2804,7 +2877,7 @@ void BTA_DmBleGapConfigExtAdvDataRaw(BOOLEAN is_scan_rsp, UINT8 instance, UINT16
|
||||
p_msg->is_scan_rsp = is_scan_rsp;
|
||||
p_msg->instance = instance;
|
||||
p_msg->length = length;
|
||||
p_msg->data = (UINT8 *)(p_msg + 1);
|
||||
p_msg->data = length != 0 ? (UINT8 *)(p_msg + 1) : NULL;
|
||||
if (data) {
|
||||
memcpy(p_msg->data, data, length);
|
||||
}
|
||||
@@ -2883,7 +2956,7 @@ void BTA_DmBleGapPeriodicAdvSetParams(UINT8 instance,
|
||||
}
|
||||
|
||||
void BTA_DmBleGapPeriodicAdvCfgDataRaw(UINT8 instance, UINT16 length,
|
||||
const UINT8 *data)
|
||||
const UINT8 *data,bool only_update_did)
|
||||
{
|
||||
tBTA_DM_API_CFG_PERIODIC_ADV_DATA *p_msg;
|
||||
APPL_TRACE_API("%s, Periodic ADV config data raw.", __func__);
|
||||
@@ -2894,6 +2967,8 @@ void BTA_DmBleGapPeriodicAdvCfgDataRaw(UINT8 instance, UINT16 length,
|
||||
p_msg->length = length;
|
||||
p_msg->data = (UINT8 *)(p_msg + 1);
|
||||
memcpy(p_msg->data, data, length);
|
||||
p_msg->data = length != 0 ? (UINT8 *)(p_msg + 1) : NULL;
|
||||
p_msg->only_update_did = only_update_did;
|
||||
//start sent the msg to the bta system control moudle
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
@@ -2902,7 +2977,7 @@ void BTA_DmBleGapPeriodicAdvCfgDataRaw(UINT8 instance, UINT16 length,
|
||||
|
||||
}
|
||||
|
||||
void BTA_DmBleGapPeriodicAdvEnable(BOOLEAN enable, UINT8 instance)
|
||||
void BTA_DmBleGapPeriodicAdvEnable(UINT8 enable, UINT8 instance)
|
||||
{
|
||||
tBTA_DM_API_ENABLE_PERIODIC_ADV *p_msg;
|
||||
APPL_TRACE_API("%s, Periodic ADV %s.", __func__, enable ? "start" : "stop");
|
||||
@@ -3110,4 +3185,72 @@ void BTA_DmBleGapExtConnect(tBLE_ADDR_TYPE own_addr_type, const BD_ADDR peer_add
|
||||
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
void BTA_DmBleGapPeriodicAdvRecvEnable(UINT16 sync_handle, UINT8 enable)
|
||||
{
|
||||
tBTA_DM_API_PERIODIC_ADV_RECV_ENABLE *p_msg;
|
||||
p_msg = (tBTA_DM_API_PERIODIC_ADV_RECV_ENABLE *) osi_malloc(sizeof(tBTA_DM_API_PERIODIC_ADV_RECV_ENABLE));
|
||||
if (p_msg != NULL) {
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_PERIODIC_ADV_RECV_ENABLE));
|
||||
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_RECV_ENABLE_EVT;
|
||||
p_msg->sync_handle = sync_handle;
|
||||
p_msg->enable = enable;
|
||||
//start sent the msg to the bta system control moudle
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapPeriodicAdvSyncTrans(BD_ADDR peer_addr, UINT16 service_data, UINT16 sync_handle)
|
||||
{
|
||||
tBTA_DM_API_PERIODIC_ADV_SYNC_TRANS *p_msg;
|
||||
p_msg = (tBTA_DM_API_PERIODIC_ADV_SYNC_TRANS *) osi_malloc(sizeof(tBTA_DM_API_PERIODIC_ADV_SYNC_TRANS));
|
||||
if (p_msg != NULL) {
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_PERIODIC_ADV_SYNC_TRANS));
|
||||
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_SYNC_TRANS_EVT;
|
||||
memcpy(p_msg->addr, peer_addr, sizeof(BD_ADDR));
|
||||
p_msg->service_data = service_data;
|
||||
p_msg->sync_handle = sync_handle;
|
||||
//start sent the msg to the bta system control moudle
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapPeriodicAdvSetInfoTrans(BD_ADDR peer_addr, UINT16 service_data, UINT8 adv_handle)
|
||||
{
|
||||
tBTA_DM_API_PERIODIC_ADV_SET_INFO_TRANS *p_msg;
|
||||
p_msg = (tBTA_DM_API_PERIODIC_ADV_SET_INFO_TRANS *) osi_malloc(sizeof(tBTA_DM_API_PERIODIC_ADV_SET_INFO_TRANS));
|
||||
if (p_msg != NULL) {
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_PERIODIC_ADV_SET_INFO_TRANS));
|
||||
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_SET_INFO_TRANS_EVT;
|
||||
memcpy(p_msg->addr, peer_addr, sizeof(BD_ADDR));
|
||||
p_msg->service_data = service_data;
|
||||
p_msg->adv_hanlde = adv_handle;
|
||||
//start sent the msg to the bta system control moudle
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapSetPeriodicAdvSyncTransParams(BD_ADDR peer_addr, tBTA_DM_BLE_PAST_PARAMS *params)
|
||||
{
|
||||
tBTA_DM_API_SET_PAST_PARAMS *p_msg;
|
||||
p_msg = (tBTA_DM_API_SET_PAST_PARAMS *) osi_malloc(sizeof(tBTA_DM_API_SET_PAST_PARAMS));
|
||||
if (p_msg != NULL) {
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_SET_PAST_PARAMS));
|
||||
p_msg->hdr.event = BTA_DM_API_SET_PERIODIC_ADV_SYNC_TRANS_PARAMS_EVT;
|
||||
memcpy(p_msg->addr, peer_addr, sizeof(BD_ADDR));
|
||||
memcpy(&p_msg->params, params, sizeof(tBTA_DM_BLE_PAST_PARAMS));
|
||||
//start sent the msg to the bta system control moudle
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -454,6 +454,7 @@ const UINT8 bta_dm_eir_uuid16_list[] = { 0x08, 0x11, /* Headset */
|
||||
/* Extended Inquiry Response */
|
||||
tBTA_DM_EIR_CONF bta_dm_eir_cfg = {
|
||||
BTM_EIR_DEFAULT_FEC_REQUIRED, /* FEC required */
|
||||
TRUE, /* Included local name */
|
||||
50, /* minimum length of local name when it is shortened */
|
||||
/* if length of local name is longer than this and EIR has not enough */
|
||||
/* room for all UUID list then local name is shortened to this length */
|
||||
|
||||
@@ -349,10 +349,6 @@ void bta_dm_co_ble_io_req(BD_ADDR bd_addr, tBTA_IO_CAP *p_io_cap,
|
||||
|
||||
*p_auth_req = bte_appl_cfg.ble_auth_req | (bte_appl_cfg.ble_auth_req & BTA_LE_AUTH_REQ_MITM) | ((*p_auth_req) & BTA_LE_AUTH_REQ_MITM);
|
||||
|
||||
if (*p_oob_data == BTM_BLE_OOB_ENABLE) {
|
||||
*p_auth_req = (*p_auth_req)&(~BTA_LE_AUTH_REQ_SC_ONLY);
|
||||
}
|
||||
|
||||
if (bte_appl_cfg.ble_io_cap <= 4) {
|
||||
*p_io_cap = bte_appl_cfg.ble_io_cap;
|
||||
}
|
||||
@@ -365,7 +361,7 @@ void bta_dm_co_ble_io_req(BD_ADDR bd_addr, tBTA_IO_CAP *p_io_cap,
|
||||
*p_resp_key = bte_appl_cfg.ble_resp_key;
|
||||
}
|
||||
|
||||
if (bte_appl_cfg.ble_max_key_size > 7 && bte_appl_cfg.ble_max_key_size <= 16) {
|
||||
if (bte_appl_cfg.ble_max_key_size >= 7 && bte_appl_cfg.ble_max_key_size <= 16) {
|
||||
*p_max_key_size = bte_appl_cfg.ble_max_key_size;
|
||||
}
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
|
||||
@@ -97,6 +97,8 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
#if (BTM_OOB_INCLUDED == TRUE && SMP_INCLUDED == TRUE)
|
||||
bta_dm_loc_oob, /* BTA_DM_API_LOC_OOB_EVT */
|
||||
bta_dm_oob_reply, /* BTA_DM_API_OOB_REPLY_EVT */
|
||||
bta_dm_sc_oob_reply, /* BTA_DM_API_SC_OOB_REPLY_EVT */
|
||||
bta_dm_sc_create_oob_data, /* BTA_DM_API_SC_CR_OOB_DATA_EVT */
|
||||
bta_dm_ci_io_req_act, /* BTA_DM_CI_IO_REQ_EVT */
|
||||
bta_dm_ci_rmt_oob_act, /* BTA_DM_CI_RMT_OOB_EVT */
|
||||
#endif /* BTM_OOB_INCLUDED */
|
||||
@@ -200,7 +202,17 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
bta_dm_ble_gap_set_ext_scan_params, /* BTA_DM_API_SET_EXT_SCAN_PARAMS_EVT */
|
||||
bta_dm_ble_gap_ext_scan, /* BTA_DM_API_START_EXT_SCAN_EVT */
|
||||
bta_dm_ble_gap_set_prefer_ext_conn_params, /* BTA_DM_API_SET_PERF_EXT_CONN_PARAMS_EVT */
|
||||
NULL, /* BTA_DM_API_EXT_CONN_EVT */
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
bta_dm_ble_gap_periodic_adv_recv_enable, /* BTA_DM_API_PERIODIC_ADV_RECV_ENABLE_EVT */
|
||||
bta_dm_ble_gap_periodic_adv_sync_trans, /* BTA_DM_API_PERIODIC_ADV_SYNC_TRANS_EVT */
|
||||
bta_dm_ble_gap_periodic_adv_set_info_trans, /* BTA_DM_API_PERIODIC_ADV_SET_INFO_TRANS_EVT */
|
||||
bta_dm_ble_gap_set_periodic_adv_sync_trans_params, /* BTA_DM_API_SET_PERIODIC_ADV_SYNC_TRANS_PARAMS_EVT */
|
||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
#if BLE_INCLUDED == TRUE
|
||||
bta_dm_ble_gap_clear_adv, /* BTA_DM_API_BLE_CLEAR_ADV_EVT */
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -34,13 +34,13 @@
|
||||
void bta_dm_set_qos(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
FLOW_SPEC p_flow = {
|
||||
.qos_flags = 0, /* TBD */
|
||||
.service_type = GUARANTEED, /* see below */
|
||||
.token_rate = 0, /* bytes/second */
|
||||
.token_bucket_size = 0, /* bytes */
|
||||
.peak_bandwidth = 0, /* bytes/second */
|
||||
.latency = 625 * p_data->qos_set.t_poll, /* microseconds */
|
||||
.delay_variation = 0xFFFFFFFF /* microseconds */
|
||||
.qos_flags = 0, /* TBD */
|
||||
.service_type = NO_TRAFFIC, /* service_type */
|
||||
.token_rate = 0, /* bytes/second */
|
||||
.token_bucket_size = 0, /* bytes */
|
||||
.peak_bandwidth = 0, /* bytes/second */
|
||||
.latency = 625 * p_data->qos_set.t_poll, /* microseconds */
|
||||
.delay_variation = 0xFFFFFFFF /* microseconds */
|
||||
};
|
||||
|
||||
tBTM_STATUS status = BTM_SetQoS (p_data->qos_set.bd_addr, &p_flow, p_data->qos_set.p_cb);
|
||||
|
||||
@@ -93,6 +93,8 @@ enum {
|
||||
#if (BTM_OOB_INCLUDED == TRUE && SMP_INCLUDED == TRUE)
|
||||
BTA_DM_API_LOC_OOB_EVT,
|
||||
BTA_DM_API_OOB_REPLY_EVT,
|
||||
BTA_DM_API_SC_OOB_REPLY_EVT,
|
||||
BTA_DM_API_SC_CR_OOB_DATA_EVT,
|
||||
BTA_DM_CI_IO_REQ_EVT,
|
||||
BTA_DM_CI_RMT_OOB_EVT,
|
||||
#endif /* BTM_OOB_INCLUDED */
|
||||
@@ -198,6 +200,15 @@ enum {
|
||||
BTA_DM_API_SET_PERF_EXT_CONN_PARAMS_EVT,
|
||||
BTA_DM_API_EXT_CONN_EVT,
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
BTA_DM_API_PERIODIC_ADV_RECV_ENABLE_EVT,
|
||||
BTA_DM_API_PERIODIC_ADV_SYNC_TRANS_EVT,
|
||||
BTA_DM_API_PERIODIC_ADV_SET_INFO_TRANS_EVT,
|
||||
BTA_DM_API_SET_PERIODIC_ADV_SYNC_TRANS_PARAMS_EVT,
|
||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
#if BLE_INCLUDED == TRUE
|
||||
BTA_DM_API_BLE_CLEAR_ADV_EVT,
|
||||
#endif
|
||||
BTA_DM_MAX_EVT
|
||||
};
|
||||
|
||||
@@ -238,6 +249,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
BOOLEAN eir_fec_required;
|
||||
BOOLEAN eir_included_name;
|
||||
BOOLEAN eir_included_tx_power;
|
||||
BOOLEAN eir_included_uuid;
|
||||
UINT8 eir_flags;
|
||||
@@ -400,8 +412,23 @@ typedef struct {
|
||||
BD_ADDR bd_addr;
|
||||
UINT8 len;
|
||||
UINT8 value[BT_OCTET16_LEN];
|
||||
UINT8 c[BT_OCTET16_LEN];
|
||||
UINT8 r[BT_OCTET16_LEN];
|
||||
} tBTA_DM_API_OOB_REPLY;
|
||||
|
||||
/* data type for BTA_DM_API_SC_OOB_REPLY_EVT */
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
BD_ADDR bd_addr;
|
||||
UINT8 c[BT_OCTET16_LEN];
|
||||
UINT8 r[BT_OCTET16_LEN];
|
||||
} tBTA_DM_API_SC_OOB_REPLY;
|
||||
|
||||
/* data type for BTA_DM_API_SC_CR_OOB_DATA_EVT */
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
} tBTA_DM_API_SC_CR_OOB_DATA;
|
||||
|
||||
/* data type for BTA_DM_API_CONFIRM_EVT */
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
@@ -819,6 +846,11 @@ typedef struct {
|
||||
BD_ADDR remote_bda;
|
||||
} tBTA_DM_API_BLE_DISCONNECT;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
tBTA_CLEAR_ADV_CMPL_CBACK *p_clear_adv_cback;
|
||||
} tBTA_DM_API_CLEAR_ADV;
|
||||
|
||||
#endif /* BLE_INCLUDED */
|
||||
|
||||
/* data type for BTA_DM_API_REMOVE_ACL_EVT */
|
||||
@@ -945,12 +977,13 @@ typedef struct {
|
||||
UINT8 instance;
|
||||
UINT16 length;
|
||||
UINT8 *data;
|
||||
BOOLEAN only_update_did;
|
||||
} tBTA_DM_API_CFG_PERIODIC_ADV_DATA;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT8 instance;
|
||||
BOOLEAN enable;
|
||||
UINT8 enable;
|
||||
} tBTA_DM_API_ENABLE_PERIODIC_ADV;
|
||||
|
||||
typedef struct {
|
||||
@@ -1013,6 +1046,35 @@ typedef struct {
|
||||
BD_ADDR peer_addr;
|
||||
} tBTA_DM_API_EXT_CONN;
|
||||
#endif //#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT16 sync_handle;
|
||||
UINT8 enable;
|
||||
} tBTA_DM_API_PERIODIC_ADV_RECV_ENABLE;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
BD_ADDR addr;
|
||||
UINT16 service_data;
|
||||
UINT16 sync_handle;
|
||||
} tBTA_DM_API_PERIODIC_ADV_SYNC_TRANS;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
BD_ADDR addr;
|
||||
UINT16 service_data;
|
||||
UINT8 adv_hanlde;
|
||||
} tBTA_DM_API_PERIODIC_ADV_SET_INFO_TRANS;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
BD_ADDR addr;
|
||||
tBTA_DM_BLE_PAST_PARAMS params;
|
||||
} tBTA_DM_API_SET_PAST_PARAMS;
|
||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
|
||||
/* union of all data types */
|
||||
typedef union {
|
||||
/* event buffer header */
|
||||
@@ -1054,6 +1116,7 @@ typedef union {
|
||||
|
||||
tBTA_DM_API_LOC_OOB loc_oob;
|
||||
tBTA_DM_API_OOB_REPLY oob_reply;
|
||||
tBTA_DM_API_SC_OOB_REPLY sc_oob_reply;
|
||||
tBTA_DM_API_CONFIRM confirm;
|
||||
tBTA_DM_API_KEY_REQ key_req;
|
||||
tBTA_DM_CI_IO_REQ ci_io_req;
|
||||
@@ -1152,6 +1215,13 @@ typedef union {
|
||||
tBTA_DM_API_EXT_SCAN ble_ext_scan;
|
||||
tBTA_DM_API_SET_PER_EXT_CONN_PARAMS ble_set_per_ext_conn_params;
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
tBTA_DM_API_PERIODIC_ADV_RECV_ENABLE ble_periodic_adv_recv_enable;
|
||||
tBTA_DM_API_PERIODIC_ADV_SYNC_TRANS ble_periodic_adv_sync_trans;
|
||||
tBTA_DM_API_PERIODIC_ADV_SET_INFO_TRANS ble_periodic_adv_set_info_trans;
|
||||
tBTA_DM_API_SET_PAST_PARAMS ble_set_past_params;
|
||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
tBTA_DM_API_CLEAR_ADV ble_clear_adv;
|
||||
#endif
|
||||
|
||||
tBTA_DM_API_REMOVE_ACL remove_acl;
|
||||
@@ -1583,6 +1653,8 @@ extern void btm_dm_ble_multi_adv_disable(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_multi_adv_data(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_multi_adv_upd_param(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_multi_adv_enb(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_clear_adv(tBTA_DM_MSG *p_data);
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
extern void bta_dm_ble_gap_read_phy(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_set_prefer_default_phy(tBTA_DM_MSG *p_data);
|
||||
@@ -1613,6 +1685,8 @@ extern BOOLEAN bta_dm_check_if_only_hd_connected(BD_ADDR peer_addr);
|
||||
#if (BTM_OOB_INCLUDED == TRUE)
|
||||
extern void bta_dm_loc_oob(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_oob_reply(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_sc_oob_reply(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_sc_create_oob_data(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ci_io_req_act(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ci_rmt_oob_act(tBTA_DM_MSG *p_data);
|
||||
#endif /* BTM_OOB_INCLUDED */
|
||||
@@ -1654,7 +1728,7 @@ extern void bta_dm_search_cancel_notify (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_search_cancel_transac_cmpl(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_disc_rmt_name (tBTA_DM_MSG *p_data);
|
||||
extern tBTA_DM_PEER_DEVICE *bta_dm_find_peer_device(BD_ADDR peer_addr);
|
||||
void bta_dm_eir_update_uuid(UINT16 uuid16, BOOLEAN adding);
|
||||
void bta_dm_eir_update_uuid(tBT_UUID uuid, BOOLEAN adding);
|
||||
|
||||
extern void bta_dm_enable_test_mode(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_disable_test_mode(tBTA_DM_MSG *p_data);
|
||||
@@ -1706,4 +1780,14 @@ extern void bta_dm_ble_gap_ext_scan(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_set_prefer_ext_conn_params(tBTA_DM_MSG *p_data);
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
extern void bta_dm_ble_gap_periodic_adv_recv_enable(tBTA_DM_MSG *p_data);
|
||||
|
||||
extern void bta_dm_ble_gap_periodic_adv_sync_trans(tBTA_DM_MSG *p_data);
|
||||
|
||||
extern void bta_dm_ble_gap_periodic_adv_set_info_trans(tBTA_DM_MSG *p_data);
|
||||
|
||||
extern void bta_dm_ble_gap_set_periodic_adv_sync_trans_params(tBTA_DM_MSG *p_data);
|
||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
|
||||
#endif /* BTA_DM_INT_H */
|
||||
|
||||
@@ -126,6 +126,7 @@ static void bta_gattc_enable(tBTA_GATTC_CB *p_cb)
|
||||
if (p_cb->state == BTA_GATTC_STATE_DISABLED) {
|
||||
/* initialize control block */
|
||||
memset(&bta_gattc_cb, 0, sizeof(tBTA_GATTC_CB));
|
||||
bta_gattc_cb.auto_disc = true;
|
||||
p_cb->state = BTA_GATTC_STATE_ENABLED;
|
||||
} else {
|
||||
APPL_TRACE_DEBUG("GATTC is already enabled");
|
||||
@@ -692,9 +693,11 @@ void bta_gattc_conn(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
|
||||
} else
|
||||
#endif
|
||||
{ /* cache is building */
|
||||
p_clcb->p_srcb->state = BTA_GATTC_SERV_DISC;
|
||||
/* cache load failure, start discovery */
|
||||
bta_gattc_start_discover(p_clcb, NULL);
|
||||
if (bta_gattc_cb.auto_disc) {
|
||||
p_clcb->p_srcb->state = BTA_GATTC_SERV_DISC;
|
||||
/* cache load failure, start discovery */
|
||||
bta_gattc_start_discover(p_clcb, NULL);
|
||||
}
|
||||
}
|
||||
} else { /* cache is building */
|
||||
p_clcb->state = BTA_GATTC_DISCOVER_ST;
|
||||
@@ -820,8 +823,6 @@ void bta_gattc_close(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
|
||||
bta_sys_conn_close( BTA_ID_GATTC , BTA_ALL_APP_ID, p_clcb->bda);
|
||||
}
|
||||
|
||||
bta_gattc_clcb_dealloc(p_clcb);
|
||||
|
||||
if (p_data->hdr.event == BTA_GATTC_API_CLOSE_EVT) {
|
||||
cb_data.close.status = GATT_Disconnect(p_data->hdr.layer_specific);
|
||||
} else if (p_data->hdr.event == BTA_GATTC_INT_DISCONN_EVT) {
|
||||
@@ -1173,6 +1174,37 @@ void bta_gattc_read_multi(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
|
||||
}
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_gattc_read_multi_var
|
||||
**
|
||||
** Description read multiple variable
|
||||
**
|
||||
** Returns None.
|
||||
*********************************************************************************/
|
||||
void bta_gattc_read_multi_var(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
|
||||
{
|
||||
tBTA_GATT_STATUS status = BTA_GATT_OK;
|
||||
tGATT_READ_PARAM read_param;
|
||||
|
||||
if (bta_gattc_enqueue(p_clcb, p_data)) {
|
||||
memset(&read_param, 0, sizeof(tGATT_READ_PARAM));
|
||||
|
||||
if (status == BTA_GATT_OK) {
|
||||
read_param.read_multiple.num_handles = p_data->api_read_multi.num_attr;
|
||||
read_param.read_multiple.auth_req = p_data->api_read_multi.auth_req;
|
||||
memcpy(&read_param.read_multiple.handles, p_data->api_read_multi.handles,
|
||||
sizeof(UINT16) * p_data->api_read_multi.num_attr);
|
||||
|
||||
status = GATTC_Read(p_clcb->bta_conn_id, GATT_READ_MULTIPLE_VAR, &read_param);
|
||||
}
|
||||
|
||||
/* read fail */
|
||||
if (status != BTA_GATT_OK) {
|
||||
bta_gattc_cmpl_sendmsg(p_clcb->bta_conn_id, GATTC_OPTYPE_READ, status, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_gattc_write
|
||||
**
|
||||
** Description Write an attribute
|
||||
@@ -1288,7 +1320,8 @@ void bta_gattc_read_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_OP_CMPL *p_data)
|
||||
cb_data.read.handle = p_clcb->p_q_cmd->api_read.handle;
|
||||
}
|
||||
|
||||
if (p_clcb->p_q_cmd->hdr.event != BTA_GATTC_API_READ_MULTI_EVT) {
|
||||
if (p_clcb->p_q_cmd->hdr.event != BTA_GATTC_API_READ_MULTI_EVT &&
|
||||
p_clcb->p_q_cmd->hdr.event != BTA_GATTC_API_READ_MULTI_VAR_EVT) {
|
||||
event = p_clcb->p_q_cmd->api_read.cmpl_evt;
|
||||
} else {
|
||||
event = p_clcb->p_q_cmd->api_read_multi.cmpl_evt;
|
||||
@@ -1425,7 +1458,9 @@ void bta_gattc_op_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
|
||||
return;
|
||||
}
|
||||
if (p_clcb->p_q_cmd->hdr.event != bta_gattc_opcode_to_int_evt[op - GATTC_OPTYPE_READ]) {
|
||||
if ((p_clcb->p_q_cmd->hdr.event != BTA_GATTC_API_READ_MULTI_EVT)&&(p_clcb->p_q_cmd->hdr.event != BTA_GATTC_API_READ_BY_TYPE_EVT)) {
|
||||
if ((p_clcb->p_q_cmd->hdr.event != BTA_GATTC_API_READ_MULTI_EVT) &&
|
||||
(p_clcb->p_q_cmd->hdr.event != BTA_GATTC_API_READ_BY_TYPE_EVT) &&
|
||||
(p_clcb->p_q_cmd->hdr.event != BTA_GATTC_API_READ_MULTI_VAR_EVT)) {
|
||||
mapped_op = p_clcb->p_q_cmd->hdr.event - BTA_GATTC_API_READ_EVT + GATTC_OPTYPE_READ;
|
||||
if ( mapped_op > GATTC_OPTYPE_INDICATION) {
|
||||
mapped_op = 0;
|
||||
|
||||
@@ -563,6 +563,42 @@ void BTA_GATTC_ReadMultiple(UINT16 conn_id, tBTA_GATTC_MULTI *p_read_multi,
|
||||
return;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_GATTC_ReadMultipleVariable
|
||||
**
|
||||
** Description This function is called to read multiple variable length characteristic or
|
||||
** characteristic descriptors.
|
||||
**
|
||||
** Parameters conn_id - connection ID.
|
||||
** p_read_multi - pointer to the read multiple parameter.
|
||||
**
|
||||
** Returns None
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_GATTC_ReadMultipleVariable(UINT16 conn_id, tBTA_GATTC_MULTI *p_read_multi,
|
||||
tBTA_GATT_AUTH_REQ auth_req)
|
||||
{
|
||||
tBTA_GATTC_API_READ_MULTI *p_buf;
|
||||
UINT16 len = (UINT16)(sizeof(tBTA_GATTC_API_READ_MULTI));
|
||||
|
||||
if ((p_buf = (tBTA_GATTC_API_READ_MULTI *) osi_malloc(len)) != NULL) {
|
||||
memset(p_buf, 0, len);
|
||||
|
||||
p_buf->hdr.event = BTA_GATTC_API_READ_MULTI_VAR_EVT;
|
||||
p_buf->hdr.layer_specific = conn_id;
|
||||
p_buf->auth_req = auth_req;
|
||||
p_buf->num_attr = p_read_multi->num_attr;
|
||||
p_buf->cmpl_evt = BTA_GATTC_READ_MULTI_VAR_EVT;
|
||||
if (p_buf->num_attr > 0) {
|
||||
memcpy(p_buf->handles, p_read_multi->handles, sizeof(UINT16) * p_read_multi->num_attr);
|
||||
}
|
||||
|
||||
bta_sys_sendmsg(p_buf);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_GATTC_Read_by_type
|
||||
@@ -896,7 +932,7 @@ tBTA_GATT_STATUS BTA_GATTC_RegisterForNotifications (tBTA_GATTC_IF client_if,
|
||||
}
|
||||
if (i == BTA_GATTC_NOTIF_REG_MAX) {
|
||||
status = BTA_GATT_NO_RESOURCES;
|
||||
APPL_TRACE_ERROR("Max Notification Reached, registration failed.");
|
||||
APPL_TRACE_ERROR("Max Notification Reached, registration failed,see CONFIG_BT_GATTC_NOTIF_REG_MAX in menuconfig");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -1103,4 +1139,83 @@ void BTA_GATTC_Broadcast(tBTA_GATTC_IF client_if, BOOLEAN start)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Add For BLE PTS */
|
||||
uint8_t BTA_GATTC_AutoDiscoverEnable(uint8_t enable)
|
||||
{
|
||||
APPL_TRACE_DEBUG("%s enable %d", __func__, enable);
|
||||
|
||||
bta_gattc_cb.auto_disc = ((enable > 0) ? true : false);
|
||||
GATTC_AutoDiscoverEnable(enable);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
UINT16 len;
|
||||
union {
|
||||
UINT16 uuid16;
|
||||
UINT32 uuid32;
|
||||
UINT8 uuid128[LEN_UUID_128];
|
||||
} uuid;
|
||||
} __attribute__((packed)) tAPP_UUID;
|
||||
|
||||
uint8_t BTA_GATTC_Discover(uint8_t gatt_if, uint16_t conn_id, void *uuid, uint8_t disc_type, uint16_t s_handle, uint16_t e_handle)
|
||||
{
|
||||
tGATT_STATUS status;
|
||||
tGATT_DISC_PARAM param;
|
||||
tAPP_UUID *app_uuid = (tAPP_UUID *)uuid;
|
||||
|
||||
conn_id = (UINT16)((((UINT8)conn_id) << 8) | gatt_if);
|
||||
memset(¶m, 0, sizeof(tGATT_DISC_PARAM));
|
||||
|
||||
if (disc_type == GATT_DISC_SRVC_ALL || disc_type == GATT_DISC_SRVC_BY_UUID) {
|
||||
param.s_handle = 1;
|
||||
param.e_handle = 0xFFFF;
|
||||
} else {
|
||||
param.s_handle = s_handle;
|
||||
param.e_handle = e_handle;
|
||||
}
|
||||
|
||||
if (app_uuid) {
|
||||
param.service.len = app_uuid->len;
|
||||
if (app_uuid->len == LEN_UUID_16) {
|
||||
param.service.uu.uuid16 = app_uuid->uuid.uuid16;
|
||||
} else if (app_uuid->len == LEN_UUID_32) {
|
||||
param.service.uu.uuid32 = app_uuid->uuid.uuid32;
|
||||
} else if (app_uuid->len == LEN_UUID_128) {
|
||||
memcpy(param.service.uu.uuid128, app_uuid->uuid.uuid128, LEN_UUID_128);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s invalid uuid len %u", __func__, app_uuid->len);
|
||||
}
|
||||
}
|
||||
|
||||
status = GATTC_Discover (conn_id, disc_type, ¶m);
|
||||
if (status != GATT_SUCCESS) {
|
||||
APPL_TRACE_ERROR("%s status %x", __func__, status);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t BTA_GATTC_ReadLongChar(uint8_t gatt_if, uint16_t conn_id, uint16_t handle, uint16_t offset, uint8_t auth_req)
|
||||
{
|
||||
tGATT_STATUS status;
|
||||
tGATT_READ_PARAM read_param;
|
||||
|
||||
conn_id = (UINT16)((((UINT8)conn_id) << 8) | gatt_if);
|
||||
memset (&read_param, 0, sizeof(tGATT_READ_PARAM));
|
||||
read_param.partial.handle = handle;
|
||||
read_param.partial.offset = offset;
|
||||
read_param.partial.auth_req = auth_req;
|
||||
|
||||
status = GATTC_Read(conn_id, GATT_READ_PARTIAL, &read_param);
|
||||
if (status != GATT_SUCCESS) {
|
||||
APPL_TRACE_ERROR("%s status %x", __func__, status);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* End BLE PTS */
|
||||
#endif /* defined(GATTC_INCLUDED) && (GATTC_INCLUDED == TRUE) */
|
||||
|
||||
@@ -969,6 +969,10 @@ void bta_gattc_disc_res_cback (UINT16 conn_id, tGATT_DISC_TYPE disc_type, tGATT_
|
||||
BOOLEAN pri_srvc;
|
||||
tBTA_GATTC_CLCB *p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id);
|
||||
|
||||
if (bta_gattc_cb.auto_disc == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
p_srvc_cb = bta_gattc_find_scb_by_cid(conn_id);
|
||||
|
||||
if (p_srvc_cb != NULL && p_clcb != NULL && p_clcb->state == BTA_GATTC_DISCOVER_ST) {
|
||||
@@ -1042,6 +1046,10 @@ void bta_gattc_disc_cmpl_cback (UINT16 conn_id, tGATT_DISC_TYPE disc_type, tGATT
|
||||
tBTA_GATTC_SERV *p_srvc_cb;
|
||||
tBTA_GATTC_CLCB *p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id);
|
||||
|
||||
if (bta_gattc_cb.auto_disc == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( p_clcb && (status != GATT_SUCCESS || p_clcb->status != GATT_SUCCESS) ) {
|
||||
if (status == GATT_SUCCESS) {
|
||||
p_clcb->status = status;
|
||||
|
||||
@@ -139,7 +139,7 @@ static bool cacheOpen(BD_ADDR bda, bool to_save, UINT8 *index)
|
||||
return ((status == ESP_OK) ? true : false);
|
||||
}
|
||||
|
||||
static void cacheReset(BD_ADDR bda)
|
||||
static void cacheReset(BD_ADDR bda, BOOLEAN update)
|
||||
{
|
||||
char fname[255] = {0};
|
||||
getFilename(fname, bda);
|
||||
@@ -177,9 +177,16 @@ static void cacheReset(BD_ADDR bda)
|
||||
for(UINT8 i = index; i < (num - 1); i++) {
|
||||
memcpy(&cache_env->cache_addr[i], &cache_env->cache_addr[i+1], sizeof(cache_addr_info_t));
|
||||
}
|
||||
//clear the last cache when delete a addr
|
||||
memset(&cache_env->cache_addr[num-1], 0, sizeof(cache_addr_info_t));
|
||||
//reduced the number address counter also
|
||||
cache_env->num_addr--;
|
||||
|
||||
//don't need to update addr list to nvs flash
|
||||
if (!update) {
|
||||
return;
|
||||
}
|
||||
|
||||
//update addr list to nvs flash
|
||||
if(cache_env->num_addr > 0) {
|
||||
//update
|
||||
@@ -376,7 +383,7 @@ void bta_gattc_co_cache_close(BD_ADDR server_bda, UINT16 conn_id)
|
||||
*******************************************************************************/
|
||||
void bta_gattc_co_cache_reset(BD_ADDR server_bda)
|
||||
{
|
||||
cacheReset(server_bda);
|
||||
cacheReset(server_bda, TRUE);
|
||||
}
|
||||
|
||||
void bta_gattc_co_cache_addr_init(void)
|
||||
@@ -520,26 +527,29 @@ void bta_gattc_co_cache_addr_save(BD_ADDR bd_addr, hash_key_t hash_key)
|
||||
UINT8 index = 0;
|
||||
UINT8 new_index = cache_env->num_addr;
|
||||
UINT8 *p_buf = osi_malloc(MAX_ADDR_LIST_CACHE_BUF);
|
||||
// check the address list has the same hash key or not
|
||||
if (bta_gattc_co_find_hash_in_cache(hash_key) != INVALID_ADDR_NUM) {
|
||||
APPL_TRACE_DEBUG("%s(), the hash key already in the cache list.", __func__);
|
||||
if ((index = bta_gattc_co_find_addr_in_cache(bd_addr)) != INVALID_ADDR_NUM) {
|
||||
APPL_TRACE_DEBUG("%s(), the hash bd_addr already in the cache list, index = %x", __func__, index);
|
||||
//if the bd_addr already in the address list, update the hash key in it.
|
||||
memcpy(cache_env->cache_addr[index].addr, bd_addr, sizeof(BD_ADDR));
|
||||
memcpy(cache_env->cache_addr[index].hash_key, hash_key, sizeof(hash_key_t));
|
||||
} else {
|
||||
//if the bd_addr didn't in the address list, added the bd_addr to the last of the address list.
|
||||
memcpy(cache_env->cache_addr[new_index].hash_key, hash_key, sizeof(hash_key_t));
|
||||
memcpy(cache_env->cache_addr[new_index].addr, bd_addr, sizeof(BD_ADDR));
|
||||
cache_env->num_addr++;
|
||||
}
|
||||
if (p_buf == NULL) {
|
||||
APPL_TRACE_ERROR("%s malloc failed!", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
// check the address list has the same address or not
|
||||
// for the same address, it's hash key may be change due to service change
|
||||
if ((index = bta_gattc_co_find_addr_in_cache(bd_addr)) != INVALID_ADDR_NUM) {
|
||||
APPL_TRACE_DEBUG("%s the bd_addr already in the cache list, index = %x", __func__, index);
|
||||
//if the bd_addr already in the address list, update the hash key in it.
|
||||
memcpy(cache_env->cache_addr[index].addr, bd_addr, sizeof(BD_ADDR));
|
||||
memcpy(cache_env->cache_addr[index].hash_key, hash_key, sizeof(hash_key_t));
|
||||
} else {
|
||||
APPL_TRACE_DEBUG("%s(), num = %d", __func__, new_index + 1);
|
||||
if (cache_env->num_addr >= MAX_DEVICE_IN_CACHE) {
|
||||
APPL_TRACE_WARNING("%s cache list full and remove the oldest addr info", __func__);
|
||||
cacheReset(cache_env->cache_addr[0].addr, FALSE);
|
||||
}
|
||||
new_index = cache_env->num_addr;
|
||||
assert(new_index < MAX_DEVICE_IN_CACHE);
|
||||
memcpy(cache_env->cache_addr[new_index].addr, bd_addr, sizeof(BD_ADDR));
|
||||
memcpy(cache_env->cache_addr[new_index].hash_key, hash_key, sizeof(hash_key_t));
|
||||
cache_env->num_addr++;
|
||||
APPL_TRACE_DEBUG("%s(), num = %d", __func__, cache_env->num_addr);
|
||||
}
|
||||
|
||||
nvs_handle_t *fp = &cache_env->addr_fp;
|
||||
@@ -567,10 +577,10 @@ void bta_gattc_co_cache_addr_save(BD_ADDR bd_addr, hash_key_t hash_key)
|
||||
APPL_TRACE_ERROR("%s, Line = %d, nvs flash open fail, err_code = %x", __func__, __LINE__, err_code);
|
||||
}
|
||||
}
|
||||
|
||||
//free the buffer after used.
|
||||
osi_free(p_buf);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
BOOLEAN bta_gattc_co_cache_new_assoc_list(BD_ADDR src_addr, UINT8 index)
|
||||
|
||||
@@ -66,6 +66,7 @@ enum {
|
||||
BTA_GATTC_RESTART_DISCOVER,
|
||||
BTA_GATTC_CFG_MTU,
|
||||
BTA_GATTC_READ_BY_TYPE,
|
||||
BTA_GATTC_READ_MULTI_VAR,
|
||||
|
||||
BTA_GATTC_IGNORE
|
||||
};
|
||||
@@ -100,7 +101,8 @@ const tBTA_GATTC_ACTION bta_gattc_action[] = {
|
||||
bta_gattc_disc_close,
|
||||
bta_gattc_restart_discover,
|
||||
bta_gattc_cfg_mtu,
|
||||
bta_gattc_read_by_type
|
||||
bta_gattc_read_by_type,
|
||||
bta_gattc_read_multi_var,
|
||||
};
|
||||
|
||||
|
||||
@@ -137,6 +139,7 @@ static const UINT8 bta_gattc_st_idle[][BTA_GATTC_NUM_COLS] = {
|
||||
/* BTA_GATTC_INT_DISCONN_EVT */ {BTA_GATTC_IGNORE, BTA_GATTC_IDLE_ST},
|
||||
|
||||
/* BTA_GATTC_API_READ_BY_TYPE_EVT */ {BTA_GATTC_FAIL, BTA_GATTC_IDLE_ST},
|
||||
/* BTA_GATTC_API_READ_MULTI_VAR_EVT */ {BTA_GATTC_FAIL, BTA_GATTC_IDLE_ST},
|
||||
};
|
||||
|
||||
/* state table for wait for open state */
|
||||
@@ -167,6 +170,7 @@ static const UINT8 bta_gattc_st_w4_conn[][BTA_GATTC_NUM_COLS] = {
|
||||
/* BTA_GATTC_INT_DISCONN_EVT */ {BTA_GATTC_OPEN_FAIL, BTA_GATTC_IDLE_ST},
|
||||
|
||||
/* BTA_GATTC_API_READ_BY_TYPE_EVT */ {BTA_GATTC_FAIL, BTA_GATTC_W4_CONN_ST},
|
||||
/* BTA_GATTC_API_READ_MULTI_VAR_EVT */ {BTA_GATTC_FAIL, BTA_GATTC_W4_CONN_ST},
|
||||
};
|
||||
|
||||
/* state table for open state */
|
||||
@@ -198,6 +202,7 @@ static const UINT8 bta_gattc_st_connected[][BTA_GATTC_NUM_COLS] = {
|
||||
/* BTA_GATTC_INT_DISCONN_EVT */ {BTA_GATTC_CLOSE, BTA_GATTC_IDLE_ST},
|
||||
|
||||
/* BTA_GATTC_API_READ_BY_TYPE_EVT */ {BTA_GATTC_READ_BY_TYPE, BTA_GATTC_CONN_ST},
|
||||
/* BTA_GATTC_API_READ_MULTI_VAR_EVT */ {BTA_GATTC_READ_MULTI_VAR, BTA_GATTC_CONN_ST},
|
||||
};
|
||||
|
||||
/* state table for discover state */
|
||||
@@ -228,6 +233,7 @@ static const UINT8 bta_gattc_st_discover[][BTA_GATTC_NUM_COLS] = {
|
||||
/* BTA_GATTC_INT_DISCONN_EVT */ {BTA_GATTC_CLOSE, BTA_GATTC_IDLE_ST},
|
||||
|
||||
/* BTA_GATTC_API_READ_BY_TYPE_EVT */ {BTA_GATTC_Q_CMD, BTA_GATTC_DISCOVER_ST},
|
||||
/* BTA_GATTC_API_READ_MULTI_VAR_EVT */ {BTA_GATTC_Q_CMD, BTA_GATTC_DISCOVER_ST},
|
||||
};
|
||||
|
||||
/* type for state table */
|
||||
@@ -487,6 +493,8 @@ static char *gattc_evt_code(tBTA_GATTC_INT_EVT evt_code)
|
||||
return "BTA_GATTC_API_CFG_MTU_EVT";
|
||||
case BTA_GATTC_API_READ_BY_TYPE_EVT:
|
||||
return "BTA_GATTC_API_READ_BY_TYPE_EVT";
|
||||
case BTA_GATTC_API_READ_MULTI_VAR_EVT:
|
||||
return "BTA_GATTC_API_READ_MULTI_VAR_EVT";
|
||||
default:
|
||||
return "unknown GATTC event code";
|
||||
}
|
||||
|
||||
@@ -322,6 +322,15 @@ void bta_gattc_clcb_dealloc(tBTA_GATTC_CLCB *p_clcb)
|
||||
}
|
||||
}
|
||||
|
||||
void bta_gattc_clcb_dealloc_by_conn_id(UINT16 conn_id)
|
||||
{
|
||||
tBTA_GATTC_CLCB *p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id);
|
||||
|
||||
if (p_clcb) {
|
||||
bta_gattc_clcb_dealloc(p_clcb);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_gattc_find_srcb
|
||||
@@ -421,6 +430,7 @@ tBTA_GATTC_SERV *bta_gattc_srcb_alloc(BD_ADDR bda)
|
||||
{
|
||||
if (p_tcb->p_srvc_cache != NULL) {
|
||||
list_free(p_tcb->p_srvc_cache);
|
||||
p_tcb->p_srvc_cache = NULL;
|
||||
}
|
||||
osi_free(p_tcb->p_srvc_list);
|
||||
p_tcb->p_srvc_list = NULL;
|
||||
|
||||
@@ -495,11 +495,11 @@ void bta_gatts_add_char_descr(tBTA_GATTS_SRVC_CB *p_srvc_cb, tBTA_GATTS_DATA *p_
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_gatts_add_char_descr
|
||||
** Function bta_gatts_set_attr_value
|
||||
**
|
||||
** Description action function to add characteristic descriptor.
|
||||
** Description This function is used to set the attribute value.
|
||||
**
|
||||
** Returns none.
|
||||
** Returns None.
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_gatts_set_attr_value(tBTA_GATTS_SRVC_CB *p_srvc_cb, tBTA_GATTS_DATA *p_msg)
|
||||
@@ -526,8 +526,23 @@ void bta_gatts_set_attr_value(tBTA_GATTS_SRVC_CB *p_srvc_cb, tBTA_GATTS_DATA *p_
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_gatts_get_attr_value
|
||||
**
|
||||
** Description This function retrieves the attribute value associated with
|
||||
** the given attribute handle.
|
||||
**
|
||||
** Returns tGATT_STATUS - GATT status indicating success or failure in
|
||||
** retrieving the attribute value.
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
tGATT_STATUS bta_gatts_get_attr_value(UINT16 attr_handle, UINT16 *length, UINT8 **value)
|
||||
{
|
||||
if (GATTS_GetAttributeValueInternal(attr_handle, length, value) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return GATTS_GetAttributeValue(attr_handle, length, value);
|
||||
}
|
||||
@@ -906,6 +921,22 @@ void bta_gatts_listen(tBTA_GATTS_CB *p_cb, tBTA_GATTS_DATA *p_msg)
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_gatts_show_local_database
|
||||
**
|
||||
** Description print loacl service database
|
||||
**
|
||||
** Returns none.
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_gatts_show_local_database (void)
|
||||
{
|
||||
if (GATTS_ShowLocalDatabase()) {
|
||||
APPL_TRACE_ERROR("%s failed", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_gatts_request_cback
|
||||
|
||||
@@ -640,4 +640,41 @@ void BTA_GATTS_Listen(tBTA_GATTS_IF server_if, BOOLEAN start, BD_ADDR_PTR target
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t BTA_GATTS_SetServiceChangeMode(uint8_t mode)
|
||||
{
|
||||
tGATT_STATUS status;
|
||||
APPL_TRACE_DEBUG("%s mode %u", __func__, mode);
|
||||
|
||||
status = GATTS_SetServiceChangeMode(mode);
|
||||
if (status != GATT_SUCCESS) {
|
||||
APPL_TRACE_ERROR("%s status %x", __func__, status);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t BTA_GATTS_SendMultiNotification(uint8_t gatt_if, uint16_t conn_id, void *tuples, uint16_t num_tuples)
|
||||
{
|
||||
tGATT_STATUS status;
|
||||
conn_id = (UINT16)((((UINT8)conn_id) << 8) | gatt_if);
|
||||
|
||||
status = GATTS_HandleMultiValueNotification(conn_id, (tGATT_HLV *)tuples, num_tuples);
|
||||
if (status != GATT_SUCCESS) {
|
||||
APPL_TRACE_ERROR("%s status %x", __func__, status);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void BTA_GATTS_ShowLocalDatabase(void)
|
||||
{
|
||||
BT_HDR *p_buf;
|
||||
|
||||
if ((p_buf = (BT_HDR *) osi_malloc(sizeof(BT_HDR))) != NULL) {
|
||||
p_buf->event = BTA_GATTS_API_SHOW_LOCAL_DATABASE_EVT;
|
||||
bta_sys_sendmsg(p_buf);
|
||||
}
|
||||
}
|
||||
#endif /* BTA_GATT_INCLUDED */
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "bta/bta_gatts_co.h"
|
||||
#include "btc/btc_storage.h"
|
||||
#include "btc/btc_ble_storage.h"
|
||||
// #include "btif_util.h"
|
||||
|
||||
#if (defined(BTIF_INCLUDED) && BTIF_INCLUDED == TRUE)
|
||||
@@ -159,5 +161,91 @@ BOOLEAN bta_gatts_co_load_handle_range(UINT8 index,
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_gatts_co_cl_feat_save
|
||||
**
|
||||
** Description This callout function is executed by GATTS when GATT server
|
||||
** client support feature is requested to write to NV.
|
||||
**
|
||||
** Parameter remote_addr - remote device address
|
||||
** feature - pointer of client support feature
|
||||
**
|
||||
** Returns void.
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_gatts_co_cl_feat_save(BD_ADDR remote_addr, UINT8 *feature)
|
||||
{
|
||||
bt_bdaddr_t bd_addr;
|
||||
|
||||
memcpy(bd_addr.address, remote_addr, BD_ADDR_LEN);
|
||||
btc_storage_set_gatt_cl_supp_feat(&bd_addr, feature, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_gatts_co_db_hash_save
|
||||
**
|
||||
** Description This callout function is executed by GATTS when GATT server
|
||||
** client status is requested to write to NV.
|
||||
**
|
||||
** Parameter remote_addr - remote device address
|
||||
** db_hash - pointer of GATT service datebase hash
|
||||
**
|
||||
** Returns void.
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_gatts_co_db_hash_save(BD_ADDR remote_addr, BT_OCTET16 db_hash)
|
||||
{
|
||||
bt_bdaddr_t bd_addr;
|
||||
|
||||
memcpy(bd_addr.address, remote_addr, BD_ADDR_LEN);
|
||||
btc_storage_set_gatt_db_hash(&bd_addr, db_hash, BT_OCTET16_LEN);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_gatts_co_cl_feat_load
|
||||
**
|
||||
** Description This callout function is executed by GATTS when GATT server
|
||||
** client status is requested to load from NV.
|
||||
**
|
||||
** Parameter remote_addr - remote device address
|
||||
** feature - pointer of GATT service datebase hash
|
||||
**
|
||||
** Returns void.
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_gatts_co_cl_feat_load(BD_ADDR remote_addr, UINT8 *feature)
|
||||
{
|
||||
bt_bdaddr_t bd_addr;
|
||||
|
||||
memcpy(bd_addr.address, remote_addr, BD_ADDR_LEN);
|
||||
btc_storage_get_gatt_cl_supp_feat(&bd_addr, feature, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_gatts_co_db_hash_load
|
||||
**
|
||||
** Description This callout function is executed by GATTS when GATT server
|
||||
** client status is requested to load from NV.
|
||||
**
|
||||
** Parameter remote_addr - remote device address
|
||||
** db_hash - pointer of GATT service datebase hash
|
||||
**
|
||||
** Returns void.
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_gatts_co_db_hash_load(BD_ADDR remote_addr, BT_OCTET16 db_hash)
|
||||
{
|
||||
bt_bdaddr_t bd_addr;
|
||||
|
||||
memcpy(bd_addr.address, remote_addr, BD_ADDR_LEN);
|
||||
btc_storage_get_gatt_db_hash(&bd_addr, db_hash, BT_OCTET16_LEN);
|
||||
}
|
||||
#endif // #if (SMP_INCLUDED == TRUE)
|
||||
#endif // #if (GATTS_INCLUDED == TRUE)
|
||||
#endif // #if (BLE_INCLUDED == TRUE)
|
||||
|
||||
@@ -133,6 +133,9 @@ BOOLEAN bta_gatts_hdl_event(BT_HDR *p_msg)
|
||||
case BTA_GATTS_API_SEND_SERVICE_CHANGE_EVT:
|
||||
bta_gatts_send_service_change_indication((tBTA_GATTS_DATA *) p_msg);
|
||||
break;
|
||||
case BTA_GATTS_API_SHOW_LOCAL_DATABASE_EVT:
|
||||
bta_gatts_show_local_database();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ enum {
|
||||
BTA_GATTC_INT_DISCONN_EVT,
|
||||
|
||||
BTA_GATTC_API_READ_BY_TYPE_EVT,
|
||||
BTA_GATTC_API_READ_MULTI_VAR_EVT,
|
||||
|
||||
BTA_GATTC_INT_START_IF_EVT,
|
||||
BTA_GATTC_API_REG_EVT,
|
||||
@@ -318,10 +319,6 @@ typedef struct {
|
||||
bool update_incl_srvc;
|
||||
} tBTA_GATTC_SERV;
|
||||
|
||||
#ifndef BTA_GATTC_NOTIF_REG_MAX
|
||||
#define BTA_GATTC_NOTIF_REG_MAX BTA_GATTC_CONN_MAX
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
BOOLEAN in_use;
|
||||
BD_ADDR remote_bda;
|
||||
@@ -394,6 +391,7 @@ enum {
|
||||
|
||||
typedef struct {
|
||||
UINT8 state;
|
||||
BOOLEAN auto_disc; /* internal use: true for auto discovering after connected */
|
||||
tBTA_GATTC_CONN conn_track[BTA_GATTC_CONN_MAX];
|
||||
tBTA_GATTC_BG_TCK bg_track[BTA_GATTC_KNOWN_SR_MAX];
|
||||
tBTA_GATTC_RCB cl_rcb[BTA_GATTC_CL_MAX];
|
||||
@@ -468,6 +466,7 @@ extern void bta_gattc_fail(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
|
||||
extern void bta_gattc_confirm(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
|
||||
extern void bta_gattc_execute(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
|
||||
extern void bta_gattc_read_multi(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
|
||||
extern void bta_gattc_read_multi_var(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
|
||||
extern void bta_gattc_ci_open(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
|
||||
extern void bta_gattc_ci_close(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
|
||||
extern void bta_gattc_ignore_op_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
|
||||
|
||||
@@ -53,7 +53,8 @@ enum {
|
||||
BTA_GATTS_API_CLOSE_EVT,
|
||||
BTA_GATTS_API_LISTEN_EVT,
|
||||
BTA_GATTS_API_DISABLE_EVT,
|
||||
BTA_GATTS_API_SEND_SERVICE_CHANGE_EVT
|
||||
BTA_GATTS_API_SEND_SERVICE_CHANGE_EVT,
|
||||
BTA_GATTS_API_SHOW_LOCAL_DATABASE_EVT
|
||||
};
|
||||
typedef UINT16 tBTA_GATTS_INT_EVT;
|
||||
|
||||
@@ -251,6 +252,7 @@ extern void bta_gatts_cancel_open (tBTA_GATTS_CB *p_cb, tBTA_GATTS_DATA *p_msg);
|
||||
extern void bta_gatts_close (tBTA_GATTS_CB *p_cb, tBTA_GATTS_DATA *p_msg);
|
||||
extern void bta_gatts_listen(tBTA_GATTS_CB *p_cb, tBTA_GATTS_DATA *p_msg);
|
||||
extern void bta_gatts_send_service_change_indication (tBTA_GATTS_DATA *p_msg);
|
||||
extern void bta_gatts_show_local_database (void);
|
||||
|
||||
extern BOOLEAN bta_gatts_uuid_compare(tBT_UUID tar, tBT_UUID src);
|
||||
extern tBTA_GATTS_RCB *bta_gatts_find_app_rcb_by_app_if(tBTA_GATTS_IF server_if);
|
||||
|
||||
@@ -317,4 +317,21 @@ static const char *bta_hd_state_code(tBTA_HD_STATE state_code)
|
||||
return "<unknown>";
|
||||
}
|
||||
}
|
||||
|
||||
#if BT_HID_DEVICE_BQB_INCLUDED
|
||||
tBTA_STATUS bta_hd_bqb_set_local_di_record(void)
|
||||
{
|
||||
tBTA_STATUS status = BTA_FAILURE;
|
||||
|
||||
tBTA_DI_RECORD bqb_device_info;
|
||||
bqb_device_info.vendor = 0;
|
||||
bqb_device_info.vendor_id_source = 0xff; // BTA_HH_VENDOR_ID_INVALID
|
||||
bqb_device_info.product = 1;
|
||||
bqb_device_info.version = 0;
|
||||
bqb_device_info.primary_record = TRUE;
|
||||
|
||||
return BTA_DmSetLocalDiRecord(&bqb_device_info, &bta_hd_cb.sdp_handle);
|
||||
}
|
||||
#endif /* BT_HID_DEVICE_BQB_INCLUDED */
|
||||
|
||||
#endif /* BTA_HD_INCLUDED */
|
||||
|
||||
@@ -785,14 +785,17 @@ void bta_ag_rcvd_slc_ready(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
|
||||
void bta_ag_setcodec(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
|
||||
{
|
||||
#if (BTM_WBS_INCLUDED == TRUE)
|
||||
UINT16 handle = p_data->api_setcodec.hdr.layer_specific;
|
||||
tBTA_AG_PEER_CODEC codec_type = p_data->api_setcodec.codec;
|
||||
tBTA_AG_VAL val;
|
||||
|
||||
val.hdr.handle = handle;
|
||||
val.num = codec_type;
|
||||
|
||||
/* Check if the requested codec type is valid */
|
||||
if((codec_type != BTA_AG_CODEC_NONE) &&
|
||||
(codec_type != BTA_AG_CODEC_CVSD) &&
|
||||
(codec_type != BTA_AG_CODEC_MSBC)) {
|
||||
val.num = codec_type;
|
||||
val.hdr.status = BTA_AG_FAIL_RESOURCES;
|
||||
APPL_TRACE_ERROR("%s error: unsupported codec type %d", __func__, codec_type);
|
||||
(*bta_ag_cb.p_cback)(BTA_AG_WBS_EVT, (tBTA_AG *) &val);
|
||||
@@ -804,11 +807,9 @@ void bta_ag_setcodec(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
|
||||
(codec_type == BTA_AG_CODEC_CVSD)) {
|
||||
p_scb->sco_codec = codec_type;
|
||||
p_scb->codec_updated = TRUE;
|
||||
val.num = codec_type;
|
||||
val.hdr.status = BTA_AG_SUCCESS;
|
||||
APPL_TRACE_DEBUG("%s: Updated codec type %d", __func__, codec_type);
|
||||
} else {
|
||||
val.num = codec_type;
|
||||
val.hdr.status = BTA_AG_FAIL_RESOURCES;
|
||||
APPL_TRACE_ERROR("%s error: unsupported codec type %d",__func__, codec_type);
|
||||
}
|
||||
|
||||
@@ -245,7 +245,6 @@ void BTA_AgAudioClose(UINT16 handle)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_AgResult
|
||||
@@ -297,7 +296,30 @@ void BTA_AgSetCodec(UINT16 handle, tBTA_AG_PEER_CODEC codec)
|
||||
}
|
||||
}
|
||||
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE )
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_AgPktStatsNumsGet
|
||||
**
|
||||
** Description Specify the sync_conn_handle to be used for the packet numbers
|
||||
** received or send.
|
||||
**
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_AgPktStatsNumsGet(UINT16 handle, UINT16 sync_conn_handle)
|
||||
{
|
||||
tBTA_AG_PKT_STAT_GET *p_buf;
|
||||
|
||||
if ((p_buf = (tBTA_AG_PKT_STAT_GET *) osi_malloc(sizeof(tBTA_AG_PKT_STAT_GET))) != NULL) {
|
||||
p_buf->hdr.event = BTA_AG_PKT_STAT_NUMS_GET_EVT;
|
||||
p_buf->hdr.layer_specific = handle;
|
||||
p_buf->sync_conn_handle = sync_conn_handle;
|
||||
bta_sys_sendmsg(p_buf);
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************************************
|
||||
* Function BTA_AgCiData
|
||||
*
|
||||
@@ -317,6 +339,6 @@ void BTA_AgCiData(UINT16 handle)
|
||||
bta_sys_sendmsg(p_buf);
|
||||
}
|
||||
}
|
||||
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE ) */
|
||||
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE) */
|
||||
|
||||
#endif /* #if (BTA_AG_INCLUDED == TRUE)*/
|
||||
|
||||
@@ -36,6 +36,9 @@
|
||||
#include "stack/port_api.h"
|
||||
#include "bta/utl.h"
|
||||
|
||||
#if BT_HF_AG_BQB_INCLUDED
|
||||
static BOOLEAN s_bta_hf_ag_bqb_brsf_flag = false;
|
||||
#endif /* BT_HF_AG_BQB_INCLUDED */
|
||||
|
||||
#if (BTA_AG_INCLUDED == TRUE)
|
||||
/*****************************************************************************
|
||||
@@ -146,6 +149,14 @@ enum
|
||||
BTA_AG_HF_CMD_BAC
|
||||
};
|
||||
|
||||
/* dialing type of BTA_AG_HF_CMD_D */
|
||||
enum
|
||||
{
|
||||
BTA_AG_HF_DIAL_NUM = 0,
|
||||
BTA_AG_HF_DIAL_VOIP,
|
||||
BTA_AG_HF_DIAL_MEM,
|
||||
};
|
||||
|
||||
/* HFP AT command interpreter table */
|
||||
const tBTA_AG_AT_CMD bta_ag_hfp_cmd[] =
|
||||
{
|
||||
@@ -330,6 +341,22 @@ const UINT8 bta_ag_callsetup_ind_tbl[] =
|
||||
#define COLON_IDX_4_VGSVGM 4
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_hf_ag_bqb_brsf_ctrl
|
||||
**
|
||||
** Description Control the usage of BTA_AG_BQB_BRSF_FEAT_SPEC for BQB test
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
#if BT_HF_AG_BQB_INCLUDED
|
||||
void bta_hf_ag_bqb_brsf_ctrl(BOOLEAN enable)
|
||||
{
|
||||
s_bta_hf_ag_bqb_brsf_flag = enable;
|
||||
}
|
||||
#endif /* BT_HF_AG_BQB_INCLUDED */
|
||||
|
||||
/*******************************************
|
||||
* Funcitons Result
|
||||
********************************************/
|
||||
@@ -856,6 +883,8 @@ void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
|
||||
|
||||
case BTA_AG_HF_CMD_D:
|
||||
{
|
||||
UINT16 src = 0;
|
||||
UINT16 dst = 0;
|
||||
/* Do not send OK for Dial cmds Let application decide whether to send OK or ERROR*/
|
||||
/* if mem dial cmd, make sure string contains only digits */
|
||||
if(p_arg[0] == '>') {
|
||||
@@ -863,6 +892,8 @@ void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
|
||||
event = 0;
|
||||
bta_ag_send_error(p_scb, BTA_AG_ERR_INV_CHAR_IN_DSTR);
|
||||
}
|
||||
val.value = BTA_AG_HF_DIAL_MEM;
|
||||
src = 1;
|
||||
} else if (p_arg[0] == 'V') {
|
||||
/* ATDV : Dial VoIP Call */
|
||||
/* We do not check string. Code will be added later if needed. */
|
||||
@@ -870,6 +901,7 @@ void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
|
||||
event = 0;
|
||||
bta_ag_send_error(p_scb, BTA_AG_ERR_OP_NOT_SUPPORTED);
|
||||
}
|
||||
val.value = BTA_AG_HF_DIAL_VOIP;
|
||||
} else {
|
||||
/* If dial cmd, make sure string contains only dial digits
|
||||
** Dial digits are 0-9, A-C, *, #, + */
|
||||
@@ -877,6 +909,17 @@ void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
|
||||
event = 0;
|
||||
bta_ag_send_error(p_scb, BTA_AG_ERR_INV_CHAR_IN_DSTR);
|
||||
}
|
||||
val.value = BTA_AG_HF_DIAL_NUM;
|
||||
}
|
||||
if (event != 0) {
|
||||
while ((val.str[dst] = p_arg[src]) != '\0') {
|
||||
if (val.str[dst] == ';') {
|
||||
val.str[dst] = '\0';
|
||||
break;
|
||||
}
|
||||
src++;
|
||||
dst++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1001,7 +1044,15 @@ void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
|
||||
/* store peer features */
|
||||
p_scb->peer_features = (UINT16) int_arg;
|
||||
/* send BRSF, send OK */
|
||||
bta_ag_send_result(p_scb, BTA_AG_RES_BRSF, NULL, (INT16) (p_scb->features & BTA_AG_BSRF_FEAT_SPEC));
|
||||
#if BT_HF_AG_BQB_INCLUDED
|
||||
if (s_bta_hf_ag_bqb_brsf_flag == true) {
|
||||
bta_ag_send_result(p_scb, BTA_AG_RES_BRSF, NULL, (INT16) (p_scb->features & BTA_AG_BQB_BRSF_FEAT_SPEC));
|
||||
} else {
|
||||
bta_ag_send_result(p_scb, BTA_AG_RES_BRSF, NULL, (INT16) (p_scb->features & BTA_AG_BRSF_FEAT_SPEC));
|
||||
}
|
||||
#else
|
||||
bta_ag_send_result(p_scb, BTA_AG_RES_BRSF, NULL, (INT16) (p_scb->features & BTA_AG_BRSF_FEAT_SPEC));
|
||||
#endif /* BT_HF_AG_BQB_INCLUDED */
|
||||
bta_ag_send_ok(p_scb);
|
||||
break;
|
||||
}
|
||||
@@ -1498,7 +1549,6 @@ void bta_ag_hfp_result(tBTA_AG_SCB *p_scb, tBTA_AG_API_RESULT *p_result)
|
||||
if (p_result->data.ok_flag != BTA_AG_OK_ERROR) {
|
||||
if (p_result->data.str[0] != 0) {
|
||||
bta_ag_send_result(p_scb, code, p_result->data.str, 0);
|
||||
bta_ag_send_ok(p_scb);
|
||||
}
|
||||
if (p_result->data.ok_flag == BTA_AG_OK_DONE) {
|
||||
bta_ag_send_ok(p_scb);
|
||||
|
||||
@@ -91,6 +91,7 @@ enum
|
||||
BTA_AG_CI_SCO_DATA,
|
||||
BTA_AG_CI_RX_DATA,
|
||||
BTA_AG_RCVD_SLC_READY,
|
||||
BTA_AG_PKT_STAT_NUMS,
|
||||
BTA_AG_NUM_ACTIONS
|
||||
};
|
||||
|
||||
@@ -133,7 +134,8 @@ const tBTA_AG_ACTION bta_ag_action[] =
|
||||
bta_ag_send_ring,
|
||||
bta_ag_ci_sco_data,
|
||||
bta_ag_ci_rx_data,
|
||||
bta_ag_rcvd_slc_ready
|
||||
bta_ag_rcvd_slc_ready,
|
||||
bta_ag_pkt_stat_nums
|
||||
};
|
||||
|
||||
/* state table information */
|
||||
@@ -167,7 +169,8 @@ const UINT8 bta_ag_st_init[][BTA_AG_NUM_COLS] =
|
||||
/* RING_TOUT_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_INIT_ST},
|
||||
/* SVC_TOUT_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_INIT_ST},
|
||||
/* CI_SCO_DATA_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_INIT_ST},
|
||||
/* CI_SLC_READY_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_INIT_ST}
|
||||
/* CI_SLC_READY_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_INIT_ST},
|
||||
/* PKT_STAT_NUMS_GET_EVT */ {BTA_AG_PKT_STAT_NUMS, BTA_AG_IGNORE, BTA_AG_INIT_ST}
|
||||
};
|
||||
|
||||
/* state table for opening state */
|
||||
@@ -196,7 +199,8 @@ const UINT8 bta_ag_st_opening[][BTA_AG_NUM_COLS] =
|
||||
/* RING_TOUT_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_OPENING_ST},
|
||||
/* SVC_TOUT_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_OPENING_ST},
|
||||
/* CI_SCO_DATA_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_OPENING_ST},
|
||||
/* CI_SLC_READY_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_OPENING_ST}
|
||||
/* CI_SLC_READY_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_OPENING_ST},
|
||||
/* PKT_STAT_NUMS_GET_EVT */ {BTA_AG_PKT_STAT_NUMS, BTA_AG_IGNORE, BTA_AG_OPENING_ST}
|
||||
};
|
||||
|
||||
/* state table for open state */
|
||||
@@ -225,7 +229,8 @@ const UINT8 bta_ag_st_open[][BTA_AG_NUM_COLS] =
|
||||
/* RING_TOUT_EVT */ {BTA_AG_SEND_RING, BTA_AG_IGNORE, BTA_AG_OPEN_ST},
|
||||
/* SVC_TOUT_EVT */ {BTA_AG_START_CLOSE, BTA_AG_IGNORE, BTA_AG_CLOSING_ST},
|
||||
/* CI_SCO_DATA_EVT */ {BTA_AG_CI_SCO_DATA, BTA_AG_IGNORE, BTA_AG_OPEN_ST},
|
||||
/* CI_SLC_READY_EVT */ {BTA_AG_RCVD_SLC_READY, BTA_AG_IGNORE, BTA_AG_OPEN_ST}
|
||||
/* CI_SLC_READY_EVT */ {BTA_AG_RCVD_SLC_READY, BTA_AG_IGNORE, BTA_AG_OPEN_ST},
|
||||
/* PKT_STAT_NUMS_GET_EVT */ {BTA_AG_PKT_STAT_NUMS, BTA_AG_IGNORE, BTA_AG_OPEN_ST}
|
||||
};
|
||||
|
||||
/* state table for closing state */
|
||||
@@ -254,7 +259,8 @@ const UINT8 bta_ag_st_closing[][BTA_AG_NUM_COLS] =
|
||||
/* RING_TOUT_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_CLOSING_ST},
|
||||
/* SVC_TOUT_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_CLOSING_ST},
|
||||
/* CI_SCO_DATA_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_CLOSING_ST},
|
||||
/* CI_SLC_READY_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_CLOSING_ST}
|
||||
/* CI_SLC_READY_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_CLOSING_ST},
|
||||
/* PKT_STAT_NUMS_GET_EVT */ {BTA_AG_PKT_STAT_NUMS, BTA_AG_IGNORE, BTA_AG_CLOSING_ST}
|
||||
};
|
||||
|
||||
/* type for state table */
|
||||
@@ -357,6 +363,8 @@ static char *bta_ag_evt_str(UINT16 event, tBTA_AG_RES result)
|
||||
return "SCO data Callin";
|
||||
case BTA_AG_CI_SLC_READY_EVT:
|
||||
return "SLC Ready Callin";
|
||||
case BTA_AG_PKT_STAT_NUMS_GET_EVT:
|
||||
return "Get Packet Nums";
|
||||
default:
|
||||
return "Unknown AG Event";
|
||||
}
|
||||
@@ -461,11 +469,11 @@ void bta_ag_scb_dealloc(tBTA_AG_SCB *p_scb)
|
||||
|
||||
APPL_TRACE_DEBUG("bta_ag_scb_dealloc %d", bta_ag_scb_to_idx(p_scb));
|
||||
/* stop timers */
|
||||
bta_sys_stop_timer(&p_scb->act_timer);
|
||||
bta_sys_free_timer(&p_scb->act_timer);
|
||||
#if (BTM_WBS_INCLUDED == TRUE)
|
||||
bta_sys_stop_timer(&p_scb->cn_timer);
|
||||
bta_sys_free_timer(&p_scb->cn_timer);
|
||||
#endif
|
||||
bta_sys_stop_timer(&p_scb->colli_timer);
|
||||
bta_sys_free_timer(&p_scb->colli_timer);
|
||||
|
||||
/* initialize control block */
|
||||
memset(p_scb, 0, sizeof(tBTA_AG_SCB));
|
||||
|
||||
@@ -82,15 +82,13 @@ static const tBTM_ESCO_PARAMS bta_ag_esco_params[BTA_AG_NUM_CODECS] =
|
||||
{
|
||||
BTM_64KBITS_RATE, /* TX Bandwidth (64 kbits/sec) */
|
||||
BTM_64KBITS_RATE, /* RX Bandwidth (64 kbits/sec) */
|
||||
10, /* 10 ms (HS/HF can use EV3, 2-EV3, 3-EV3) */
|
||||
10, /* 10 ms (HS/HF can use EV3, 2-EV3) */
|
||||
BTM_VOICE_SETTING_CVSD, /* Inp Linear, Air CVSD, 2s Comp, 16bit */
|
||||
(BTM_SCO_PKT_TYPES_MASK_HV1 + /* Packet Types */
|
||||
BTM_SCO_PKT_TYPES_MASK_HV2 +
|
||||
BTM_SCO_PKT_TYPES_MASK_HV3 +
|
||||
BTM_SCO_PKT_TYPES_MASK_EV3 +
|
||||
BTM_SCO_PKT_TYPES_MASK_EV4 +
|
||||
BTM_SCO_PKT_TYPES_MASK_EV5 +
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 +
|
||||
(BTM_SCO_PKT_TYPES_MASK_HV1 | /* Packet Types */
|
||||
BTM_SCO_PKT_TYPES_MASK_HV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV5),
|
||||
BTM_ESCO_RETRANS_POWER /* Retransmission effort */
|
||||
},
|
||||
@@ -100,7 +98,7 @@ static const tBTM_ESCO_PARAMS bta_ag_esco_params[BTA_AG_NUM_CODECS] =
|
||||
BTM_64KBITS_RATE, /* RX Bandwidth (64 kbits/sec), 8000 */
|
||||
8, /* 8 ms */
|
||||
BTM_VOICE_SETTING_TRANS, /* Inp Linear, Transparent, 2s Comp, 16bit */
|
||||
(BTM_SCO_PKT_TYPES_MASK_EV3 | /* Packet Types : EV3 + NO_2_EV3 */
|
||||
(BTM_SCO_PKT_TYPES_MASK_EV3 | /* Packet Types : EV3 */
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV5 |
|
||||
@@ -113,8 +111,7 @@ static const tBTM_ESCO_PARAMS bta_ag_esco_params[BTA_AG_NUM_CODECS] =
|
||||
BTM_64KBITS_RATE, /* RX Bandwidth (64 kbits/sec), 8000 */
|
||||
13, /* 13 ms */
|
||||
BTM_VOICE_SETTING_TRANS, /* Inp Linear, Transparent, 2s Comp, 16bit */
|
||||
(BTM_SCO_PKT_TYPES_MASK_EV3 | /* Packet Types : EV3 + 2-EV3 */
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 |
|
||||
(BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 | /* Packet Types : 2-EV3 */
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV5),
|
||||
BTM_ESCO_RETRANS_QUALITY /* Retransmission effort */
|
||||
@@ -124,11 +121,11 @@ static const tBTM_ESCO_PARAMS bta_ag_esco_params[BTA_AG_NUM_CODECS] =
|
||||
{
|
||||
BTM_64KBITS_RATE, /* TX Bandwidth (64 kbits/sec) */
|
||||
BTM_64KBITS_RATE, /* RX Bandwidth (64 kbits/sec) */
|
||||
12, /* 12 ms (HS/HF can use EV3, 2-EV3) */
|
||||
12, /* 12 ms (HS/HF can use 2-EV3) */
|
||||
BTM_VOICE_SETTING_CVSD, /* Inp Linear, Air CVSD, 2s Comp, 16bit */
|
||||
(BTM_SCO_LINK_ALL_PKT_MASK |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV5),
|
||||
(BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 | /* Packet Types : 2-EV3 */
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV5),
|
||||
BTM_ESCO_RETRANS_QUALITY /* Retransmission effort */
|
||||
}
|
||||
};
|
||||
@@ -143,15 +140,13 @@ static const tBTM_ESCO_PARAMS bta_ag_esco_params[] =
|
||||
{
|
||||
BTM_64KBITS_RATE, /* TX Bandwidth (64 kbits/sec) */
|
||||
BTM_64KBITS_RATE, /* RX Bandwidth (64 kbits/sec) */
|
||||
10, /* 10 ms (HS/HF can use EV3, 2-EV3, 3-EV3) */
|
||||
10, /* 10 ms (HS/HF can use EV3, 2-EV3) */
|
||||
BTM_VOICE_SETTING_CVSD, /* Inp Linear, Air CVSD, 2s Comp, 16bit */
|
||||
(BTM_SCO_PKT_TYPES_MASK_HV1 + /* Packet Types */
|
||||
BTM_SCO_PKT_TYPES_MASK_HV2 +
|
||||
BTM_SCO_PKT_TYPES_MASK_HV3 +
|
||||
BTM_SCO_PKT_TYPES_MASK_EV3 +
|
||||
BTM_SCO_PKT_TYPES_MASK_EV4 +
|
||||
BTM_SCO_PKT_TYPES_MASK_EV5 +
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 +
|
||||
(BTM_SCO_PKT_TYPES_MASK_HV1 | /* Packet Types */
|
||||
BTM_SCO_PKT_TYPES_MASK_HV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV5),
|
||||
BTM_ESCO_RETRANS_POWER /* Retransmission effort */
|
||||
},
|
||||
@@ -160,11 +155,11 @@ static const tBTM_ESCO_PARAMS bta_ag_esco_params[] =
|
||||
{
|
||||
BTM_64KBITS_RATE, /* TX Bandwidth (64 kbits/sec) */
|
||||
BTM_64KBITS_RATE, /* RX Bandwidth (64 kbits/sec) */
|
||||
12, /* 12 ms (HS/HF can use EV3, 2-EV3) */
|
||||
12, /* 12 ms (HS/HF can use 2-EV3) */
|
||||
BTM_VOICE_SETTING_CVSD, /* Inp Linear, Air CVSD, 2s Comp, 16bit */
|
||||
(BTM_SCO_LINK_ALL_PKT_MASK |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV5),
|
||||
(BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV5),
|
||||
BTM_ESCO_RETRANS_QUALITY /* Retransmission effort */
|
||||
}
|
||||
};
|
||||
@@ -347,7 +342,7 @@ static void bta_ag_sco_read_cback(UINT16 sco_inx, BT_HDR *p_data, tBTM_SCO_DATA_
|
||||
{
|
||||
if (status != BTM_SCO_DATA_CORRECT)
|
||||
{
|
||||
APPL_TRACE_WARNING("bta_ag_sco_read_cback: status(%d)", status);
|
||||
APPL_TRACE_DEBUG("bta_ag_sco_read_cback: status(%d)", status);
|
||||
}
|
||||
|
||||
/* Callout function must free the data. */
|
||||
@@ -480,6 +475,7 @@ static void bta_ag_cback_sco(tBTA_AG_SCB *p_scb, UINT8 event)
|
||||
|
||||
sco.handle = bta_ag_scb_to_idx(p_scb);
|
||||
sco.app_id = p_scb->app_id;
|
||||
sco.sync_conn_handle = BTM_ReadScoHandle(p_scb->sco_idx);
|
||||
|
||||
/* call close cback */
|
||||
(*bta_ag_cb.p_cback)(event, (tBTA_AG *) &sco);
|
||||
@@ -1482,6 +1478,32 @@ void bta_ag_sco_codec_nego(tBTA_AG_SCB *p_scb, BOOLEAN result)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_ag_pkt_stat_nums
|
||||
**
|
||||
** Description Get the number of packet states
|
||||
**
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_ag_pkt_stat_nums(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
|
||||
{
|
||||
UNUSED(p_scb);
|
||||
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE)
|
||||
tBTA_AG_PKT_STAT_NUMS pkt_stat_nums;
|
||||
uint16_t sync_conn_handle = p_data->pkt_stat.sync_conn_handle;
|
||||
BTM_PktStatNumsGet(sync_conn_handle, (tBTM_SCO_PKT_STAT_NUMS *) &pkt_stat_nums);
|
||||
|
||||
/* call app cback */
|
||||
if (bta_ag_cb.p_cback) {
|
||||
(*bta_ag_cb.p_cback)(BTA_AG_PKT_NUMS_GET_EVT, (tBTA_AG*) &pkt_stat_nums);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_ag_sco_shutdown
|
||||
@@ -1659,7 +1681,8 @@ void bta_ag_sco_conn_rsp(tBTA_AG_SCB *p_scb, tBTM_ESCO_CONN_REQ_EVT_DATA *p_data
|
||||
if (p_data->link_type == BTM_LINK_TYPE_SCO)
|
||||
{
|
||||
resp.retrans_effort = BTM_ESCO_RETRANS_OFF;
|
||||
resp.packet_types = (BTM_SCO_LINK_ONLY_MASK |
|
||||
resp.packet_types = (BTM_SCO_PKT_TYPES_MASK_HV1 |
|
||||
BTM_SCO_PKT_TYPES_MASK_HV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
@@ -1674,8 +1697,9 @@ void bta_ag_sco_conn_rsp(tBTA_AG_SCB *p_scb, tBTM_ESCO_CONN_REQ_EVT_DATA *p_data
|
||||
resp.retrans_effort = BTM_ESCO_RETRANS_QUALITY;
|
||||
}
|
||||
|
||||
resp.packet_types = (BTM_SCO_LINK_ALL_PKT_MASK |
|
||||
resp.packet_types = (BTM_SCO_PKT_TYPES_MASK_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV5);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,16 +76,24 @@
|
||||
#define BTA_AG_ACP 0 /* accepted connection */
|
||||
#define BTA_AG_INT 1 /* initiating connection */
|
||||
|
||||
/* feature mask that matches spec */
|
||||
#define BTA_AG_BSRF_FEAT_SPEC (BTA_AG_FEAT_3WAY | BTA_AG_FEAT_ECNR | \
|
||||
BTA_AG_FEAT_VREC | BTA_AG_FEAT_INBAND | \
|
||||
BTA_AG_FEAT_VTAG | BTA_AG_FEAT_REJECT | \
|
||||
BTA_AG_FEAT_ECS | BTA_AG_FEAT_ECC | \
|
||||
BTA_AG_FEAT_EXTERR | BTA_AG_FEAT_CODEC | \
|
||||
BTA_AG_FEAT_ESCO_S4| BTA_AG_FEAT_VOIP)
|
||||
#if BT_HF_AG_BQB_INCLUDED
|
||||
/* feature mask that matches spec for BQB test */
|
||||
#define BTA_AG_BQB_BRSF_FEAT_SPEC (BTA_AG_FEAT_VOIP | \
|
||||
BTA_AG_FEAT_VTAG | BTA_AG_FEAT_CODEC | \
|
||||
BTA_AG_FEAT_ECS | BTA_AG_FEAT_ECC | \
|
||||
BTA_AG_FEAT_ESCO_S4 | BTA_AG_FEAT_EXTERR)
|
||||
#endif /* BT_HF_AG_BQB_INCLUDED */
|
||||
|
||||
#define BTA_AG_SDP_FEAT_SPEC (BTA_AG_FEAT_3WAY | BTA_AG_FEAT_ECNR | \
|
||||
BTA_AG_FEAT_VREC | BTA_AG_FEAT_INBAND | \
|
||||
/* feature mask that matches spec */
|
||||
#define BTA_AG_BRSF_FEAT_SPEC (BTA_AG_FEAT_3WAY | BTA_AG_FEAT_ECNR | \
|
||||
BTA_AG_FEAT_VREC | BTA_AG_FEAT_INBAND | \
|
||||
BTA_AG_FEAT_VTAG | BTA_AG_FEAT_REJECT | \
|
||||
BTA_AG_FEAT_ECS | BTA_AG_FEAT_ECC | \
|
||||
BTA_AG_FEAT_EXTERR | BTA_AG_FEAT_CODEC | \
|
||||
BTA_AG_FEAT_ESCO_S4 | BTA_AG_FEAT_VOIP)
|
||||
|
||||
#define BTA_AG_SDP_FEAT_SPEC (BTA_AG_FEAT_3WAY | BTA_AG_FEAT_ECNR | \
|
||||
BTA_AG_FEAT_VREC | BTA_AG_FEAT_INBAND | \
|
||||
BTA_AG_FEAT_VTAG)
|
||||
|
||||
enum
|
||||
@@ -114,6 +122,7 @@ enum
|
||||
BTA_AG_SVC_TOUT_EVT,
|
||||
BTA_AG_CI_SCO_DATA_EVT,
|
||||
BTA_AG_CI_SLC_READY_EVT,
|
||||
BTA_AG_PKT_STAT_NUMS_GET_EVT,
|
||||
BTA_AG_MAX_EVT,
|
||||
|
||||
/* these events are handled outside of the state machine */
|
||||
@@ -219,6 +228,13 @@ typedef struct
|
||||
char p_data[BTA_AG_MTU+1];
|
||||
} tBTA_AG_CI_RX_WRITE;
|
||||
|
||||
/* data type for BTA_AG_PKT_STAT_NUMS_GET_EVT */
|
||||
typedef struct
|
||||
{
|
||||
BT_HDR hdr;
|
||||
UINT16 sync_conn_handle;
|
||||
} tBTA_AG_PKT_STAT_GET;
|
||||
|
||||
/* union of all event datatypes */
|
||||
typedef union
|
||||
{
|
||||
@@ -233,6 +249,7 @@ typedef union
|
||||
tBTA_AG_DISC_RESULT disc_result;
|
||||
tBTA_AG_RFC rfc;
|
||||
tBTA_AG_CI_RX_WRITE ci_rx_write;
|
||||
tBTA_AG_PKT_STAT_GET pkt_stat;
|
||||
} tBTA_AG_DATA;
|
||||
|
||||
/* type for each profile */
|
||||
@@ -277,7 +294,7 @@ typedef struct
|
||||
tBTA_AG_SCO_MSBC_SETTINGS codec_msbc_settings; /* settings to be used for the impending eSCO */
|
||||
TIMER_LIST_ENT cn_timer; /* codec negotiation timer */
|
||||
#endif
|
||||
UINT16 sco_idx; /* SCO handle */
|
||||
UINT16 sco_idx; /* SCO connection index */
|
||||
BOOLEAN in_use; /* scb in use */
|
||||
BOOLEAN dealloc; /* TRUE if service shutting down */
|
||||
BOOLEAN clip_enabled; /* set to TRUE if HF enables CLIP reporting */
|
||||
@@ -438,6 +455,7 @@ extern void bta_ag_ci_sco_data(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
|
||||
extern void bta_ag_set_esco_param(BOOLEAN set_reset, tBTM_ESCO_PARAMS *param);
|
||||
extern void bta_ag_ci_rx_data(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
|
||||
extern void bta_ag_rcvd_slc_ready(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
|
||||
extern void bta_ag_pkt_stat_nums(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
|
||||
|
||||
#endif /* #if (BTA_AG_INCLUDED == TRUE) */
|
||||
|
||||
|
||||
@@ -299,7 +299,28 @@ void BTA_HfClientSendAT(UINT16 handle, tBTA_HF_CLIENT_AT_CMD_TYPE at, UINT32 val
|
||||
bta_sys_sendmsg(p_buf);
|
||||
}
|
||||
}
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE )
|
||||
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_HfClientPktStatsNumsGet
|
||||
**
|
||||
** Description Get the packet ststus numbers received and send for a specific (e)SCO connection handle.
|
||||
**
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_HfClientPktStatsNumsGet(UINT16 sync_conn_handle)
|
||||
{
|
||||
tBTA_HF_CLIENT_PKT_STAT_GET *p_buf;
|
||||
if ((p_buf = (tBTA_HF_CLIENT_PKT_STAT_GET *) osi_malloc(sizeof(tBTA_HF_CLIENT_PKT_STAT_GET))) != NULL) {
|
||||
p_buf->hdr.event = BTA_HF_CLIENT_PKT_NUMS_GET_EVT;
|
||||
p_buf->sync_conn_handle = sync_conn_handle;
|
||||
bta_sys_sendmsg(p_buf);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_HfClientCiData(void)
|
||||
{
|
||||
BT_HDR *p_buf;
|
||||
|
||||
@@ -25,6 +25,10 @@
|
||||
#include "bta/bta_hf_client_api.h"
|
||||
#include "bta_hf_client_int.h"
|
||||
|
||||
#if BT_HF_CLIENT_BQB_INCLUDED
|
||||
static BOOLEAN s_bta_hf_client_bqb_clip_flag = TRUE;
|
||||
#endif /* BT_HF_CLIENT_BQB_INCLUDED */
|
||||
|
||||
#if (BTA_HF_INCLUDED == TRUE)
|
||||
/* uncomment to enable extra debug */
|
||||
/* #define BTA_HF_CLIENT_DEBUG TRUE */
|
||||
@@ -75,6 +79,7 @@ enum {
|
||||
BTA_HF_CLIENT_SEND_AT_CMD,
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE)
|
||||
BTA_HF_CLIENT_CI_SCO_DATA,
|
||||
BTA_HF_CLIENT_PKT_STAT_NUMS,
|
||||
#endif
|
||||
BTA_HF_CLIENT_NUM_ACTIONS,
|
||||
};
|
||||
@@ -111,8 +116,9 @@ const tBTA_HF_CLIENT_ACTION bta_hf_client_action[] = {
|
||||
/* BTA_HF_CLIENT_DISC_ACP_RES */ bta_hf_client_disc_acp_res,
|
||||
/* BTA_HF_CLIENT_SVC_CONN_OPEN */ bta_hf_client_svc_conn_open,
|
||||
/* BTA_HF_CLIENT_SEND_AT_CMD */ bta_hf_client_send_at_cmd,
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE )
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE)
|
||||
/* BTA_HF_CLIENT_CI_SCO_DATA */ bta_hf_client_ci_sco_data,
|
||||
/* BTA_HF_CLIENT_PKT_STAT_NUMS */ bta_hf_client_pkt_stat_nums,
|
||||
#endif /* (BTM_SCO_HCI_INCLUDED == TRUE ) */
|
||||
};
|
||||
|
||||
@@ -143,6 +149,7 @@ const UINT8 bta_hf_client_st_init[][BTA_HF_CLIENT_NUM_COLS] = {
|
||||
/* SEND_AT_CMD_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_INIT_ST},
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE )
|
||||
/* CI_SCO_DATA_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_INIT_ST},
|
||||
/* PKT_STAT_NUMS_GET_EVT */ {BTA_HF_CLIENT_PKT_STAT_NUMS, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_INIT_ST},
|
||||
#endif /* (BTM_SCO_HCI_INCLUDED == TRUE ) */
|
||||
};
|
||||
|
||||
@@ -166,8 +173,9 @@ const UINT8 bta_hf_client_st_opening[][BTA_HF_CLIENT_NUM_COLS] = {
|
||||
/* SCO_OPEN_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPENING_ST},
|
||||
/* SCO_CLOSE_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPENING_ST},
|
||||
/* SEND_AT_CMD_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPENING_ST},
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE )
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE)
|
||||
/* CI_SCO_DATA_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPENING_ST},
|
||||
/* PKT_STAT_NUMS_GET_EVT */ {BTA_HF_CLIENT_PKT_STAT_NUMS, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPENING_ST},
|
||||
#endif /* (BTM_SCO_HCI_INCLUDED == TRUE ) */
|
||||
};
|
||||
|
||||
@@ -193,6 +201,7 @@ const UINT8 bta_hf_client_st_open[][BTA_HF_CLIENT_NUM_COLS] = {
|
||||
/* SEND_AT_CMD_EVT */ {BTA_HF_CLIENT_SEND_AT_CMD, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPEN_ST},
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE )
|
||||
/* CI_SCO_DATA_EVT */ {BTA_HF_CLIENT_CI_SCO_DATA, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPEN_ST},
|
||||
/* PKT_STAT_NUMS_GET_EVT */ {BTA_HF_CLIENT_PKT_STAT_NUMS, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPEN_ST},
|
||||
#endif /* (BTM_SCO_HCI_INCLUDED == TRUE ) */
|
||||
};
|
||||
|
||||
@@ -218,6 +227,7 @@ const UINT8 bta_hf_client_st_closing[][BTA_HF_CLIENT_NUM_COLS] = {
|
||||
/* SEND_AT_CMD_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_CLOSING_ST},
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE )
|
||||
/* CI_SCO_DATA_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_CLOSING_ST},
|
||||
/* PKT_STAT_NUMS_GET_EVT */ {BTA_HF_CLIENT_PKT_STAT_NUMS, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_CLOSING_ST},
|
||||
#endif /* (BTM_SCO_HCI_INCLUDED == TRUE ) */
|
||||
};
|
||||
|
||||
@@ -241,6 +251,21 @@ tBTA_HF_CLIENT_CB bta_hf_client_cb;
|
||||
tBTA_HF_CLIENT_CB *bta_hf_client_cb_ptr;
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_hf_client_bqb_clip_ctrl
|
||||
**
|
||||
** Description Control if send the command AT+CLIP for BQB test
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
#if BT_HF_CLIENT_BQB_INCLUDED
|
||||
void bta_hf_client_bqb_clip_ctrl(BOOLEAN enable)
|
||||
{
|
||||
s_bta_hf_client_bqb_clip_flag = enable;
|
||||
}
|
||||
#endif /* BT_HF_CLIENT_BQB_INCLUDED */
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -532,7 +557,14 @@ static void send_post_slc_cmd(void)
|
||||
bta_hf_client_send_at_cmee(TRUE);
|
||||
bta_hf_client_send_at_cops(FALSE);
|
||||
bta_hf_client_send_at_btrh(TRUE, 0);
|
||||
|
||||
#if BT_HF_CLIENT_BQB_INCLUDED
|
||||
if (s_bta_hf_client_bqb_clip_flag == TRUE) {
|
||||
bta_hf_client_send_at_clip(TRUE);
|
||||
}
|
||||
#else
|
||||
bta_hf_client_send_at_clip(TRUE);
|
||||
#endif /* BT_HF_CLIENT_BQB_INCLUDED */
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -640,6 +672,7 @@ static char *bta_hf_client_evt_str(UINT16 event)
|
||||
CASE_RETURN_STR(BTA_HF_CLIENT_SCO_OPEN_EVT)
|
||||
CASE_RETURN_STR(BTA_HF_CLIENT_SCO_CLOSE_EVT)
|
||||
CASE_RETURN_STR(BTA_HF_CLIENT_SEND_AT_CMD_EVT)
|
||||
CASE_RETURN_STR(BTA_HF_CLIENT_PKT_NUMS_GET_EVT)
|
||||
default:
|
||||
return "Unknown HF Client Event";
|
||||
}
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
#include "hci/hci_audio.h"
|
||||
#endif
|
||||
|
||||
#if BT_HF_CLIENT_BQB_INCLUDED
|
||||
static BOOLEAN s_bta_hf_client_bqb_esco_s1_flag = false;
|
||||
#endif /* BT_HF_CLIENT_BQB_INCLUDED */
|
||||
|
||||
#if (BTA_HF_INCLUDED == TRUE)
|
||||
#define BTA_HF_CLIENT_NO_EDR_ESCO (BTM_SCO_PKT_TYPES_MASK_NO_2_EV3 | \
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 | \
|
||||
@@ -39,6 +43,7 @@
|
||||
#define BTA_HF_CLIENT_ESCO_PARAM_IDX_CVSD_S3 1 /* eSCO setting for CVSD S3 */
|
||||
#define BTA_HF_CLIENT_ESCO_PARAM_IDX_MSBC_T2 2 /* eSCO setting for mSBC T2 */
|
||||
#define BTA_HF_CLIENT_ESCO_PARAM_IDX_CVSD_S4 3 /* eSCO setting for CVSD S4 */
|
||||
#define BTA_HF_CLIENT_ESCO_PARAM_IDX_CVSD_S1 4 /* eSCO setting for CVSD S1 */
|
||||
|
||||
static const tBTM_ESCO_PARAMS bta_hf_client_esco_params[] = {
|
||||
/* SCO CVSD */
|
||||
@@ -47,7 +52,8 @@ static const tBTM_ESCO_PARAMS bta_hf_client_esco_params[] = {
|
||||
.tx_bw = BTM_64KBITS_RATE,
|
||||
.max_latency = 10,
|
||||
.voice_contfmt = BTM_VOICE_SETTING_CVSD,
|
||||
.packet_types = (BTM_SCO_LINK_ONLY_MASK |
|
||||
.packet_types = (BTM_SCO_PKT_TYPES_MASK_HV1 |
|
||||
BTM_SCO_PKT_TYPES_MASK_HV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
@@ -60,9 +66,9 @@ static const tBTM_ESCO_PARAMS bta_hf_client_esco_params[] = {
|
||||
.tx_bw = BTM_64KBITS_RATE,
|
||||
.max_latency = 10,
|
||||
.voice_contfmt = BTM_VOICE_SETTING_CVSD,
|
||||
/* Allow controller to use all types available except 5-slot EDR */
|
||||
.packet_types = (BTM_SCO_LINK_ALL_PKT_MASK |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
/* Packet Types : 2-EV3 */
|
||||
.packet_types = (BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV5),
|
||||
.retrans_effort = BTM_ESCO_RETRANS_POWER,
|
||||
},
|
||||
@@ -72,10 +78,9 @@ static const tBTM_ESCO_PARAMS bta_hf_client_esco_params[] = {
|
||||
.tx_bw = BTM_64KBITS_RATE,
|
||||
.max_latency = 13,
|
||||
.voice_contfmt = BTM_VOICE_SETTING_TRANS,
|
||||
/* Packet Types : EV3 + 2-EV3 */
|
||||
.packet_types = (BTM_SCO_PKT_TYPES_MASK_EV3 |
|
||||
/* Packet Types : 2-EV3 */
|
||||
.packet_types = (BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV5),
|
||||
.retrans_effort = BTM_ESCO_RETRANS_QUALITY,
|
||||
},
|
||||
@@ -86,12 +91,28 @@ static const tBTM_ESCO_PARAMS bta_hf_client_esco_params[] = {
|
||||
.tx_bw = BTM_64KBITS_RATE,
|
||||
.max_latency = 12,
|
||||
.voice_contfmt = BTM_VOICE_SETTING_CVSD,
|
||||
/* Allow controller to use all types available except 5-slot EDR */
|
||||
.packet_types = (BTM_SCO_LINK_ALL_PKT_MASK |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
/* Packet Types : 2-EV3 */
|
||||
.packet_types = (BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV5),
|
||||
.retrans_effort = BTM_ESCO_RETRANS_QUALITY,
|
||||
},
|
||||
/* ESCO CVSD S1 */
|
||||
#if BT_HF_CLIENT_BQB_INCLUDED
|
||||
{
|
||||
.rx_bw = BTM_64KBITS_RATE,
|
||||
.tx_bw = BTM_64KBITS_RATE,
|
||||
.max_latency = 7,
|
||||
.voice_contfmt = BTM_VOICE_SETTING_CVSD,
|
||||
/* Packet Types : EV3 */
|
||||
.packet_types = (HCI_ESCO_PKT_TYPES_MASK_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_2_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 |
|
||||
BTM_SCO_PKT_TYPES_MASK_NO_3_EV5),
|
||||
.retrans_effort = BTM_ESCO_RETRANS_POWER,
|
||||
}
|
||||
#endif /* BT_HF_CLIENT_BQB_INCLUDED */
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -106,6 +127,22 @@ enum {
|
||||
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE ) */
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_hf_client_bqb_esco_s1_ctrl
|
||||
**
|
||||
** Description Control the usage of CVSD eSCO S1 parameter for BQB test
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
#if BT_HF_CLIENT_BQB_INCLUDED
|
||||
void bta_hf_client_bqb_esco_s1_ctrl(BOOLEAN enable)
|
||||
{
|
||||
s_bta_hf_client_bqb_esco_s1_flag = enable;
|
||||
}
|
||||
#endif /* BT_HF_CLIENT_BQB_INCLUDED */
|
||||
|
||||
static void bta_hf_client_sco_event(UINT8 event);
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -155,6 +192,7 @@ void bta_hf_client_cback_sco(UINT8 event)
|
||||
tBTA_HF_CLIENT_HDR evt;
|
||||
|
||||
memset(&evt, 0, sizeof(evt));
|
||||
evt.sync_conn_handle = BTM_ReadScoHandle(bta_hf_client_cb.scb.sco_idx);
|
||||
|
||||
/* call app cback */
|
||||
(*bta_hf_client_cb.p_cback)(event, (tBTA_HF_CLIENT_HDR *) &evt);
|
||||
@@ -213,6 +251,11 @@ static void bta_hf_client_sco_conn_rsp(tBTM_ESCO_CONN_REQ_EVT_DATA *p_data)
|
||||
(bta_hf_client_cb.scb.features && BTA_HF_CLIENT_FEAT_ESCO_S4) &&
|
||||
(bta_hf_client_cb.scb.peer_features && BTA_HF_CLIENT_PEER_ESCO_S4)) {
|
||||
index = BTA_HF_CLIENT_ESCO_PARAM_IDX_CVSD_S4;
|
||||
#if BT_HF_CLIENT_BQB_INCLUDED
|
||||
if (s_bta_hf_client_bqb_esco_s1_flag == true) {
|
||||
index = BTA_HF_CLIENT_ESCO_PARAM_IDX_CVSD_S1;
|
||||
}
|
||||
#endif /* BT_HF_CLIENT_BQB_INCLUDED */
|
||||
} else if (bta_hf_client_cb.scb.negotiated_codec == BTM_SCO_CODEC_MSBC) {
|
||||
index = BTA_HF_CLIENT_ESCO_PARAM_IDX_MSBC_T2;
|
||||
}
|
||||
@@ -237,7 +280,29 @@ static void bta_hf_client_sco_conn_rsp(tBTM_ESCO_CONN_REQ_EVT_DATA *p_data)
|
||||
BTM_EScoConnRsp(p_data->sco_inx, hci_status, &resp);
|
||||
}
|
||||
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE )
|
||||
#if (BTM_SCO_HCI_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_hf_client_pkt_stat_nums
|
||||
**
|
||||
** Description Get the packet status number
|
||||
**
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_hf_client_pkt_stat_nums(tBTA_HF_CLIENT_DATA *p_data)
|
||||
{
|
||||
tBTA_SCO_PKT_STAT_NUMS pkt_stat_nums;
|
||||
uint16_t sync_conn_handle = p_data->pkt_stat.sync_conn_handle;
|
||||
BTM_PktStatNumsGet(sync_conn_handle, (tBTM_SCO_PKT_STAT_NUMS *) &pkt_stat_nums);
|
||||
|
||||
/* call app cback */
|
||||
if (bta_hf_client_cb.p_cback) {
|
||||
(*bta_hf_client_cb.p_cback)(BTA_HF_CLIENT_PKT_STAT_NUMS_GET_EVT, (void*) &pkt_stat_nums);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_hf_client_ci_sco_data
|
||||
@@ -254,6 +319,7 @@ void bta_hf_client_ci_sco_data(tBTA_HF_CLIENT_DATA *p_data)
|
||||
bta_hf_client_sco_event(BTA_HF_CLIENT_SCO_CI_DATA_E);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_hf_client_sco_connreq_cback
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user