forked from espressif/esp-idf
Compare commits
358 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8bdaf9198 | ||
|
|
800dec96e9 | ||
|
|
850ac23d14 | ||
|
|
d4080633f9 | ||
|
|
552beab8a9 | ||
|
|
79807ec6ab | ||
|
|
de6fdfbd27 | ||
|
|
9ee3c8337d | ||
|
|
221df10ced | ||
|
|
cfeccaa685 | ||
|
|
2ac433e1ae | ||
|
|
90b5993867 | ||
|
|
aa21184a03 | ||
|
|
2497798036 | ||
|
|
a744595440 | ||
|
|
6d80c334f7 | ||
|
|
1d5fd5587e | ||
|
|
ea646a9c22 | ||
|
|
800d11c48f | ||
|
|
78e9a38ef4 | ||
|
|
8abcacd25e | ||
|
|
3d6e33e9a4 | ||
|
|
c88d8829cf | ||
|
|
1d4f6af1bc | ||
|
|
e59269efa0 | ||
|
|
a5964c442f | ||
|
|
aba1eb81ea | ||
|
|
9e87d53fed | ||
|
|
26960f1734 | ||
|
|
78af134110 | ||
|
|
e1d01a9032 | ||
|
|
56efeb2c76 | ||
|
|
7a8fe58dd6 | ||
|
|
b1d22143a5 | ||
|
|
d13e431341 | ||
|
|
d33e551f47 | ||
|
|
b116cff94f | ||
|
|
7c75d88da5 | ||
|
|
43aa501f18 | ||
|
|
efcef1a400 | ||
|
|
e86181704a | ||
|
|
e2b299660e | ||
|
|
0a83ebcded | ||
|
|
9e46c9b894 | ||
|
|
e72afc771f | ||
|
|
4500ddf2f0 | ||
|
|
6da4c6b513 | ||
|
|
a34a4a91fb | ||
|
|
43f93678ce | ||
|
|
e943143e0f | ||
|
|
a82a530387 | ||
|
|
12252773b9 | ||
|
|
17db9540d6 | ||
|
|
2bbd3ac583 | ||
|
|
3823a991db | ||
|
|
5c1ff3d70b | ||
|
|
77b37716a3 | ||
|
|
85bf17d7e2 | ||
|
|
e83289fb7c | ||
|
|
56342a6057 | ||
|
|
1d52944fda | ||
|
|
1c0d0e505d | ||
|
|
0062349955 | ||
|
|
68178540f0 | ||
|
|
4e083d8214 | ||
|
|
622fb9e906 | ||
|
|
2e17ad62b8 | ||
|
|
1d13716d28 | ||
|
|
52ba3f1ee0 | ||
|
|
e0b8f83253 | ||
|
|
8246d6bec6 | ||
|
|
854a31feda | ||
|
|
cdbdb31d6d | ||
|
|
67341a31b7 | ||
|
|
da03bab573 | ||
|
|
9e66eb4c9f | ||
|
|
5d4edd8218 | ||
|
|
d78c08587d | ||
|
|
e5b0abcc57 | ||
|
|
731486ad33 | ||
|
|
c71071b36c | ||
|
|
c34ba085ba | ||
|
|
9e4b31e0f2 | ||
|
|
99b4b5fbb2 | ||
|
|
9acf90f5e4 | ||
|
|
d8362cce90 | ||
|
|
082ff4e441 | ||
|
|
d404e429ec | ||
|
|
df9fba9d22 | ||
|
|
c227cbea3f | ||
|
|
cf3e45deef | ||
|
|
91983ad0cf | ||
|
|
5c14b6eed1 | ||
|
|
9ec06ba4ac | ||
|
|
4aa7b2a837 | ||
|
|
049d21bb12 | ||
|
|
d927830b81 | ||
|
|
c529135c71 | ||
|
|
cb4fccb38a | ||
|
|
b07e7d7c3f | ||
|
|
694bc6bf47 | ||
|
|
628af15b5a | ||
|
|
ca6a427a81 | ||
|
|
6672ec0692 | ||
|
|
8b24bbd919 | ||
|
|
78cef1b7d2 | ||
|
|
b6800c3e01 | ||
|
|
c9996c010d | ||
|
|
6a66453e94 | ||
|
|
2d2177b4ad | ||
|
|
de5156bb20 | ||
|
|
f90c12fc3c | ||
|
|
3dcb9cf8ec | ||
|
|
b2ddedb941 | ||
|
|
7ae5ec946d | ||
|
|
ee867ec16b | ||
|
|
417dff3a1e | ||
|
|
6e1eb4af26 | ||
|
|
2c41b01771 | ||
|
|
f9488e59a7 | ||
|
|
d688fc3542 | ||
|
|
458f7190f1 | ||
|
|
cd08ea1f31 | ||
|
|
3f42a81447 | ||
|
|
2902766706 | ||
|
|
465577dd28 | ||
|
|
9a6a28734b | ||
|
|
2c89caab9b | ||
|
|
7ba36f4d47 | ||
|
|
7252d678a0 | ||
|
|
00396a9d49 | ||
|
|
db7c50b373 | ||
|
|
a2e8c6f95c | ||
|
|
7c1dd9025f | ||
|
|
cdf8810f63 | ||
|
|
99e2722aab | ||
|
|
89bb0c0759 | ||
|
|
359762c84a | ||
|
|
3974be7fec | ||
|
|
7a77109e0d | ||
|
|
e963447276 | ||
|
|
5bcd438a45 | ||
|
|
7ad67bf462 | ||
|
|
932b6699ac | ||
|
|
e5999ea4fb | ||
|
|
1c82aa5369 | ||
|
|
98430b2f94 | ||
|
|
0c374689ff | ||
|
|
56b2ae504f | ||
|
|
dcf87b10b6 | ||
|
|
5e436add7a | ||
|
|
d86afd82c1 | ||
|
|
c2c6457fbf | ||
|
|
54c5e28c80 | ||
|
|
c273e132ff | ||
|
|
39189e7522 | ||
|
|
f2777e994d | ||
|
|
a1b4ef2806 | ||
|
|
2c38701f68 | ||
|
|
8eb55c84a8 | ||
|
|
2d220b5c3f | ||
|
|
11ab4404ff | ||
|
|
2302651311 | ||
|
|
832ba7dba2 | ||
|
|
4f3f8ebb3d | ||
|
|
2b4b59e635 | ||
|
|
b781bb3134 | ||
|
|
e591c290ad | ||
|
|
76d805f15a | ||
|
|
00402bef5f | ||
|
|
345a12c1f9 | ||
|
|
8e50c5acb2 | ||
|
|
1cece7eef0 | ||
|
|
7f732720f0 | ||
|
|
1f63dc70b8 | ||
|
|
cf0c0d98ee | ||
|
|
a96c1fc7c6 | ||
|
|
e3ec58043f | ||
|
|
be9d294718 | ||
|
|
da943339ad | ||
|
|
4d6cce4b3b | ||
|
|
a54467fcfb | ||
|
|
58979bee59 | ||
|
|
b6f3bfaa13 | ||
|
|
269c02f391 | ||
|
|
80078b6192 | ||
|
|
d6e3d887c1 | ||
|
|
485f3a4ce1 | ||
|
|
54dcccc1f6 | ||
|
|
43a411d452 | ||
|
|
36dde93b57 | ||
|
|
f902b64f40 | ||
|
|
ca8d88a8f5 | ||
|
|
24efd4a505 | ||
|
|
c01e186442 | ||
|
|
c3439e040a | ||
|
|
07518cf467 | ||
|
|
76caa64286 | ||
|
|
cb0ce135a5 | ||
|
|
3fb3600ee0 | ||
|
|
d6ffcfdae8 | ||
|
|
c6e5bee48a | ||
|
|
1411de54b4 | ||
|
|
86d29d566b | ||
|
|
538cd8f0ae | ||
|
|
2e1deb55c0 | ||
|
|
2d9d9e52bf | ||
|
|
fd5aec2d6a | ||
|
|
960ed3ff26 | ||
|
|
a1e6f1dada | ||
|
|
4830bcc777 | ||
|
|
6a2cffe84d | ||
|
|
7280f9c7a5 | ||
|
|
8cba2f2ddf | ||
|
|
e2cdc7f007 | ||
|
|
3e524fc18e | ||
|
|
2ca65b9aef | ||
|
|
5a8faed3dc | ||
|
|
499dbc2152 | ||
|
|
5d13a0b544 | ||
|
|
85db9731e8 | ||
|
|
869ce022bd | ||
|
|
2c66721c3a | ||
|
|
7b8ce7a3a6 | ||
|
|
fbf7261531 | ||
|
|
478ffa077c | ||
|
|
dde4ba5362 | ||
|
|
12c64be392 | ||
|
|
7bd454188d | ||
|
|
35d0d68bbd | ||
|
|
de7c64bcd3 | ||
|
|
3ec5041255 | ||
|
|
647dbdbcaf | ||
|
|
2a719f245d | ||
|
|
193d0d6b6e | ||
|
|
7a82764c49 | ||
|
|
142fa78ce4 | ||
|
|
79727b3a93 | ||
|
|
b2c7f7689c | ||
|
|
25719db1a9 | ||
|
|
f48264c68d | ||
|
|
2b0de33816 | ||
|
|
f3c51c086c | ||
|
|
c86b6ed334 | ||
|
|
08135d4ea6 | ||
|
|
bdb8b487d2 | ||
|
|
d7ba7c3b19 | ||
|
|
8ba0098492 | ||
|
|
1a06484dac | ||
|
|
6b5f53dcc2 | ||
|
|
770b787072 | ||
|
|
a3379e3405 | ||
|
|
3f3e9744ef | ||
|
|
6ea8717373 | ||
|
|
f57a4e51ce | ||
|
|
339e26eddd | ||
|
|
b07b2d529b | ||
|
|
fa83153105 | ||
|
|
e55a640da4 | ||
|
|
879102ab1f | ||
|
|
9e9f0592f8 | ||
|
|
85cc471e8e | ||
|
|
d2403441a4 | ||
|
|
aac7947003 | ||
|
|
85dfebd0cc | ||
|
|
72e365bede | ||
|
|
f7b1e32cb4 | ||
|
|
70bb00afac | ||
|
|
ac8376c225 | ||
|
|
9f6b0d1531 | ||
|
|
628bc99ff5 | ||
|
|
1c71560f35 | ||
|
|
fea51e16fc | ||
|
|
9d2aac1daa | ||
|
|
0ba41b598d | ||
|
|
dd9e7a8b15 | ||
|
|
cc5640aef3 | ||
|
|
a4df6776b6 | ||
|
|
25abb74284 | ||
|
|
2d3582403e | ||
|
|
d6c783d02d | ||
|
|
0d1bc3b2b6 | ||
|
|
1f5dc0f5a1 | ||
|
|
87c415b11a | ||
|
|
270480ff81 | ||
|
|
60c07e02ad | ||
|
|
ced9c9eeb6 | ||
|
|
6e7c8f18b9 | ||
|
|
87ad0e8c97 | ||
|
|
4b71ebbe49 | ||
|
|
be904e4ae9 | ||
|
|
b32fbb9a61 | ||
|
|
78021c0937 | ||
|
|
a165866372 | ||
|
|
8ddc482f28 | ||
|
|
07253938a6 | ||
|
|
37cd376957 | ||
|
|
9099608602 | ||
|
|
af35a6adbb | ||
|
|
75e1c4d0fb | ||
|
|
d4de73cd2c | ||
|
|
1459711ef8 | ||
|
|
c4fd19c144 | ||
|
|
83fe7a5a59 | ||
|
|
77ba6c38ec | ||
|
|
62884dae3a | ||
|
|
4acfe1a91a | ||
|
|
79ee98e229 | ||
|
|
290a6c8ade | ||
|
|
94c74bd866 | ||
|
|
d2ebe4e7bb | ||
|
|
06cad10ec0 | ||
|
|
dc059fe2ee | ||
|
|
e59ec7e597 | ||
|
|
04e24078d9 | ||
|
|
1f2e831ad2 | ||
|
|
b35c2f9794 | ||
|
|
8b352e1da9 | ||
|
|
51023425d2 | ||
|
|
126ae145ec | ||
|
|
e4aaf10ff0 | ||
|
|
ca5ee54424 | ||
|
|
d61715ab9a | ||
|
|
f08c4b823f | ||
|
|
aceeff0b09 | ||
|
|
c2af28ddce | ||
|
|
f1e7252d4d | ||
|
|
45a3ec7983 | ||
|
|
fc82b36847 | ||
|
|
d62b9505e3 | ||
|
|
0fd3824f91 | ||
|
|
8f10a7ad8c | ||
|
|
1cb47a2f3b | ||
|
|
f2a9d457e0 | ||
|
|
722ed6cbc6 | ||
|
|
4853d6319e | ||
|
|
883e54aa71 | ||
|
|
5f5ce49ff6 | ||
|
|
a5a4543faf | ||
|
|
cd92bad84a | ||
|
|
bec6de98c4 | ||
|
|
38d1250788 | ||
|
|
cfc85ac1c6 | ||
|
|
f943f37927 | ||
|
|
83c9d18309 | ||
|
|
b601dd3b24 | ||
|
|
f28f75a46b | ||
|
|
b0c38d5392 | ||
|
|
b0ceb22bef | ||
|
|
4074221540 | ||
|
|
0347d96124 | ||
|
|
6c9c1f72bd | ||
|
|
cc27c90b8c | ||
|
|
a1ca11551f | ||
|
|
6dae07d137 | ||
|
|
ffcc115e8b | ||
|
|
7010314c4a | ||
|
|
8325aff3c9 |
4
.flake8
4
.flake8
@@ -153,6 +153,7 @@ exclude =
|
||||
components/tinyusb,
|
||||
components/unity/unity,
|
||||
components/spiffs/spiffs,
|
||||
components/freemodbus,
|
||||
examples/build_system/cmake/import_lib/main/lib/tinyxml2,
|
||||
examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib,
|
||||
# autogenerated scripts
|
||||
@@ -168,4 +169,5 @@ exclude =
|
||||
|
||||
per-file-ignores =
|
||||
# Sphinx conf.py files use star imports to setup config variables
|
||||
docs/conf_common.py: F405
|
||||
docs/conf_common.py: F405,
|
||||
components/freemodbus/docs/conf_common.py: F405
|
||||
|
||||
@@ -29,7 +29,7 @@ repos:
|
||||
- id: mixed-line-ending
|
||||
args: ['-f=lf']
|
||||
- id: double-quote-string-fixer
|
||||
- repo: https://gitlab.com/pycqa/flake8
|
||||
- repo: https://github.com/PyCQA/flake8
|
||||
rev: 3.9.2
|
||||
hooks:
|
||||
- id: flake8
|
||||
|
||||
@@ -385,7 +385,6 @@ menu "Bootloader config"
|
||||
|
||||
config BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE
|
||||
hex "Size in bytes for custom purposes"
|
||||
range 0 0x10
|
||||
default 0
|
||||
depends on BOOTLOADER_CUSTOM_RESERVE_RTC
|
||||
help
|
||||
@@ -901,9 +900,9 @@ menu "Security features"
|
||||
Download Mode into a separate Secure Download mode. This option can only work if
|
||||
Download Mode is not already disabled by eFuse.
|
||||
|
||||
Secure Download mode limits the use of Download Mode functions to simple flash read,
|
||||
write and erase operations, plus a command to return a summary of currently enabled
|
||||
security features.
|
||||
Secure Download mode limits the use of Download Mode functions to update SPI config,
|
||||
changing baud rate, basic flash write and a command to return a summary of currently
|
||||
enabled security features (`get_security_info`).
|
||||
|
||||
Secure Download mode is not compatible with the esptool.py flasher stub feature,
|
||||
espefuse.py, read/writing memory or registers, encrypted download, or any other
|
||||
|
||||
@@ -44,7 +44,7 @@ SECTIONS
|
||||
*libbootloader_support.a:bootloader_random.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_disable .text.bootloader_random_disable)
|
||||
*libesp_common.a:fpga_overrides.*(.literal.bootloader_fill_random .text.bootloader_fill_random)
|
||||
*libbootloader_support.a:bootloader_efuse_esp32.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_efuse.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_utility.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_sha.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_console_loader.*(.literal .text .literal.* .text.*)
|
||||
@@ -60,6 +60,7 @@ SECTIONS
|
||||
*libmicro-ecc.a:*.*(.literal .text .literal.* .text.*)
|
||||
*libspi_flash.a:*.*(.literal .text .literal.* .text.*)
|
||||
*libhal.a:wdt_hal_iram.*(.literal .text .literal.* .text.*)
|
||||
*libhal.a:efuse_hal.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:rtc_time.*(.literal .text .literal.* .text.*)
|
||||
*libefuse.a:*.*(.literal .text .literal.* .text.*)
|
||||
|
||||
@@ -57,7 +57,7 @@ SECTIONS
|
||||
*libbootloader_support.a:bootloader_random.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_disable .text.bootloader_random_disable)
|
||||
*libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_enable .text.bootloader_random_enable)
|
||||
*libbootloader_support.a:bootloader_efuse_esp32c3.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_efuse.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_utility.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_sha.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_console_loader.*(.literal .text .literal.* .text.*)
|
||||
@@ -73,6 +73,7 @@ SECTIONS
|
||||
*libmicro-ecc.a:*.*(.literal .text .literal.* .text.*)
|
||||
*libspi_flash.a:*.*(.literal .text .literal.* .text.*)
|
||||
*libhal.a:wdt_hal_iram.*(.literal .text .literal.* .text.*)
|
||||
*libhal.a:efuse_hal.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:rtc_time.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:regi2c_ctrl.*(.literal .text .literal.* .text.*)
|
||||
|
||||
@@ -57,7 +57,7 @@ SECTIONS
|
||||
*libbootloader_support.a:bootloader_random.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_disable .text.bootloader_random_disable)
|
||||
*libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_enable .text.bootloader_random_enable)
|
||||
*libbootloader_support.a:bootloader_efuse_esp32h2.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_efuse.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_utility.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_sha.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_console_loader.*(.literal .text .literal.* .text.*)
|
||||
@@ -71,6 +71,7 @@ SECTIONS
|
||||
*libmicro-ecc.a:*.*(.literal .text .literal.* .text.*)
|
||||
*libspi_flash.a:*.*(.literal .text .literal.* .text.*)
|
||||
*libhal.a:wdt_hal_iram.*(.literal .text .literal.* .text.*)
|
||||
*libhal.a:efuse_hal.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:rtc_time.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:regi2c_ctrl.*(.literal .text .literal.* .text.*)
|
||||
|
||||
@@ -31,7 +31,7 @@ SECTIONS
|
||||
*libbootloader_support.a:bootloader_random.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_disable .text.bootloader_random_disable)
|
||||
*libesp_common.a:fpga_overrides.*(.literal.bootloader_fill_random .text.bootloader_fill_random)
|
||||
*libbootloader_support.a:bootloader_efuse_esp32s2.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_efuse.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_utility.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_sha.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_console_loader.*(.literal .text .literal.* .text.*)
|
||||
@@ -47,6 +47,7 @@ SECTIONS
|
||||
*libmicro-ecc.a:*.*(.literal .text .literal.* .text.*)
|
||||
*libspi_flash.a:*.*(.literal .text .literal.* .text.*)
|
||||
*libhal.a:wdt_hal_iram.*(.literal .text .literal.* .text.*)
|
||||
*libhal.a:efuse_hal.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:rtc_time.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:regi2c_ctrl.*(.literal .text .literal.* .text.*)
|
||||
|
||||
@@ -66,7 +66,7 @@ SECTIONS
|
||||
*libbootloader_support.a:bootloader_random.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_disable .text.bootloader_random_disable)
|
||||
*libesp_common.a:fpga_overrides.*(.literal.bootloader_fill_random .text.bootloader_fill_random)
|
||||
*libbootloader_support.a:bootloader_efuse_esp32s3.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_efuse.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_utility.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_sha.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_console_loader.*(.literal .text .literal.* .text.*)
|
||||
@@ -82,6 +82,7 @@ SECTIONS
|
||||
*libmicro-ecc.a:*.*(.literal .text .literal.* .text.*)
|
||||
*libspi_flash.a:*.*(.literal .text .literal.* .text.*)
|
||||
*libhal.a:wdt_hal_iram.*(.literal .text .literal.* .text.*)
|
||||
*libhal.a:efuse_hal.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:rtc_time.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:regi2c_ctrl.*(.literal .text .literal.* .text.*)
|
||||
|
||||
@@ -13,7 +13,7 @@ set(srcs
|
||||
"src/flash_partitions.c"
|
||||
"src/flash_qio_mode.c"
|
||||
"src/bootloader_flash_config_${IDF_TARGET}.c"
|
||||
"src/bootloader_efuse_${IDF_TARGET}.c"
|
||||
"src/bootloader_efuse.c"
|
||||
)
|
||||
|
||||
if(BOOTLOADER_BUILD)
|
||||
|
||||
@@ -187,13 +187,6 @@ int bootloader_common_select_otadata(const esp_ota_select_entry_t *two_otadata,
|
||||
*/
|
||||
esp_err_t bootloader_common_get_partition_description(const esp_partition_pos_t *partition, esp_app_desc_t *app_desc);
|
||||
|
||||
/**
|
||||
* @brief Get chip revision
|
||||
*
|
||||
* @return Chip revision number
|
||||
*/
|
||||
uint8_t bootloader_common_get_chip_revision(void);
|
||||
|
||||
/**
|
||||
* @brief Get chip package
|
||||
*
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "esp_assert.h"
|
||||
|
||||
/**
|
||||
* @brief ESP chip ID
|
||||
@@ -21,7 +22,7 @@ typedef enum {
|
||||
} __attribute__((packed)) esp_chip_id_t;
|
||||
|
||||
/** @cond */
|
||||
_Static_assert(sizeof(esp_chip_id_t) == 2, "esp_chip_id_t should be 16 bit");
|
||||
ESP_STATIC_ASSERT(sizeof(esp_chip_id_t) == 2, "esp_chip_id_t should be 16 bit");
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
@@ -88,7 +89,7 @@ typedef struct {
|
||||
} __attribute__((packed)) esp_image_header_t;
|
||||
|
||||
/** @cond */
|
||||
_Static_assert(sizeof(esp_image_header_t) == 24, "binary image header should be 24 bytes");
|
||||
ESP_STATIC_ASSERT(sizeof(esp_image_header_t) == 24, "binary image header should be 24 bytes");
|
||||
/** @endcond */
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <esp_err.h>
|
||||
#include "esp_flash_partitions.h"
|
||||
#include "esp_app_format.h"
|
||||
#include "esp_assert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -53,12 +54,18 @@ typedef struct {
|
||||
uint32_t crc; /*!< Check sum crc32 */
|
||||
} rtc_retain_mem_t;
|
||||
|
||||
|
||||
ESP_STATIC_ASSERT(offsetof(rtc_retain_mem_t, crc) == sizeof(rtc_retain_mem_t) - sizeof(uint32_t), "CRC field must be the last field of rtc_retain_mem_t structure");
|
||||
|
||||
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
|
||||
_Static_assert(CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE % 4 == 0, "CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE must be a multiple of 4 bytes");
|
||||
ESP_STATIC_ASSERT(CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE % 4 == 0, "CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE must be a multiple of 4 bytes");
|
||||
/* The custom field must be the penultimate field */
|
||||
ESP_STATIC_ASSERT(offsetof(rtc_retain_mem_t, custom) == sizeof(rtc_retain_mem_t) - sizeof(uint32_t) - CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE,
|
||||
"custom field in rtc_retain_mem_t structure must be the field before the CRC one");
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP) || defined(CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC)
|
||||
_Static_assert(CONFIG_BOOTLOADER_RESERVE_RTC_SIZE % 4 == 0, "CONFIG_BOOTLOADER_RESERVE_RTC_SIZE must be a multiple of 4 bytes");
|
||||
ESP_STATIC_ASSERT(CONFIG_BOOTLOADER_RESERVE_RTC_SIZE % 4 == 0, "CONFIG_BOOTLOADER_RESERVE_RTC_SIZE must be a multiple of 4 bytes");
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
|
||||
@@ -68,7 +75,7 @@ _Static_assert(CONFIG_BOOTLOADER_RESERVE_RTC_SIZE % 4 == 0, "CONFIG_BOOTLOADER_R
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP) || defined(CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC)
|
||||
_Static_assert(sizeof(rtc_retain_mem_t) <= ESP_BOOTLOADER_RESERVE_RTC, "Reserved RTC area must exceed size of rtc_retain_mem_t");
|
||||
ESP_STATIC_ASSERT(sizeof(rtc_retain_mem_t) <= ESP_BOOTLOADER_RESERVE_RTC, "Reserved RTC area must exceed size of rtc_retain_mem_t");
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -24,10 +24,13 @@
|
||||
#define CMD_RDID 0x9F
|
||||
#define CMD_WRSR 0x01
|
||||
#define CMD_WRSR2 0x31 /* Not all SPI flash uses this command */
|
||||
#define CMD_WRSR3 0x11 /* Not all SPI flash uses this command */
|
||||
#define CMD_WREN 0x06
|
||||
#define CMD_WRENVSR 0x50 /* Flash write enable for volatile SR bits */
|
||||
#define CMD_WRDI 0x04
|
||||
#define CMD_RDSR 0x05
|
||||
#define CMD_RDSR2 0x35 /* Not all SPI flash uses this command */
|
||||
#define CMD_RDSR3 0x15 /* Not all SPI flash uses this command */
|
||||
#define CMD_OTPEN 0x3A /* Enable OTP mode, not all SPI flash uses this command */
|
||||
#define CMD_RDSFDP 0x5A /* Read the SFDP of the flash */
|
||||
#define CMD_WRAP 0x77 /* Set burst with wrap command */
|
||||
@@ -171,4 +174,12 @@ uint32_t bootloader_flash_read_sfdp(uint32_t sfdp_addr, unsigned int miso_byte_n
|
||||
*/
|
||||
void bootloader_enable_wp(void);
|
||||
|
||||
/**
|
||||
* @brief Once this function is called,
|
||||
* any on-going internal operations will be terminated and the device will return to its default power-on
|
||||
* state and lose all the current volatile settings, such as Volatile Status Register bits, Write Enable Latch
|
||||
* (WEL) status, Program/Erase Suspend status, etc.
|
||||
*/
|
||||
void bootloader_spi_flash_reset(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#include "soc/dport_reg.h"
|
||||
#endif
|
||||
#include "hal/efuse_hal.h"
|
||||
#include "esp_rom_sys.h"
|
||||
#include "esp_rom_uart.h"
|
||||
|
||||
@@ -32,8 +33,7 @@ __attribute__((weak)) void bootloader_clock_configure(void)
|
||||
* document). For rev. 0, switch to 240 instead if it has been enabled
|
||||
* previously.
|
||||
*/
|
||||
uint32_t chip_ver_reg = REG_READ(EFUSE_BLK0_RDATA3_REG);
|
||||
if ((chip_ver_reg & EFUSE_RD_CHIP_VER_REV1_M) == 0 &&
|
||||
if (efuse_hal_get_major_chip_version() == 0 &&
|
||||
DPORT_REG_GET_FIELD(DPORT_CPU_PER_CONF_REG, DPORT_CPUPERIOD_SEL) == DPORT_CPUPERIOD_SEL_240) {
|
||||
cpu_freq_mhz = 240;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "soc/gpio_periph.h"
|
||||
#include "soc/rtc.h"
|
||||
#include "soc/efuse_reg.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
#include "soc/soc_memory_types.h"
|
||||
#include "hal/gpio_ll.h"
|
||||
#include "esp_image_format.h"
|
||||
@@ -69,7 +70,13 @@ esp_err_t bootloader_common_check_chip_validity(const esp_image_header_t* img_hd
|
||||
}
|
||||
|
||||
#ifndef CONFIG_IDF_ENV_FPGA
|
||||
uint8_t revision = bootloader_common_get_chip_revision();
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32H2)
|
||||
uint8_t revision = efuse_hal_get_major_chip_version();
|
||||
// min_chip_rev keeps the MAJOR wafer version for these chips
|
||||
#else
|
||||
uint8_t revision = efuse_hal_get_minor_chip_version();
|
||||
// min_chip_rev keeps the MINOR wafer version for these chips
|
||||
#endif
|
||||
if (revision < img_hdr->min_chip_rev) {
|
||||
/* To fix this error, please update mininum supported chip revision from configuration,
|
||||
* located in TARGET (e.g. ESP32) specific options under "Component config" menu */
|
||||
@@ -139,6 +146,8 @@ esp_err_t bootloader_common_get_partition_description(const esp_partition_pos_t
|
||||
|
||||
#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
|
||||
@@ -151,14 +160,25 @@ rtc_retain_mem_t *const rtc_retain_mem = (rtc_retain_mem_t *)RTC_RETAIN_MEM_ADDR
|
||||
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
|
||||
* the have the user updating the CRC. Return the offset of the custom field, which is equivalent to size of the structure
|
||||
* 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);
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool check_rtc_retain_mem(void)
|
||||
{
|
||||
return esp_rom_crc32_le(UINT32_MAX, (uint8_t*)rtc_retain_mem, sizeof(rtc_retain_mem_t) - sizeof(rtc_retain_mem->crc)) == rtc_retain_mem->crc && rtc_retain_mem->crc != UINT32_MAX;
|
||||
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->crc = esp_rom_crc32_le(UINT32_MAX, (uint8_t*)rtc_retain_mem, sizeof(rtc_retain_mem_t) - sizeof(rtc_retain_mem->crc));
|
||||
rtc_retain_mem->crc = esp_rom_crc32_le(UINT32_MAX, (uint8_t*)rtc_retain_mem, rtc_retain_mem_size());
|
||||
}
|
||||
|
||||
void bootloader_common_reset_rtc_retain_mem(void)
|
||||
|
||||
@@ -44,12 +44,7 @@ void bootloader_console_init(void)
|
||||
{
|
||||
const int uart_num = CONFIG_ESP_CONSOLE_UART_NUM;
|
||||
|
||||
#if !ESP_ROM_SUPPORT_MULTIPLE_UART
|
||||
/* esp_rom_install_channel_put is not available unless multiple UARTs are supported */
|
||||
esp_rom_install_uart_printf();
|
||||
#else
|
||||
esp_rom_install_channel_putc(1, esp_rom_uart_putc);
|
||||
#endif
|
||||
|
||||
// Wait for UART FIFO to be empty.
|
||||
esp_rom_uart_tx_wait_idle(0);
|
||||
@@ -58,10 +53,10 @@ void bootloader_console_init(void)
|
||||
// Some constants to make the following code less upper-case
|
||||
const int uart_tx_gpio = CONFIG_ESP_CONSOLE_UART_TX_GPIO;
|
||||
const int uart_rx_gpio = CONFIG_ESP_CONSOLE_UART_RX_GPIO;
|
||||
|
||||
// Switch to the new UART (this just changes UART number used for esp_rom_printf in ROM code).
|
||||
#if ESP_ROM_SUPPORT_MULTIPLE_UART
|
||||
esp_rom_uart_set_as_console(uart_num);
|
||||
#endif
|
||||
|
||||
// If console is attached to UART1 or if non-default pins are used,
|
||||
// need to reconfigure pins using GPIO matrix
|
||||
if (uart_num != 0 ||
|
||||
|
||||
37
components/bootloader_support/src/bootloader_efuse.c
Normal file
37
components/bootloader_support/src/bootloader_efuse.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "sdkconfig.h"
|
||||
#include "bootloader_common.h"
|
||||
#include "hal/efuse_ll.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
#include "esp_attr.h"
|
||||
|
||||
IRAM_ATTR uint32_t bootloader_common_get_chip_ver_pkg(void)
|
||||
{
|
||||
return efuse_ll_get_chip_ver_pkg();
|
||||
}
|
||||
|
||||
int bootloader_clock_get_rated_freq_mhz(void)
|
||||
{
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||
return efuse_hal_get_rated_freq_mhz();
|
||||
|
||||
#elif CONFIG_IDF_TARGET_ESP32C3
|
||||
return 160;
|
||||
|
||||
#elif CONFIG_IDF_TARGET_ESP32H2
|
||||
return 96;
|
||||
|
||||
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||
return 240;
|
||||
|
||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||
return 240;
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "bootloader_common.h"
|
||||
#include "bootloader_clock.h"
|
||||
#include "soc/efuse_reg.h"
|
||||
#include "soc/syscon_reg.h"
|
||||
#include "esp_attr.h"
|
||||
|
||||
IRAM_ATTR uint8_t bootloader_common_get_chip_revision(void)
|
||||
{
|
||||
uint8_t eco_bit0, eco_bit1, eco_bit2;
|
||||
eco_bit0 = (REG_READ(EFUSE_BLK0_RDATA3_REG) & 0xF000) >> 15;
|
||||
eco_bit1 = (REG_READ(EFUSE_BLK0_RDATA5_REG) & 0x100000) >> 20;
|
||||
eco_bit2 = (REG_READ(SYSCON_DATE_REG) & 0x80000000) >> 31;
|
||||
uint32_t combine_value = (eco_bit2 << 2) | (eco_bit1 << 1) | eco_bit0;
|
||||
uint8_t chip_ver = 0;
|
||||
switch (combine_value) {
|
||||
case 0:
|
||||
chip_ver = 0;
|
||||
break;
|
||||
case 1:
|
||||
chip_ver = 1;
|
||||
break;
|
||||
case 3:
|
||||
chip_ver = 2;
|
||||
break;
|
||||
#if CONFIG_IDF_ENV_FPGA
|
||||
case 4: /* Empty efuses, but SYSCON_DATE_REG bit is set */
|
||||
chip_ver = 3;
|
||||
break;
|
||||
#endif
|
||||
case 7:
|
||||
chip_ver = 3;
|
||||
break;
|
||||
default:
|
||||
chip_ver = 0;
|
||||
break;
|
||||
}
|
||||
return chip_ver;
|
||||
}
|
||||
|
||||
IRAM_ATTR uint32_t bootloader_common_get_chip_ver_pkg(void)
|
||||
{
|
||||
uint32_t pkg_version = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_PKG);
|
||||
uint32_t pkg_version_4bit = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_PKG_4BIT);
|
||||
return (pkg_version_4bit << 3) | pkg_version;
|
||||
}
|
||||
|
||||
int bootloader_clock_get_rated_freq_mhz()
|
||||
{
|
||||
//Check if ESP32 is rated for a CPU frequency of 160MHz only
|
||||
if (REG_GET_BIT(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_CPU_FREQ_RATED) &&
|
||||
REG_GET_BIT(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_CPU_FREQ_LOW)) {
|
||||
return 160;
|
||||
}
|
||||
return 240;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "soc/efuse_reg.h"
|
||||
#include "esp_attr.h"
|
||||
|
||||
IRAM_ATTR uint8_t bootloader_common_get_chip_revision(void)
|
||||
{
|
||||
// should return the same value as esp_efuse_get_chip_ver()
|
||||
return REG_GET_FIELD(EFUSE_RD_MAC_SPI_SYS_3_REG, EFUSE_WAFER_VERSION);
|
||||
}
|
||||
|
||||
IRAM_ATTR uint32_t bootloader_common_get_chip_ver_pkg(void)
|
||||
{
|
||||
// should return the same value as esp_efuse_get_pkg_ver()
|
||||
return REG_GET_FIELD(EFUSE_RD_MAC_SPI_SYS_3_REG, EFUSE_PKG_VERSION);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "soc/efuse_reg.h"
|
||||
#include "esp_attr.h"
|
||||
|
||||
IRAM_ATTR uint8_t bootloader_common_get_chip_revision(void)
|
||||
{
|
||||
// should return the same value as esp_efuse_get_chip_ver()
|
||||
return REG_GET_FIELD(EFUSE_RD_MAC_SPI_SYS_3_REG, EFUSE_WAFER_VERSION);
|
||||
}
|
||||
|
||||
IRAM_ATTR uint32_t bootloader_common_get_chip_ver_pkg(void)
|
||||
{
|
||||
// should return the same value as esp_efuse_get_pkg_ver()
|
||||
return REG_GET_FIELD(EFUSE_RD_MAC_SPI_SYS_3_REG, EFUSE_PKG_VERSION);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "sdkconfig.h"
|
||||
#include "bootloader_clock.h"
|
||||
#include "bootloader_common.h"
|
||||
#include "soc/efuse_reg.h"
|
||||
#include "esp_attr.h"
|
||||
|
||||
IRAM_ATTR uint8_t bootloader_common_get_chip_revision(void)
|
||||
{
|
||||
// should return the same value as esp_efuse_get_chip_ver()
|
||||
return REG_GET_FIELD(EFUSE_RD_MAC_SPI_SYS_3_REG, EFUSE_WAFER_VERSION);
|
||||
}
|
||||
|
||||
IRAM_ATTR uint32_t bootloader_common_get_chip_ver_pkg(void)
|
||||
{
|
||||
// should return the same value as esp_efuse_get_pkg_ver()
|
||||
return REG_GET_FIELD(EFUSE_RD_MAC_SPI_SYS_4_REG, EFUSE_PKG_VERSION);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "esp_attr.h"
|
||||
|
||||
IRAM_ATTR uint8_t bootloader_common_get_chip_revision(void)
|
||||
{
|
||||
// should return the same value as esp_efuse_get_chip_ver()
|
||||
/* No other revisions for ESP32-S3 */
|
||||
return 0;
|
||||
}
|
||||
|
||||
IRAM_ATTR uint32_t bootloader_common_get_chip_ver_pkg(void)
|
||||
{
|
||||
// should return the same value as esp_efuse_get_pkg_ver()
|
||||
return 0;
|
||||
}
|
||||
@@ -573,7 +573,7 @@ esp_err_t IRAM_ATTR __attribute__((weak)) bootloader_flash_unlock(void)
|
||||
#ifndef g_rom_spiflash_dummy_len_plus // ESP32-C3 uses a macro to access ROM data here
|
||||
extern uint8_t g_rom_spiflash_dummy_len_plus[];
|
||||
#endif
|
||||
IRAM_ATTR static uint32_t bootloader_flash_execute_command_common(
|
||||
IRAM_ATTR uint32_t bootloader_flash_execute_command_common(
|
||||
uint8_t command,
|
||||
uint32_t addr_len, uint32_t address,
|
||||
uint8_t dummy_len,
|
||||
@@ -603,14 +603,12 @@ IRAM_ATTR static uint32_t bootloader_flash_execute_command_common(
|
||||
SPIFLASH.addr = address;
|
||||
#endif
|
||||
//dummy phase
|
||||
uint32_t total_dummy = dummy_len;
|
||||
if (miso_len > 0) {
|
||||
uint32_t total_dummy = dummy_len + g_rom_spiflash_dummy_len_plus[1];
|
||||
SPIFLASH.user.usr_dummy = total_dummy > 0;
|
||||
SPIFLASH.user1.usr_dummy_cyclelen = total_dummy - 1;
|
||||
} else {
|
||||
SPIFLASH.user.usr_dummy = 0;
|
||||
SPIFLASH.user1.usr_dummy_cyclelen = 0;
|
||||
total_dummy += g_rom_spiflash_dummy_len_plus[1];
|
||||
}
|
||||
SPIFLASH.user.usr_dummy = total_dummy > 0;
|
||||
SPIFLASH.user1.usr_dummy_cyclelen = total_dummy - 1;
|
||||
//output data
|
||||
SPIFLASH.user.usr_mosi = mosi_len > 0;
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
@@ -679,6 +677,12 @@ uint32_t IRAM_ATTR bootloader_read_flash_id(void)
|
||||
return id;
|
||||
}
|
||||
|
||||
void bootloader_spi_flash_reset(void)
|
||||
{
|
||||
bootloader_execute_flash_command(0x66, 0, 0, 0);
|
||||
bootloader_execute_flash_command(0x99, 0, 0, 0);
|
||||
}
|
||||
|
||||
#if SOC_CACHE_SUPPORT_WRAP
|
||||
esp_err_t bootloader_flash_wrap_set(spi_flash_wrap_mode_t mode)
|
||||
{
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "soc/spi_reg.h"
|
||||
#include "soc/soc_caps.h"
|
||||
#include "soc/soc_pins.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
#include "hal/gpio_hal.h"
|
||||
#include "flash_qio_mode.h"
|
||||
#include "bootloader_common.h"
|
||||
@@ -176,7 +177,7 @@ int bootloader_flash_get_wp_pin(void)
|
||||
return ESP32_D2WD_WP_GPIO;
|
||||
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4:
|
||||
/* Same package IDs are used for ESP32-PICO-V3 and ESP32-PICO-D4, silicon version differentiates */
|
||||
chip_ver = bootloader_common_get_chip_revision();
|
||||
chip_ver = efuse_hal_get_major_chip_version();
|
||||
return (chip_ver < 3) ? ESP32_D2WD_WP_GPIO : ESP32_PICO_V3_GPIO;
|
||||
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOV302:
|
||||
return ESP32_PICO_V3_GPIO;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "soc/cpu.h"
|
||||
#include "soc/rtc.h"
|
||||
#include "hal/wdt_hal.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
|
||||
static const char *TAG = "boot";
|
||||
|
||||
@@ -40,9 +41,10 @@ esp_err_t bootloader_read_bootloader_header(void)
|
||||
|
||||
esp_err_t bootloader_check_bootloader_validity(void)
|
||||
{
|
||||
/* read chip revision from efuse */
|
||||
uint8_t revision = bootloader_common_get_chip_revision();
|
||||
ESP_LOGI(TAG, "chip revision: %d", revision);
|
||||
unsigned revision = efuse_hal_chip_revision();
|
||||
unsigned major = revision / 100;
|
||||
unsigned minor = revision % 100;
|
||||
ESP_LOGI(TAG, "chip revision: v%d.%d", major, minor);
|
||||
/* compare with the one set in bootloader image header */
|
||||
if (bootloader_common_check_chip_validity(&bootloader_image_hdr, ESP_IMAGE_BOOTLOADER) != ESP_OK) {
|
||||
return ESP_FAIL;
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "bootloader_flash_priv.h"
|
||||
#include "bootloader_soc.h"
|
||||
#include "esp_efuse.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
|
||||
static const char *TAG = "boot.esp32c3";
|
||||
|
||||
@@ -258,7 +259,7 @@ static inline void bootloader_hardware_init(void)
|
||||
{
|
||||
// This check is always included in the bootloader so it can
|
||||
// print the minimum revision error message later in the boot
|
||||
if (bootloader_common_get_chip_revision() < 3) {
|
||||
if (efuse_hal_get_minor_chip_version() < 3) {
|
||||
REGI2C_WRITE_MASK(I2C_ULP, I2C_ULP_IR_FORCE_XPD_IPH, 1);
|
||||
REGI2C_WRITE_MASK(I2C_BIAS, I2C_BIAS_DREG_1P1_PVT, 12);
|
||||
}
|
||||
@@ -271,7 +272,7 @@ static inline void bootloader_ana_reset_config(void)
|
||||
For ECO2: fix brownout reset bug, support swt & brownout reset;
|
||||
For ECO3: fix clock glitch reset bug, support all reset, include: swt & brownout & clock glitch reset.
|
||||
*/
|
||||
uint8_t chip_version = bootloader_common_get_chip_revision();
|
||||
uint8_t chip_version = efuse_hal_get_minor_chip_version();
|
||||
switch (chip_version) {
|
||||
case 0:
|
||||
case 1:
|
||||
|
||||
@@ -218,6 +218,11 @@ static esp_err_t bootloader_init_spi_flash(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_SPI_FLASH_HPM_ENABLE
|
||||
// Reset flash, clear volatile bits DC[0:1]. Make it work under default mode to boot.
|
||||
bootloader_spi_flash_reset();
|
||||
#endif
|
||||
|
||||
bootloader_flash_unlock();
|
||||
|
||||
#if CONFIG_ESPTOOLPY_FLASHMODE_QIO || CONFIG_ESPTOOLPY_FLASHMODE_QOUT
|
||||
|
||||
@@ -174,7 +174,12 @@ void esp_flash_encryption_set_release_mode(void)
|
||||
ESP_LOGE(TAG, "Flash Encryption support not added, abort..");
|
||||
abort();
|
||||
#endif
|
||||
|
||||
#if CONFIG_SOC_SUPPORTS_SECURE_DL_MODE
|
||||
esp_efuse_enable_rom_secure_download_mode();
|
||||
#else
|
||||
esp_efuse_disable_rom_download_mode();
|
||||
#endif
|
||||
esp_efuse_batch_write_commit();
|
||||
|
||||
if (esp_get_flash_encryption_mode() != ESP_FLASH_ENC_MODE_RELEASE) {
|
||||
|
||||
@@ -168,6 +168,11 @@ unsigned bootloader_read_status_8b_rdsr2(void)
|
||||
return bootloader_execute_flash_command(CMD_RDSR2, 0, 0, 8);
|
||||
}
|
||||
|
||||
unsigned bootloader_read_status_8b_rdsr3(void)
|
||||
{
|
||||
return bootloader_execute_flash_command(CMD_RDSR3, 0, 0, 8);
|
||||
}
|
||||
|
||||
unsigned bootloader_read_status_16b_rdsr_rdsr2(void)
|
||||
{
|
||||
return bootloader_execute_flash_command(CMD_RDSR, 0, 0, 8) | (bootloader_execute_flash_command(CMD_RDSR2, 0, 0, 8) << 8);
|
||||
@@ -183,6 +188,11 @@ void bootloader_write_status_8b_wrsr2(unsigned new_status)
|
||||
bootloader_execute_flash_command(CMD_WRSR2, new_status, 8, 0);
|
||||
}
|
||||
|
||||
void bootloader_write_status_8b_wrsr3(unsigned new_status)
|
||||
{
|
||||
bootloader_execute_flash_command(CMD_WRSR3, new_status, 8, 0);
|
||||
}
|
||||
|
||||
void bootloader_write_status_16b_wrsr(unsigned new_status)
|
||||
{
|
||||
bootloader_execute_flash_command(CMD_WRSR, new_status, 16, 0);
|
||||
|
||||
@@ -247,7 +247,7 @@ static esp_err_t check_and_generate_secure_boot_keys(const esp_image_metadata_t
|
||||
|
||||
ESP_LOGI(TAG, "%d signature block(s) found appended to the app.", app_key_digests.num_digests);
|
||||
if (app_key_digests.num_digests > boot_key_digests.num_digests) {
|
||||
ESP_LOGW(TAG, "App has %d signature blocks but bootloader only has %d. Some keys missing from bootloader?");
|
||||
ESP_LOGW(TAG, "App has %d signature blocks but bootloader only has %d. Some keys missing from bootloader?", app_key_digests.num_digests, boot_key_digests.num_digests);
|
||||
}
|
||||
|
||||
/* Confirm if at least one public key from the application matches a public key in the bootloader
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# The following lines of boilerplate have to be in your project's
|
||||
# CMakeLists in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(test_rtc_custom_section)
|
||||
@@ -0,0 +1,2 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- |
|
||||
@@ -0,0 +1,2 @@
|
||||
idf_component_register(SRCS "test_main.c"
|
||||
INCLUDE_DIRS ".")
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "bootloader_common.h"
|
||||
#include <stdio.h>
|
||||
#include "sdkconfig.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
|
||||
#define TEST_MAGIC_VALUE 0x42987561
|
||||
|
||||
extern rtc_retain_mem_t* bootloader_common_get_rtc_retain_mem(void);
|
||||
|
||||
void app_main(void) {
|
||||
rtc_retain_mem_t* mem = bootloader_common_get_rtc_retain_mem();
|
||||
uint32_t* _rtc_vars = (uint32_t*) mem->custom;
|
||||
|
||||
if (_rtc_vars[0] != TEST_MAGIC_VALUE) {
|
||||
/* On the first boot, set the data inside the array */
|
||||
_rtc_vars[0] = TEST_MAGIC_VALUE;
|
||||
} else {
|
||||
/* Second boot, the data was saved saved, success */
|
||||
printf("SUCCESS: data were saved across reboot\n");
|
||||
vTaskDelay(10000 / portTICK_PERIOD_MS);
|
||||
}
|
||||
|
||||
esp_restart();
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0x10
|
||||
CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC=y
|
||||
CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE=0x200
|
||||
@@ -46,7 +46,8 @@ esp_err_t esp_blufi_send_wifi_conn_report(wifi_mode_t opmode, esp_blufi_sta_conn
|
||||
arg.wifi_conn_report.softap_conn_num = softap_conn_num;
|
||||
arg.wifi_conn_report.extra_info = extra_info;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_blufi_args_t), btc_blufi_call_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_blufi_args_t), btc_blufi_call_deep_copy,
|
||||
btc_blufi_call_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_blufi_send_wifi_list(uint16_t apCount, esp_blufi_ap_record_t *list)
|
||||
@@ -62,7 +63,8 @@ esp_err_t esp_blufi_send_wifi_list(uint16_t apCount, esp_blufi_ap_record_t *list
|
||||
arg.wifi_list.apCount = apCount;
|
||||
arg.wifi_list.list = list;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_blufi_args_t), btc_blufi_call_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_blufi_args_t), btc_blufi_call_deep_copy,
|
||||
btc_blufi_call_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_blufi_profile_init(void)
|
||||
@@ -75,7 +77,7 @@ esp_err_t esp_blufi_profile_init(void)
|
||||
msg.pid = BTC_PID_BLUFI;
|
||||
msg.act = BTC_BLUFI_ACT_INIT;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_blufi_profile_deinit(void)
|
||||
@@ -88,7 +90,7 @@ esp_err_t esp_blufi_profile_deinit(void)
|
||||
msg.pid = BTC_PID_BLUFI;
|
||||
msg.act = BTC_BLUFI_ACT_DEINIT;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
uint16_t esp_blufi_get_version(void)
|
||||
@@ -108,7 +110,7 @@ esp_err_t esp_blufi_send_error_info(esp_blufi_error_state_t state)
|
||||
msg.act = BTC_BLUFI_ACT_SEND_ERR_INFO;
|
||||
arg.blufi_err_infor.state = state;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_blufi_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_blufi_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_blufi_send_custom_data(uint8_t *data, uint32_t data_len)
|
||||
@@ -126,6 +128,7 @@ esp_err_t esp_blufi_send_custom_data(uint8_t *data, uint32_t data_len)
|
||||
arg.custom_data.data = data;
|
||||
arg.custom_data.data_len = data_len;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_blufi_args_t), btc_blufi_call_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_blufi_args_t), btc_blufi_call_deep_copy,
|
||||
btc_blufi_call_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif ///BLUFI_INCLUDED == TRUE
|
||||
|
||||
@@ -57,6 +57,8 @@ typedef enum {
|
||||
typedef enum {
|
||||
ESP_BLUFI_STA_CONN_SUCCESS = 0x00,
|
||||
ESP_BLUFI_STA_CONN_FAIL = 0x01,
|
||||
ESP_BLUFI_STA_CONNECTING = 0x02,
|
||||
ESP_BLUFI_STA_NO_IP = 0x03,
|
||||
} esp_blufi_sta_conn_state_t;
|
||||
|
||||
/// BLUFI init status
|
||||
@@ -82,6 +84,8 @@ typedef enum {
|
||||
ESP_BLUFI_READ_PARAM_ERROR,
|
||||
ESP_BLUFI_MAKE_PUBLIC_ERROR,
|
||||
ESP_BLUFI_DATA_FORMAT_ERROR,
|
||||
ESP_BLUFI_CALC_MD5_ERROR,
|
||||
ESP_BLUFI_WIFI_SCAN_FAIL,
|
||||
} esp_blufi_error_state_t;
|
||||
|
||||
/**
|
||||
@@ -105,6 +109,12 @@ typedef struct {
|
||||
bool softap_max_conn_num_set; /*!< is max connection number of softap interface set */
|
||||
uint8_t softap_channel; /*!< channel of softap interface */
|
||||
bool softap_channel_set; /*!< is channel of softap interface set */
|
||||
uint8_t sta_max_conn_retry; /*!< max retry of sta establish connection */
|
||||
bool sta_max_conn_retry_set; /*!< is max retry of sta establish connection set */
|
||||
uint8_t sta_conn_end_reason; /*!< reason of sta connection end */
|
||||
bool sta_conn_end_reason_set; /*!< is reason of sta connection end set */
|
||||
int8_t sta_conn_rssi; /*!< rssi of sta connection */
|
||||
bool sta_conn_rssi_set; /*!< is rssi of sta connection set */
|
||||
} esp_blufi_extra_info_t;
|
||||
|
||||
/** @brief Description of an WiFi AP */
|
||||
|
||||
@@ -206,9 +206,6 @@ static void btc_thread_handler(void *arg)
|
||||
break;
|
||||
}
|
||||
|
||||
if (msg->arg) {
|
||||
osi_free(msg->arg);
|
||||
}
|
||||
osi_free(msg);
|
||||
}
|
||||
|
||||
@@ -227,59 +224,61 @@ static bt_status_t btc_task_post(btc_msg_t *msg, uint32_t timeout)
|
||||
* @param arg paramter
|
||||
* @param arg_len length of paramter
|
||||
* @param copy_func deep copy function
|
||||
* @param free_func deep free function
|
||||
* @return BT_STATUS_SUCCESS: success
|
||||
* others: fail
|
||||
*/
|
||||
bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg_deep_copy_t copy_func)
|
||||
bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg_deep_copy_t copy_func,
|
||||
btc_arg_deep_free_t free_func)
|
||||
{
|
||||
btc_msg_t* lmsg;
|
||||
|
||||
bt_status_t ret;
|
||||
// arg XOR arg_len
|
||||
if ((msg == NULL) || ((arg == NULL) == !(arg_len == 0))) {
|
||||
BTC_TRACE_WARNING("%s Invalid parameters\n", __func__);
|
||||
return BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
|
||||
BTC_TRACE_DEBUG("%s msg %u %u %u %p\n", __func__, msg->sig, msg->pid, msg->act, arg);
|
||||
|
||||
lmsg = (btc_msg_t *)osi_malloc(sizeof(btc_msg_t));
|
||||
lmsg = (btc_msg_t *)osi_malloc(sizeof(btc_msg_t) + arg_len);
|
||||
if (lmsg == NULL) {
|
||||
BTC_TRACE_WARNING("%s No memory\n", __func__);
|
||||
return BT_STATUS_NOMEM;
|
||||
}
|
||||
|
||||
memcpy(lmsg, msg, sizeof(btc_msg_t));
|
||||
if (arg) {
|
||||
lmsg->arg = (void *)osi_malloc(arg_len);
|
||||
if (lmsg->arg == NULL) {
|
||||
osi_free(lmsg);
|
||||
return BT_STATUS_NOMEM;
|
||||
}
|
||||
memset(lmsg->arg, 0x00, arg_len); //important, avoid arg which have no length
|
||||
memcpy(lmsg->arg, arg, arg_len);
|
||||
if (copy_func) {
|
||||
copy_func(lmsg, lmsg->arg, arg);
|
||||
}
|
||||
} else {
|
||||
lmsg->arg = NULL;
|
||||
}
|
||||
|
||||
return btc_task_post(lmsg, OSI_THREAD_MAX_TIMEOUT);
|
||||
ret = btc_task_post(lmsg, OSI_THREAD_MAX_TIMEOUT);
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
if (copy_func && free_func) {
|
||||
free_func(lmsg);
|
||||
}
|
||||
osi_free(lmsg);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* transfer an message to another module in tha same task.
|
||||
* @param msg message
|
||||
* @param arg paramter
|
||||
* @return BT_STATUS_SUCCESS: success
|
||||
* others: fail
|
||||
*/
|
||||
bt_status_t btc_inter_profile_call(btc_msg_t *msg, void *arg)
|
||||
bt_status_t btc_inter_profile_call(btc_msg_t *msg)
|
||||
{
|
||||
if (msg == NULL) {
|
||||
return BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
|
||||
msg->arg = arg;
|
||||
switch (msg->sig) {
|
||||
case BTC_SIG_API_CALL:
|
||||
profile_tab[msg->pid].btc_call(msg);
|
||||
|
||||
@@ -28,7 +28,7 @@ typedef struct btc_msg {
|
||||
uint8_t aid; //application id
|
||||
uint8_t pid; //profile id
|
||||
uint8_t act; //profile action, defined in seprerate header files
|
||||
void *arg; //param for btc function or function param
|
||||
UINT8 arg[0]; //param for btc function or function param
|
||||
} btc_msg_t;
|
||||
|
||||
typedef struct btc_adv_packet {
|
||||
@@ -100,6 +100,7 @@ typedef struct {
|
||||
} btc_func_t;
|
||||
|
||||
typedef void (* btc_arg_deep_copy_t)(btc_msg_t *msg, void *dst, void *src);
|
||||
typedef void (* btc_arg_deep_free_t)(btc_msg_t *msg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -111,19 +112,20 @@ extern "C" {
|
||||
* @param arg paramter
|
||||
* @param arg_len length of paramter
|
||||
* @param copy_func deep copy function
|
||||
* @param free_func deep free function
|
||||
* @return BT_STATUS_SUCCESS: success
|
||||
* others: fail
|
||||
*/
|
||||
bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg_deep_copy_t copy_func);
|
||||
bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg_deep_copy_t copy_func,
|
||||
btc_arg_deep_free_t free_func);
|
||||
|
||||
/**
|
||||
* transfer an message to another module in tha same task.
|
||||
* @param msg message
|
||||
* @param arg paramter
|
||||
* @return BT_STATUS_SUCCESS: success
|
||||
* others: fail
|
||||
*/
|
||||
bt_status_t btc_inter_profile_call(btc_msg_t *msg, void *arg);
|
||||
bt_status_t btc_inter_profile_call(btc_msg_t *msg);
|
||||
|
||||
bt_status_t btc_init(void);
|
||||
void btc_deinit(void);
|
||||
|
||||
@@ -144,7 +144,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
|
||||
msg.act = ESP_BLUFI_EVENT_DEINIT_FINISH;
|
||||
param.deinit_finish.state = ESP_BLUFI_DEINIT_OK;
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL, NULL);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -283,7 +283,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
|
||||
msg.act = ESP_BLUFI_EVENT_INIT_FINISH;
|
||||
param.init_finish.state = ESP_BLUFI_INIT_OK;
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL, NULL);
|
||||
break;
|
||||
}
|
||||
case BTA_GATTS_CONNECT_EVT: {
|
||||
@@ -307,7 +307,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
|
||||
param.connect.conn_id = BTC_GATT_GET_CONN_ID(p_data->conn.conn_id);
|
||||
conn_id = param.connect.conn_id;
|
||||
server_if = p_data->conn.server_if;
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL, NULL);
|
||||
break;
|
||||
}
|
||||
case BTA_GATTS_DISCONNECT_EVT: {
|
||||
@@ -335,7 +335,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
|
||||
msg.pid = BTC_PID_BLUFI;
|
||||
msg.act = ESP_BLUFI_EVENT_BLE_DISCONNECT;
|
||||
memcpy(param.disconnect.remote_bda, p_data->conn.remote_bda, ESP_BLUFI_BD_ADDR_LEN);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL, NULL);
|
||||
break;
|
||||
}
|
||||
case BTA_GATTS_OPEN_EVT:
|
||||
@@ -410,7 +410,7 @@ esp_err_t esp_blufi_close(esp_gatt_if_t gatts_if, uint16_t conn_id)
|
||||
msg.pid = BTC_PID_GATTS;
|
||||
msg.act = BTC_GATTS_ACT_CLOSE;
|
||||
arg.close.conn_id = BTC_GATT_CREATE_CONN_ID(gatts_if, conn_id);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ void btc_blufi_report_error(esp_blufi_error_state_t state)
|
||||
msg.act = ESP_BLUFI_EVENT_REPORT_ERROR;
|
||||
esp_blufi_cb_param_t param;
|
||||
param.report_error.state = state;
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL, NULL);
|
||||
}
|
||||
|
||||
void btc_blufi_recv_handler(uint8_t *data, int len)
|
||||
@@ -321,6 +321,21 @@ static void btc_blufi_wifi_conn_report(uint8_t opmode, uint8_t sta_conn_state, u
|
||||
*p++ = 1;
|
||||
*p++ = info->softap_channel;
|
||||
}
|
||||
if (info->sta_max_conn_retry_set) {
|
||||
*p++ = BLUFI_TYPE_DATA_SUBTYPE_STA_MAX_CONN_RETRY;
|
||||
*p++ = 1;
|
||||
*p++ = info->sta_max_conn_retry;
|
||||
}
|
||||
if (info->sta_conn_end_reason_set) {
|
||||
*p++ = BLUFI_TYPE_DATA_SUBTYPE_STA_CONN_END_REASON;
|
||||
*p++ = 1;
|
||||
*p++ = info->sta_conn_end_reason;
|
||||
}
|
||||
if (info->sta_conn_rssi_set) {
|
||||
*p++ = BLUFI_TYPE_DATA_SUBTYPE_STA_CONN_RSSI;
|
||||
*p++ = 1;
|
||||
*p++ = info->sta_conn_rssi;
|
||||
}
|
||||
}
|
||||
if (p - data > data_len) {
|
||||
BTC_TRACE_ERROR("%s len error %d %d\n", __func__, (int)(p - data), data_len);
|
||||
@@ -714,6 +729,21 @@ void btc_blufi_call_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||
dst->wifi_conn_report.extra_info->softap_channel = src_info->softap_channel;
|
||||
dst->wifi_conn_report.extra_info_len += (1 + 2);
|
||||
}
|
||||
if (src_info->sta_max_conn_retry_set) {
|
||||
dst->wifi_conn_report.extra_info->sta_max_conn_retry_set = src_info->sta_max_conn_retry_set;
|
||||
dst->wifi_conn_report.extra_info->sta_max_conn_retry = src_info->sta_max_conn_retry;
|
||||
dst->wifi_conn_report.extra_info_len += (1 + 2);
|
||||
}
|
||||
if (src_info->sta_conn_end_reason_set) {
|
||||
dst->wifi_conn_report.extra_info->sta_conn_end_reason_set = src_info->sta_conn_end_reason_set;
|
||||
dst->wifi_conn_report.extra_info->sta_conn_end_reason = src_info->sta_conn_end_reason;
|
||||
dst->wifi_conn_report.extra_info_len += (1 + 2);
|
||||
}
|
||||
if (src_info->sta_conn_rssi_set) {
|
||||
dst->wifi_conn_report.extra_info->sta_conn_rssi_set = src_info->sta_conn_rssi_set;
|
||||
dst->wifi_conn_report.extra_info->sta_conn_rssi = src_info->sta_conn_rssi;
|
||||
dst->wifi_conn_report.extra_info_len += (1 + 2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BTC_BLUFI_ACT_SEND_WIFI_LIST:{
|
||||
|
||||
@@ -51,35 +51,35 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
msg.act = ESP_BLUFI_EVENT_SET_WIFI_OPMODE;
|
||||
param.wifi_mode.op_mode = data[0];
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL, NULL);
|
||||
break;
|
||||
case BLUFI_TYPE_CTRL_SUBTYPE_CONN_TO_AP:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_BLUFI;
|
||||
msg.act = ESP_BLUFI_EVENT_REQ_CONNECT_TO_AP;
|
||||
|
||||
btc_transfer_context(&msg, NULL, 0, NULL);
|
||||
btc_transfer_context(&msg, NULL, 0, NULL, NULL);
|
||||
break;
|
||||
case BLUFI_TYPE_CTRL_SUBTYPE_DISCONN_FROM_AP:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_BLUFI;
|
||||
msg.act = ESP_BLUFI_EVENT_REQ_DISCONNECT_FROM_AP;
|
||||
|
||||
btc_transfer_context(&msg, NULL, 0, NULL);
|
||||
btc_transfer_context(&msg, NULL, 0, NULL, NULL);
|
||||
break;
|
||||
case BLUFI_TYPE_CTRL_SUBTYPE_GET_WIFI_STATUS:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_BLUFI;
|
||||
msg.act = ESP_BLUFI_EVENT_GET_WIFI_STATUS;
|
||||
|
||||
btc_transfer_context(&msg, NULL, 0, NULL);
|
||||
btc_transfer_context(&msg, NULL, 0, NULL, NULL);
|
||||
break;
|
||||
case BLUFI_TYPE_CTRL_SUBTYPE_DEAUTHENTICATE_STA:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_BLUFI;
|
||||
msg.act = ESP_BLUFI_EVENT_DEAUTHENTICATE_STA;
|
||||
|
||||
btc_transfer_context(&msg, NULL, 0, NULL);
|
||||
btc_transfer_context(&msg, NULL, 0, NULL,NULL);
|
||||
break;
|
||||
case BLUFI_TYPE_CTRL_SUBTYPE_GET_VERSION: {
|
||||
uint8_t type = BLUFI_BUILD_TYPE(BLUFI_TYPE_DATA, BLUFI_TYPE_DATA_SUBTYPE_REPLY_VERSION);
|
||||
@@ -94,13 +94,13 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_BLUFI;
|
||||
msg.act = ESP_BLUFI_EVENT_RECV_SLAVE_DISCONNECT_BLE;
|
||||
btc_transfer_context(&msg, NULL, 0, NULL);
|
||||
btc_transfer_context(&msg, NULL, 0, NULL, NULL);
|
||||
break;
|
||||
case BLUFI_TYPE_CTRL_SUBTYPE_GET_WIFI_LIST:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_BLUFI;
|
||||
msg.act = ESP_BLUFI_EVENT_GET_WIFI_LIST;
|
||||
btc_transfer_context(&msg, NULL, 0, NULL);
|
||||
btc_transfer_context(&msg, NULL, 0, NULL, NULL);
|
||||
break;
|
||||
default:
|
||||
BTC_TRACE_ERROR("%s Unkown Ctrl pkt %02x\n", __func__, type);
|
||||
@@ -125,7 +125,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
msg.act = ESP_BLUFI_EVENT_RECV_STA_BSSID;
|
||||
memcpy(param.sta_bssid.bssid, &data[0], 6);
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL, NULL);
|
||||
break;
|
||||
case BLUFI_TYPE_DATA_SUBTYPE_STA_SSID:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
@@ -134,7 +134,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
param.sta_ssid.ssid = &data[0];
|
||||
param.sta_ssid.ssid_len = len;
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
|
||||
break;
|
||||
case BLUFI_TYPE_DATA_SUBTYPE_STA_PASSWD:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
@@ -143,7 +143,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
param.sta_passwd.passwd = &data[0];
|
||||
param.sta_passwd.passwd_len = len;
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
|
||||
break;
|
||||
case BLUFI_TYPE_DATA_SUBTYPE_SOFTAP_SSID:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
@@ -152,7 +152,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
param.softap_ssid.ssid = &data[0];
|
||||
param.softap_ssid.ssid_len = len;
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
|
||||
break;
|
||||
case BLUFI_TYPE_DATA_SUBTYPE_SOFTAP_PASSWD:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
@@ -161,7 +161,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
param.softap_passwd.passwd = &data[0];
|
||||
param.softap_passwd.passwd_len = len;
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
|
||||
break;
|
||||
case BLUFI_TYPE_DATA_SUBTYPE_SOFTAP_MAX_CONN_NUM:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
@@ -169,7 +169,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
msg.act = ESP_BLUFI_EVENT_RECV_SOFTAP_MAX_CONN_NUM;
|
||||
param.softap_max_conn_num.max_conn_num = data[0];
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL, NULL);
|
||||
break;
|
||||
case BLUFI_TYPE_DATA_SUBTYPE_SOFTAP_AUTH_MODE:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
@@ -177,7 +177,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
msg.act = ESP_BLUFI_EVENT_RECV_SOFTAP_AUTH_MODE;
|
||||
param.softap_auth_mode.auth_mode = data[0];
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL, NULL);
|
||||
break;
|
||||
case BLUFI_TYPE_DATA_SUBTYPE_SOFTAP_CHANNEL:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
@@ -185,7 +185,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
msg.act = ESP_BLUFI_EVENT_RECV_SOFTAP_CHANNEL;
|
||||
param.softap_channel.channel = data[0];
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL, NULL);
|
||||
break;
|
||||
case BLUFI_TYPE_DATA_SUBTYPE_USERNAME:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
@@ -194,7 +194,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
param.username.name = &data[0];
|
||||
param.username.name_len = len;
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
|
||||
break;
|
||||
case BLUFI_TYPE_DATA_SUBTYPE_CA:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
@@ -203,7 +203,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
param.ca.cert = &data[0];
|
||||
param.ca.cert_len = len;
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
|
||||
break;
|
||||
case BLUFI_TYPE_DATA_SUBTYPE_CLIENT_CERT:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
@@ -212,7 +212,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
param.client_cert.cert = &data[0];
|
||||
param.client_cert.cert_len = len;
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
|
||||
break;
|
||||
case BLUFI_TYPE_DATA_SUBTYPE_SERVER_CERT:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
@@ -221,7 +221,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
param.client_cert.cert = &data[0];
|
||||
param.client_cert.cert_len = len;
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
|
||||
break;
|
||||
case BLUFI_TYPE_DATA_SUBTYPE_CLIENT_PRIV_KEY:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
@@ -230,7 +230,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
param.client_pkey.pkey = &data[0];
|
||||
param.client_pkey.pkey_len = len;
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
|
||||
break;
|
||||
case BLUFI_TYPE_DATA_SUBTYPE_SERVER_PRIV_KEY:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
@@ -239,7 +239,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
param.client_pkey.pkey = &data[0];
|
||||
param.client_pkey.pkey_len = len;
|
||||
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
|
||||
break;
|
||||
case BLUFI_TYPE_DATA_SUBTYPE_CUSTOM_DATA:
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
@@ -247,7 +247,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
|
||||
msg.act = ESP_BLUFI_EVENT_RECV_CUSTOM_DATA;
|
||||
param.custom_data.data = &data[0];
|
||||
param.custom_data.data_len = len;
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
|
||||
break;
|
||||
default:
|
||||
BTC_TRACE_ERROR("%s Unkown Ctrl pkt %02x\n", __func__, type);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#if (BLUFI_INCLUDED == TRUE)
|
||||
|
||||
#define BTC_BLUFI_GREAT_VER 0x01 //Version + Subversion
|
||||
#define BTC_BLUFI_SUB_VER 0x02 //Version + Subversion
|
||||
#define BTC_BLUFI_SUB_VER 0x03 //Version + Subversion
|
||||
#define BTC_BLUFI_VERSION ((BTC_BLUFI_GREAT_VER<<8)|BTC_BLUFI_SUB_VER) //Version + Subversion
|
||||
|
||||
typedef UINT8 tGATT_IF;
|
||||
@@ -129,6 +129,9 @@ extern tBLUFI_ENV *blufi_env_ptr;
|
||||
#define BLUFI_TYPE_DATA_SUBTYPE_WIFI_LIST 0x11
|
||||
#define BLUFI_TYPE_DATA_SUBTYPE_ERROR_INFO 0x12
|
||||
#define BLUFI_TYPE_DATA_SUBTYPE_CUSTOM_DATA 0x13
|
||||
#define BLUFI_TYPE_DATA_SUBTYPE_STA_MAX_CONN_RETRY 0x14
|
||||
#define BLUFI_TYPE_DATA_SUBTYPE_STA_CONN_END_REASON 0x15
|
||||
#define BLUFI_TYPE_DATA_SUBTYPE_STA_CONN_RSSI 0x16
|
||||
#define BLUFI_TYPE_IS_CTRL(type) (BLUFI_GET_TYPE((type)) == BLUFI_TYPE_CTRL)
|
||||
#define BLUFI_TYPE_IS_DATA(type) (BLUFI_GET_TYPE((type)) == BLUFI_TYPE_DATA)
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
|
||||
param.connect.conn_id = event->connect.conn_handle;
|
||||
/* save connection handle */
|
||||
conn_handle = event->connect.conn_handle;
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL, NULL);
|
||||
}
|
||||
if (event->connect.status != 0) {
|
||||
/* Connection failed; resume advertising. */
|
||||
@@ -288,7 +288,7 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
|
||||
msg.pid = BTC_PID_BLUFI;
|
||||
msg.act = ESP_BLUFI_EVENT_BLE_DISCONNECT;
|
||||
memcpy(param.disconnect.remote_bda, event->disconnect.conn.peer_id_addr.val, ESP_BLUFI_BD_ADDR_LEN);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL, NULL);
|
||||
|
||||
return 0;
|
||||
case BLE_GAP_EVENT_CONN_UPDATE:
|
||||
@@ -419,7 +419,7 @@ void esp_blufi_deinit(void)
|
||||
msg.pid = BTC_PID_BLUFI;
|
||||
msg.act = ESP_BLUFI_EVENT_DEINIT_FINISH;
|
||||
param.deinit_finish.state = ESP_BLUFI_DEINIT_OK;
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL, NULL);
|
||||
}
|
||||
|
||||
void esp_blufi_send_notify(void *arg)
|
||||
|
||||
@@ -149,7 +149,7 @@ static void alarm_cb_handler(struct alarm_t *alarm)
|
||||
msg.pid = BTC_PID_ALARM;
|
||||
arg.cb = alarm->cb;
|
||||
arg.cb_data = alarm->cb_data;
|
||||
btc_transfer_context(&msg, &arg, sizeof(btc_alarm_args_t), NULL);
|
||||
btc_transfer_context(&msg, &arg, sizeof(btc_alarm_args_t), NULL, NULL);
|
||||
}
|
||||
|
||||
osi_alarm_t *osi_alarm_new(const char *alarm_name, osi_alarm_callback_t callback, void *data, period_ms_t timer_expire)
|
||||
|
||||
@@ -214,17 +214,17 @@ osi_thread_t *osi_thread_create(const char *name, size_t stack_size, int priorit
|
||||
return NULL;
|
||||
}
|
||||
|
||||
osi_thread_t *thread = (osi_thread_t *)osi_malloc(sizeof(osi_thread_t));
|
||||
osi_thread_t *thread = (osi_thread_t *)osi_calloc(sizeof(osi_thread_t));
|
||||
if (thread == NULL) {
|
||||
goto _err;
|
||||
}
|
||||
|
||||
thread->stop = false;
|
||||
thread->work_queue_num = work_queue_num;
|
||||
thread->work_queues = (struct work_queue **)osi_malloc(sizeof(struct work_queue *) * work_queue_num);
|
||||
thread->work_queues = (struct work_queue **)osi_calloc(sizeof(struct work_queue *) * work_queue_num);
|
||||
if (thread->work_queues == NULL) {
|
||||
goto _err;
|
||||
}
|
||||
thread->work_queue_num = work_queue_num;
|
||||
|
||||
for (int i = 0; i < thread->work_queue_num; i++) {
|
||||
size_t queue_len = work_queue_len[i] ? work_queue_len[i] : DEFAULT_WORK_QUEUE_CAPACITY;
|
||||
|
||||
@@ -1478,7 +1478,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
goto error;
|
||||
}
|
||||
|
||||
esp_phy_pd_mem_init();
|
||||
esp_phy_modem_init();
|
||||
|
||||
esp_bt_power_domain_on();
|
||||
|
||||
@@ -1640,7 +1640,7 @@ esp_err_t esp_bt_controller_deinit(void)
|
||||
|
||||
esp_bt_power_domain_off();
|
||||
|
||||
esp_phy_pd_mem_deinit();
|
||||
esp_phy_modem_deinit();
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ config BT_CTRL_RX_ANTENNA_INDEX_EFF
|
||||
|
||||
choice BT_CTRL_DFT_TX_POWER_LEVEL
|
||||
prompt "BLE default Tx power level"
|
||||
default BT_CTRL_DFT_TX_POWER_LEVEL_P3
|
||||
default BT_CTRL_DFT_TX_POWER_LEVEL_P9
|
||||
help
|
||||
Specify default Tx power level
|
||||
|
||||
@@ -413,3 +413,11 @@ config BT_CTRL_CODED_AGC_RECORRECT_EN
|
||||
default n
|
||||
help
|
||||
Enable coded phy AGC recorrect
|
||||
|
||||
config BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
|
||||
bool "Disable active scan backoff"
|
||||
default n
|
||||
help
|
||||
Disable active scan backoff. The bluetooth spec requires that scanners should run a backoff procedure to
|
||||
minimize collision of scan request PDUs from nultiple scanners. If scan backoff is disabled, in active
|
||||
scanning, scan request PDU will be sent every time when HW receives scannable ADV PDU.
|
||||
|
||||
@@ -241,7 +241,6 @@ extern bool btdm_deep_sleep_mem_init(void);
|
||||
extern void btdm_deep_sleep_mem_deinit(void);
|
||||
extern void btdm_ble_power_down_dma_copy(bool copy);
|
||||
extern uint8_t btdm_sleep_clock_sync(void);
|
||||
extern void sdk_config_extend_set_pll_track(bool enable);
|
||||
|
||||
#if CONFIG_MAC_BB_PD
|
||||
extern void esp_mac_bb_power_down(void);
|
||||
@@ -249,24 +248,19 @@ 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 char _bss_start_btdm;
|
||||
extern char _bss_end_btdm;
|
||||
extern char _data_start_btdm;
|
||||
extern char _data_end_btdm;
|
||||
extern uint32_t _data_start_btdm_rom;
|
||||
extern uint32_t _data_end_btdm_rom;
|
||||
|
||||
extern uint32_t _bt_bss_start;
|
||||
extern uint32_t _bt_bss_end;
|
||||
extern uint32_t _btdm_bss_start;
|
||||
extern uint32_t _btdm_bss_end;
|
||||
extern uint32_t _nimble_bss_start;
|
||||
extern uint32_t _nimble_bss_end;
|
||||
extern uint32_t _bt_data_start;
|
||||
extern uint32_t _bt_data_end;
|
||||
extern uint32_t _btdm_data_start;
|
||||
extern uint32_t _btdm_data_end;
|
||||
extern uint32_t _nimble_data_start;
|
||||
extern uint32_t _nimble_data_end;
|
||||
|
||||
extern char _bt_tmp_bss_start;
|
||||
extern char _bt_tmp_bss_end;
|
||||
|
||||
/* Local Function Declare
|
||||
*********************************************************************
|
||||
@@ -316,6 +310,9 @@ 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_slp_tmr_callback(void *arg);
|
||||
|
||||
static esp_err_t try_heap_caps_add_region(intptr_t start, intptr_t end);
|
||||
|
||||
/* Local variable definition
|
||||
***************************************************************************
|
||||
*/
|
||||
@@ -876,13 +873,142 @@ static void btdm_controller_mem_init(void)
|
||||
|
||||
esp_err_t esp_bt_controller_mem_release(esp_bt_mode_t mode)
|
||||
{
|
||||
ESP_LOGW(BTDM_LOG_TAG, "%s not implemented, return OK", __func__);
|
||||
intptr_t mem_start=(intptr_t) NULL, mem_end=(intptr_t) NULL;
|
||||
if (btdm_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (mode & ESP_BT_MODE_BLE) {
|
||||
/* if the addresses of rom btdm .data and .bss are consecutive,
|
||||
they are registered in the system heap as a piece of memory
|
||||
*/
|
||||
if(ets_rom_layout_p->data_end_btdm == ets_rom_layout_p->bss_start_btdm) {
|
||||
mem_start = (intptr_t)ets_rom_layout_p->data_start_btdm;
|
||||
mem_end = (intptr_t)ets_rom_layout_p->bss_end_btdm;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BTDM_LOG_TAG, "Release rom btdm [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));
|
||||
}
|
||||
} else {
|
||||
mem_start = (intptr_t)ets_rom_layout_p->bss_start_btdm;
|
||||
mem_end = (intptr_t)ets_rom_layout_p->bss_end_btdm;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BTDM_LOG_TAG, "Release rom btdm BSS [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));
|
||||
}
|
||||
|
||||
mem_start = (intptr_t)ets_rom_layout_p->data_start_btdm;
|
||||
mem_end = (intptr_t)ets_rom_layout_p->data_end_btdm;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BTDM_LOG_TAG, "Release rom btdm Data [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));
|
||||
}
|
||||
}
|
||||
/* if the addresses of rom interface btdm .data and .bss are consecutive,
|
||||
they are registered in the system heap as a piece of memory
|
||||
*/
|
||||
if(ets_rom_layout_p->data_end_interface_btdm == ets_rom_layout_p->bss_start_interface_btdm) {
|
||||
mem_start = (intptr_t)ets_rom_layout_p->data_start_interface_btdm;
|
||||
mem_end = (intptr_t)ets_rom_layout_p->bss_end_interface_btdm;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BTDM_LOG_TAG, "Release rom interface btdm [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));
|
||||
}
|
||||
} else {
|
||||
mem_start = (intptr_t)ets_rom_layout_p->data_start_interface_btdm;
|
||||
mem_end = (intptr_t)ets_rom_layout_p->data_end_interface_btdm;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BTDM_LOG_TAG, "Release rom interface btdm Data [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));
|
||||
}
|
||||
|
||||
mem_start = (intptr_t)ets_rom_layout_p->bss_start_interface_btdm;
|
||||
mem_end = (intptr_t)ets_rom_layout_p->bss_end_interface_btdm;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BTDM_LOG_TAG, "Release rom interface btdm BSS [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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_mem_release(esp_bt_mode_t mode)
|
||||
{
|
||||
ESP_LOGW(BTDM_LOG_TAG, "%s not implemented, return OK", __func__);
|
||||
int ret;
|
||||
intptr_t mem_start, mem_end;
|
||||
|
||||
ret = esp_bt_controller_mem_release(mode);
|
||||
if (ret != ESP_OK) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (mode & ESP_BT_MODE_BLE) {
|
||||
/* if the addresses of btdm .bss and bt .bss are consecutive,
|
||||
they are registered in the system heap as a piece of memory
|
||||
*/
|
||||
if(_bt_bss_end == _btdm_bss_start) {
|
||||
mem_start = (intptr_t)&_bt_bss_start;
|
||||
mem_end = (intptr_t)&_btdm_bss_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BTDM_LOG_TAG, "Release BSS [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));
|
||||
}
|
||||
} else {
|
||||
mem_start = (intptr_t)&_bt_bss_start;
|
||||
mem_end = (intptr_t)&_bt_bss_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BTDM_LOG_TAG, "Release BT BSS [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));
|
||||
}
|
||||
|
||||
mem_start = (intptr_t)&_btdm_bss_start;
|
||||
mem_end = (intptr_t)&_btdm_bss_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BTDM_LOG_TAG, "Release BTDM BSS [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));
|
||||
}
|
||||
}
|
||||
/* if the addresses of btdm .data and bt .data are consecutive,
|
||||
they are registered in the system heap as a piece of memory
|
||||
*/
|
||||
if(_bt_data_end == _btdm_data_start) {
|
||||
mem_start = (intptr_t)&_bt_data_start;
|
||||
mem_end = (intptr_t)&_btdm_data_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BTDM_LOG_TAG, "Release data [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));
|
||||
}
|
||||
} else {
|
||||
mem_start = (intptr_t)&_bt_data_start;
|
||||
mem_end = (intptr_t)&_bt_data_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BTDM_LOG_TAG, "Release BT Data [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));
|
||||
}
|
||||
|
||||
mem_start = (intptr_t)&_btdm_data_start;
|
||||
mem_end = (intptr_t)&_btdm_data_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BTDM_LOG_TAG, "Release BTDM Data [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));
|
||||
}
|
||||
}
|
||||
|
||||
mem_start = (intptr_t)&_nimble_bss_start;
|
||||
mem_end = (intptr_t)&_nimble_bss_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BTDM_LOG_TAG, "Release NimBLE BSS [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));
|
||||
}
|
||||
mem_start = (intptr_t)&_nimble_data_start;
|
||||
mem_end = (intptr_t)&_nimble_data_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BTDM_LOG_TAG, "Release NimBLE Data [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));
|
||||
}
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
@@ -964,12 +1090,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
// overwrite some parameters
|
||||
cfg->magic = ESP_BT_CTRL_CONFIG_MAGIC_VAL;
|
||||
|
||||
sdk_config_extend_set_pll_track(false);
|
||||
|
||||
#if CONFIG_MAC_BB_PD
|
||||
esp_mac_bb_pd_mem_init();
|
||||
#endif
|
||||
esp_phy_pd_mem_init();
|
||||
esp_phy_modem_init();
|
||||
esp_bt_power_domain_on();
|
||||
|
||||
btdm_controller_mem_init();
|
||||
@@ -1286,16 +1410,11 @@ esp_err_t esp_bt_controller_deinit(void)
|
||||
esp_unregister_mac_bb_pu_callback(btdm_mac_bb_power_up_cb);
|
||||
#endif
|
||||
|
||||
/* Fix the issue caused by the power off the bt power domain.
|
||||
* This issue is only on ESP32C3.
|
||||
*/
|
||||
phy_init_flag();
|
||||
|
||||
esp_bt_power_domain_off();
|
||||
#if CONFIG_MAC_BB_PD
|
||||
esp_mac_bb_pd_mem_deinit();
|
||||
#endif
|
||||
esp_phy_pd_mem_deinit();
|
||||
esp_phy_modem_deinit();
|
||||
|
||||
free(osi_funcs_p);
|
||||
osi_funcs_p = NULL;
|
||||
|
||||
@@ -149,7 +149,7 @@ config BT_CTRL_RX_ANTENNA_INDEX_EFF
|
||||
|
||||
choice BT_CTRL_DFT_TX_POWER_LEVEL
|
||||
prompt "BLE default Tx power level"
|
||||
default BT_CTRL_DFT_TX_POWER_LEVEL_P3
|
||||
default BT_CTRL_DFT_TX_POWER_LEVEL_P9
|
||||
help
|
||||
Specify default Tx power level
|
||||
|
||||
@@ -429,3 +429,11 @@ config BT_CTRL_CODED_AGC_RECORRECT_EN
|
||||
default n
|
||||
help
|
||||
Enable coded phy AGC recorrect
|
||||
|
||||
config BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
|
||||
bool "Disable active scan backoff"
|
||||
default n
|
||||
help
|
||||
Disable active scan backoff. The bluetooth spec requires that scanners should run a backoff procedure to
|
||||
minimize collision of scan request PDUs from nultiple scanners. If scan backoff is disabled, in active
|
||||
scanning, scan request PDU will be sent every time when HW receives scannable ADV PDU.
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
#include "esp_coexist_internal.h"
|
||||
#include "esp_timer.h"
|
||||
#include "esp_sleep.h"
|
||||
#include "esp_rom_sys.h"
|
||||
#include "esp32s3/rom/rom_layout.h"
|
||||
|
||||
#if CONFIG_BT_ENABLED
|
||||
|
||||
@@ -244,7 +246,6 @@ extern bool btdm_deep_sleep_mem_init(void);
|
||||
extern void btdm_deep_sleep_mem_deinit(void);
|
||||
extern void btdm_ble_power_down_dma_copy(bool copy);
|
||||
extern uint8_t btdm_sleep_clock_sync(void);
|
||||
extern void sdk_config_extend_set_pll_track(bool enable);
|
||||
|
||||
#if CONFIG_MAC_BB_PD
|
||||
extern void esp_mac_bb_power_down(void);
|
||||
@@ -252,24 +253,18 @@ 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 char _bss_start_btdm;
|
||||
extern char _bss_end_btdm;
|
||||
extern char _data_start_btdm;
|
||||
extern char _data_end_btdm;
|
||||
extern uint32_t _data_start_btdm_rom;
|
||||
extern uint32_t _data_end_btdm_rom;
|
||||
|
||||
extern uint32_t _bt_bss_start;
|
||||
extern uint32_t _bt_bss_end;
|
||||
extern uint32_t _btdm_bss_start;
|
||||
extern uint32_t _btdm_bss_end;
|
||||
extern uint32_t _nimble_bss_start;
|
||||
extern uint32_t _nimble_bss_end;
|
||||
extern uint32_t _bt_data_start;
|
||||
extern uint32_t _bt_data_end;
|
||||
extern uint32_t _btdm_data_start;
|
||||
extern uint32_t _btdm_data_end;
|
||||
|
||||
extern char _bt_tmp_bss_start;
|
||||
extern char _bt_tmp_bss_end;
|
||||
extern uint32_t _nimble_data_start;
|
||||
extern uint32_t _nimble_data_end;
|
||||
|
||||
/* Local Function Declare
|
||||
*********************************************************************
|
||||
@@ -319,6 +314,9 @@ 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_slp_tmr_callback(void *arg);
|
||||
|
||||
static esp_err_t try_heap_caps_add_region(intptr_t start, intptr_t end);
|
||||
|
||||
/* Local variable definition
|
||||
***************************************************************************
|
||||
*/
|
||||
@@ -927,16 +925,159 @@ static void btdm_controller_mem_init(void)
|
||||
|
||||
esp_err_t esp_bt_controller_mem_release(esp_bt_mode_t mode)
|
||||
{
|
||||
ESP_LOGW(BT_LOG_TAG, "%s not implemented, return OK", __func__);
|
||||
intptr_t mem_start=(intptr_t) NULL, mem_end=(intptr_t) NULL;
|
||||
if (btdm_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (mode & ESP_BT_MODE_BLE) {
|
||||
/* if the addresses of rom btdm .data and .bss are consecutive,
|
||||
they are registered in the system heap as a piece of memory
|
||||
*/
|
||||
if(ets_rom_layout_p->data_end_btdm == ets_rom_layout_p->bss_start_btdm) {
|
||||
mem_start = (intptr_t)ets_rom_layout_p->data_start_btdm;
|
||||
mem_end = (intptr_t)ets_rom_layout_p->bss_end_btdm;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BT_LOG_TAG, "Release rom btdm [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));
|
||||
}
|
||||
} else {
|
||||
mem_start = (intptr_t)ets_rom_layout_p->bss_start_btdm;
|
||||
mem_end = (intptr_t)ets_rom_layout_p->bss_end_btdm;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BT_LOG_TAG, "Release rom btdm BSS [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));
|
||||
}
|
||||
|
||||
mem_start = (intptr_t)ets_rom_layout_p->data_start_btdm;
|
||||
mem_end = (intptr_t)ets_rom_layout_p->data_end_btdm;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BT_LOG_TAG, "Release rom btdm Data [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));
|
||||
}
|
||||
}
|
||||
/* if the addresses of rom interface btdm .data and .bss are consecutive,
|
||||
they are registered in the system heap as a piece of memory
|
||||
*/
|
||||
if(ets_rom_layout_p->data_end_interface_btdm == ets_rom_layout_p->bss_start_interface_btdm) {
|
||||
mem_start = (intptr_t)ets_rom_layout_p->data_start_interface_btdm;
|
||||
mem_end = (intptr_t)ets_rom_layout_p->bss_end_interface_btdm;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BT_LOG_TAG, "Release rom interface btdm [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));
|
||||
}
|
||||
} else {
|
||||
mem_start = (intptr_t)ets_rom_layout_p->data_start_interface_btdm;
|
||||
mem_end = (intptr_t)ets_rom_layout_p->data_end_interface_btdm;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BT_LOG_TAG, "Release rom interface btdm Data [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));
|
||||
}
|
||||
|
||||
mem_start = (intptr_t)ets_rom_layout_p->bss_start_interface_btdm;
|
||||
mem_end = (intptr_t)ets_rom_layout_p->bss_end_interface_btdm;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BT_LOG_TAG, "Release rom interface btdm BSS [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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_mem_release(esp_bt_mode_t mode)
|
||||
{
|
||||
ESP_LOGW(BT_LOG_TAG, "%s not implemented, return OK", __func__);
|
||||
int ret;
|
||||
intptr_t mem_start, mem_end;
|
||||
|
||||
ret = esp_bt_controller_mem_release(mode);
|
||||
if (ret != ESP_OK) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (mode & ESP_BT_MODE_BLE) {
|
||||
/* if the addresses of btdm .bss and bt .bss are consecutive,
|
||||
they are registered in the system heap as a piece of memory
|
||||
*/
|
||||
if(_bt_bss_end == _btdm_bss_start) {
|
||||
mem_start = (intptr_t)&_bt_bss_start;
|
||||
mem_end = (intptr_t)&_btdm_bss_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BT_LOG_TAG, "Release BSS [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));
|
||||
}
|
||||
} else {
|
||||
mem_start = (intptr_t)&_bt_bss_start;
|
||||
mem_end = (intptr_t)&_bt_bss_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BT_LOG_TAG, "Release BT BSS [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));
|
||||
}
|
||||
|
||||
mem_start = (intptr_t)&_btdm_bss_start;
|
||||
mem_end = (intptr_t)&_btdm_bss_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BT_LOG_TAG, "Release BTDM BSS [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));
|
||||
}
|
||||
}
|
||||
/* if the addresses of btdm .data and bt .data are consecutive,
|
||||
they are registered in the system heap as a piece of memory
|
||||
*/
|
||||
if(_bt_data_end == _btdm_data_start) {
|
||||
mem_start = (intptr_t)&_bt_data_start;
|
||||
mem_end = (intptr_t)&_btdm_data_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BT_LOG_TAG, "Release data [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));
|
||||
}
|
||||
} else {
|
||||
mem_start = (intptr_t)&_bt_data_start;
|
||||
mem_end = (intptr_t)&_bt_data_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BT_LOG_TAG, "Release BT Data [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));
|
||||
}
|
||||
|
||||
mem_start = (intptr_t)&_btdm_data_start;
|
||||
mem_end = (intptr_t)&_btdm_data_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BT_LOG_TAG, "Release BTDM Data [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));
|
||||
}
|
||||
}
|
||||
|
||||
mem_start = (intptr_t)&_nimble_bss_start;
|
||||
mem_end = (intptr_t)&_nimble_bss_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BT_LOG_TAG, "Release NimBLE BSS [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));
|
||||
}
|
||||
mem_start = (intptr_t)&_nimble_data_start;
|
||||
mem_end = (intptr_t)&_nimble_data_end;
|
||||
if (mem_start != mem_end) {
|
||||
ESP_LOGD(BT_LOG_TAG, "Release NimBLE Data [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));
|
||||
}
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t try_heap_caps_add_region(intptr_t start, intptr_t end)
|
||||
{
|
||||
int ret = heap_caps_add_region(start, end);
|
||||
/* heap_caps_add_region() returns ESP_ERR_INVALID_SIZE if the memory region is
|
||||
* is too small to fit a heap. This cannot be termed as a fatal error and hence
|
||||
* we replace it by ESP_OK
|
||||
*/
|
||||
|
||||
if (ret == ESP_ERR_INVALID_SIZE) {
|
||||
return ESP_OK;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if CONFIG_MAC_BB_PD
|
||||
static void IRAM_ATTR btdm_mac_bb_power_down_cb(void)
|
||||
{
|
||||
@@ -995,12 +1136,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
// overwrite some parameters
|
||||
cfg->magic = ESP_BT_CTRL_CONFIG_MAGIC_VAL;
|
||||
|
||||
sdk_config_extend_set_pll_track(false);
|
||||
|
||||
#if CONFIG_MAC_BB_PD
|
||||
esp_mac_bb_pd_mem_init();
|
||||
#endif
|
||||
esp_phy_pd_mem_init();
|
||||
esp_phy_modem_init();
|
||||
esp_bt_power_domain_on();
|
||||
|
||||
btdm_controller_mem_init();
|
||||
@@ -1322,7 +1461,7 @@ esp_err_t esp_bt_controller_deinit(void)
|
||||
#if CONFIG_MAC_BB_PD
|
||||
esp_mac_bb_pd_mem_deinit();
|
||||
#endif
|
||||
esp_phy_pd_mem_deinit();
|
||||
esp_phy_modem_deinit();
|
||||
|
||||
free(osi_funcs_p);
|
||||
osi_funcs_p = NULL;
|
||||
|
||||
Submodule components/bt/controller/lib_esp32 updated: eac5f09163...dbaeb136ca
Submodule components/bt/controller/lib_esp32c3_family updated: 420ae1726d...79152b5190
@@ -585,6 +585,21 @@ if BLE_MESH
|
||||
stored to flash. E.g. the default value of 4 means that the
|
||||
state is saved every 24 hours (96 / 4).
|
||||
|
||||
config BLE_MESH_IVU_RECOVERY_IVI
|
||||
bool "Recovery the IV index when the latest whole IV update procedure is missed"
|
||||
default n
|
||||
help
|
||||
According to Section 3.10.5 of Mesh Specification v1.0.1.
|
||||
If a node in Normal Operation receives a Secure Network beacon with an IV index
|
||||
equal to the last known IV index+1 and the IV Update Flag set to 0, the node may
|
||||
update its IV without going to the IV Update in Progress state, or it may initiate
|
||||
an IV Index Recovery procedure (Section 3.10.6), or it may ignore the Secure
|
||||
Network beacon. The node makes the choice depending on the time since last IV
|
||||
update and the likelihood that the node has missed the Secure Network beacons
|
||||
with the IV update Flag.
|
||||
When the above situation is encountered, this option can be used to decide whether
|
||||
to perform the IV index recovery procedure.
|
||||
|
||||
config BLE_MESH_TX_SEG_MSG_COUNT
|
||||
int "Maximum number of simultaneous outgoing segmented messages"
|
||||
default 1
|
||||
|
||||
@@ -43,7 +43,7 @@ esp_err_t esp_ble_mesh_start_ble_advertising(const esp_ble_mesh_ble_adv_param_t
|
||||
memcpy(&arg.start_ble_adv.data, data, sizeof(esp_ble_mesh_ble_adv_data_t));
|
||||
}
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ esp_err_t esp_ble_mesh_stop_ble_advertising(uint8_t index)
|
||||
|
||||
arg.stop_ble_adv.index = index;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_SUPPORT_BLE_ADV */
|
||||
@@ -81,7 +81,7 @@ esp_err_t esp_ble_mesh_start_ble_scanning(esp_ble_mesh_ble_scan_param_t *param)
|
||||
msg.pid = BTC_PID_BLE_MESH_BLE_COEX;
|
||||
msg.act = BTC_BLE_MESH_ACT_START_BLE_SCAN;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ esp_err_t esp_ble_mesh_stop_ble_scanning(void)
|
||||
msg.pid = BTC_PID_BLE_MESH_BLE_COEX;
|
||||
msg.act = BTC_BLE_MESH_ACT_STOP_BLE_SCAN;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_SUPPORT_BLE_SCAN */
|
||||
|
||||
@@ -47,7 +47,7 @@ esp_err_t esp_ble_mesh_init(esp_ble_mesh_prov_t *prov, esp_ble_mesh_comp_t *comp
|
||||
msg.pid = BTC_PID_PROV;
|
||||
msg.act = BTC_BLE_MESH_ACT_MESH_INIT;
|
||||
|
||||
if (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL) != BT_STATUS_SUCCESS) {
|
||||
if (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL) != BT_STATUS_SUCCESS) {
|
||||
vSemaphoreDelete(semaphore);
|
||||
BT_ERR("Failed to start mesh init");
|
||||
return ESP_FAIL;
|
||||
@@ -79,7 +79,7 @@ esp_err_t esp_ble_mesh_deinit(esp_ble_mesh_deinit_param_t *param)
|
||||
msg.pid = BTC_PID_PROV;
|
||||
msg.act = BTC_BLE_MESH_ACT_DEINIT_MESH;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_DEINIT */
|
||||
|
||||
@@ -92,7 +92,7 @@ esp_err_t esp_ble_mesh_model_subscribe_group_addr(uint16_t element_addr, uint16_
|
||||
arg.model_sub_group_addr.model_id = model_id;
|
||||
arg.model_sub_group_addr.group_addr = group_addr;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ esp_err_t esp_ble_mesh_model_unsubscribe_group_addr(uint16_t element_addr, uint1
|
||||
arg.model_unsub_group_addr.model_id = model_id;
|
||||
arg.model_unsub_group_addr.group_addr = group_addr;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ esp_err_t esp_ble_mesh_node_add_local_net_key(const uint8_t net_key[16], uint16_
|
||||
arg.node_add_local_net_key.net_idx = net_idx;
|
||||
memcpy(arg.node_add_local_net_key.net_key, net_key, 16);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ esp_err_t esp_ble_mesh_node_add_local_app_key(const uint8_t app_key[16], uint16_
|
||||
arg.node_add_local_app_key.app_idx = app_idx;
|
||||
memcpy(arg.node_add_local_app_key.app_key, app_key, 16);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ esp_err_t esp_ble_mesh_node_bind_app_key_to_local_model(uint16_t element_addr, u
|
||||
arg.node_local_mod_app_bind.company_id = company_id;
|
||||
arg.node_local_mod_app_bind.app_idx = app_idx;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ esp_err_t esp_ble_mesh_lpn_enable(void)
|
||||
msg.pid = BTC_PID_PROV;
|
||||
msg.act = BTC_BLE_MESH_ACT_LPN_ENABLE;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_mesh_lpn_disable(bool force)
|
||||
@@ -37,7 +37,7 @@ esp_err_t esp_ble_mesh_lpn_disable(bool force)
|
||||
|
||||
arg.lpn_disable.force = force;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -51,5 +51,5 @@ esp_err_t esp_ble_mesh_lpn_poll(void)
|
||||
msg.pid = BTC_PID_PROV;
|
||||
msg.act = BTC_BLE_MESH_ACT_LPN_POLL;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -101,8 +101,8 @@ static esp_err_t ble_mesh_model_send_msg(esp_ble_mesh_model_t *model,
|
||||
arg.model_send.msg_timeout = msg_timeout;
|
||||
}
|
||||
|
||||
status = (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_model_args_t), btc_ble_mesh_model_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
status = (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_model_args_t), btc_ble_mesh_model_arg_deep_copy,
|
||||
btc_ble_mesh_model_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
|
||||
bt_mesh_free(msg_data);
|
||||
|
||||
@@ -236,8 +236,8 @@ esp_err_t esp_ble_mesh_server_model_update_state(esp_ble_mesh_model_t *model,
|
||||
msg.pid = BTC_PID_MODEL;
|
||||
msg.act = BTC_BLE_MESH_ACT_SERVER_MODEL_UPDATE_STATE;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_model_args_t), btc_ble_mesh_model_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_model_args_t), btc_ble_mesh_model_arg_deep_copy,
|
||||
btc_ble_mesh_model_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_SERVER_MODEL */
|
||||
|
||||
@@ -251,7 +251,7 @@ esp_err_t esp_ble_mesh_node_local_reset(void)
|
||||
msg.pid = BTC_PID_PROV;
|
||||
msg.act = BTC_BLE_MESH_ACT_NODE_RESET;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
#if (CONFIG_BLE_MESH_PROVISIONER)
|
||||
@@ -275,7 +275,7 @@ esp_err_t esp_ble_mesh_provisioner_set_node_name(uint16_t index, const char *nam
|
||||
memset(arg.set_node_name.name, 0, sizeof(arg.set_node_name.name));
|
||||
strncpy(arg.set_node_name.name, name, ESP_BLE_MESH_NODE_NAME_MAX_LEN);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -312,8 +312,8 @@ esp_err_t esp_ble_mesh_provisioner_store_node_comp_data(uint16_t unicast_addr,
|
||||
arg.store_node_comp_data.unicast_addr = unicast_addr;
|
||||
arg.store_node_comp_data.length = length;
|
||||
arg.store_node_comp_data.data = data;
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy,
|
||||
btc_ble_mesh_prov_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_ble_mesh_node_t *esp_ble_mesh_provisioner_get_node_with_uuid(const uint8_t uuid[16])
|
||||
@@ -370,7 +370,7 @@ esp_err_t esp_ble_mesh_provisioner_delete_node_with_uuid(const uint8_t uuid[16])
|
||||
|
||||
memcpy(arg.delete_node_with_uuid.uuid, uuid, 16);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ esp_err_t esp_ble_mesh_provisioner_delete_node_with_addr(uint16_t unicast_addr)
|
||||
|
||||
arg.delete_node_with_addr.unicast_addr = unicast_addr;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ esp_err_t esp_ble_mesh_provisioner_add_local_app_key(const uint8_t app_key[16],
|
||||
} else {
|
||||
bzero(arg.add_local_app_key.app_key, 16);
|
||||
}
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ esp_err_t esp_ble_mesh_provisioner_update_local_app_key(const uint8_t app_key[16
|
||||
memcpy(arg.update_local_app_key.app_key, app_key, 16);
|
||||
arg.update_local_app_key.net_idx = net_idx;
|
||||
arg.update_local_app_key.app_idx = app_idx;
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -466,7 +466,7 @@ esp_err_t esp_ble_mesh_provisioner_bind_app_key_to_local_model(uint16_t element_
|
||||
arg.local_mod_app_bind.app_idx = app_idx;
|
||||
arg.local_mod_app_bind.model_id = model_id;
|
||||
arg.local_mod_app_bind.cid = company_id;
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -491,7 +491,7 @@ esp_err_t esp_ble_mesh_provisioner_add_local_net_key(const uint8_t net_key[16],
|
||||
} else {
|
||||
bzero(arg.add_local_net_key.net_key, 16);
|
||||
}
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -512,7 +512,7 @@ esp_err_t esp_ble_mesh_provisioner_update_local_net_key(const uint8_t net_key[16
|
||||
|
||||
memcpy(arg.update_local_net_key.net_key, net_key, 16);
|
||||
arg.update_local_net_key.net_idx = net_idx;
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -535,7 +535,7 @@ esp_err_t esp_ble_mesh_provisioner_recv_heartbeat(bool enable)
|
||||
|
||||
arg.enable_heartbeat_recv.enable = enable;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -556,7 +556,7 @@ esp_err_t esp_ble_mesh_provisioner_set_heartbeat_filter_type(uint8_t type)
|
||||
|
||||
arg.set_heartbeat_filter_type.type = type;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -585,7 +585,7 @@ esp_err_t esp_ble_mesh_provisioner_set_heartbeat_filter_info(uint8_t op, esp_ble
|
||||
arg.set_heartbeat_filter_info.hb_src = info->hb_src;
|
||||
arg.set_heartbeat_filter_info.hb_dst = info->hb_dst;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_PROVISIONER_RECV_HB */
|
||||
@@ -602,7 +602,7 @@ esp_err_t esp_ble_mesh_provisioner_direct_erase_settings(void)
|
||||
|
||||
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_DIRECT_ERASE_SETTINGS;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL)
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_SETTINGS */
|
||||
@@ -625,7 +625,7 @@ esp_err_t esp_ble_mesh_provisioner_open_settings_with_index(uint8_t index)
|
||||
|
||||
arg.open_settings_with_index.index = index;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -646,7 +646,7 @@ esp_err_t esp_ble_mesh_provisioner_open_settings_with_uid(const char *uid)
|
||||
|
||||
strncpy(arg.open_settings_with_uid.uid, uid, ESP_BLE_MESH_SETTINGS_UID_SIZE);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -668,7 +668,7 @@ esp_err_t esp_ble_mesh_provisioner_close_settings_with_index(uint8_t index, bool
|
||||
arg.close_settings_with_index.index = index;
|
||||
arg.close_settings_with_index.erase = erase;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -690,7 +690,7 @@ esp_err_t esp_ble_mesh_provisioner_close_settings_with_uid(const char *uid, bool
|
||||
strncpy(arg.close_settings_with_uid.uid, uid, ESP_BLE_MESH_SETTINGS_UID_SIZE);
|
||||
arg.close_settings_with_uid.erase = erase;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -711,7 +711,7 @@ esp_err_t esp_ble_mesh_provisioner_delete_settings_with_index(uint8_t index)
|
||||
|
||||
arg.delete_settings_with_index.index = index;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -732,7 +732,7 @@ esp_err_t esp_ble_mesh_provisioner_delete_settings_with_uid(const char *uid)
|
||||
|
||||
strncpy(arg.delete_settings_with_uid.uid, uid, ESP_BLE_MESH_SETTINGS_UID_SIZE);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ esp_err_t esp_ble_mesh_node_prov_enable(esp_ble_mesh_prov_bearer_t bearers)
|
||||
msg.act = BTC_BLE_MESH_ACT_PROV_ENABLE;
|
||||
arg.node_prov_enable.bearers = bearers;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ esp_err_t esp_ble_mesh_node_prov_disable(esp_ble_mesh_prov_bearer_t bearers)
|
||||
msg.act = BTC_BLE_MESH_ACT_PROV_DISABLE;
|
||||
arg.node_prov_disable.bearers = bearers;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ esp_err_t esp_ble_mesh_node_set_oob_pub_key(uint8_t pub_key_x[32], uint8_t pub_k
|
||||
memcpy(arg.set_oob_pub_key.pub_key_y, pub_key_y, 32);
|
||||
memcpy(arg.set_oob_pub_key.private_key, private_key, 32);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ esp_err_t esp_ble_mesh_node_input_number(uint32_t number)
|
||||
msg.act = BTC_BLE_MESH_ACT_INPUT_NUMBER;
|
||||
arg.input_number.number = number;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ esp_err_t esp_ble_mesh_node_input_string(const char *string)
|
||||
strncpy(arg.input_string.string, string,
|
||||
MIN(strlen(string), sizeof(arg.input_string.string)));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ esp_err_t esp_ble_mesh_set_unprovisioned_device_name(const char *name)
|
||||
memset(arg.set_device_name.name, 0, sizeof(arg.set_device_name.name));
|
||||
strncpy(arg.set_device_name.name, name, ESP_BLE_MESH_DEVICE_NAME_MAX_LEN);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ esp_err_t esp_ble_mesh_provisioner_read_oob_pub_key(uint8_t link_idx, uint8_t pu
|
||||
memcpy(arg.provisioner_read_oob_pub_key.pub_key_x, pub_key_x, 32);
|
||||
memcpy(arg.provisioner_read_oob_pub_key.pub_key_y, pub_key_y, 32);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ esp_err_t esp_ble_mesh_provisioner_input_string(const char *string, uint8_t link
|
||||
MIN(strlen(string), sizeof(arg.provisioner_input_str.string)));
|
||||
arg.provisioner_input_str.link_idx = link_idx;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ esp_err_t esp_ble_mesh_provisioner_input_number(uint32_t number, uint8_t link_id
|
||||
arg.provisioner_input_num.number = number;
|
||||
arg.provisioner_input_num.link_idx = link_idx;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ esp_err_t esp_ble_mesh_provisioner_prov_enable(esp_ble_mesh_prov_bearer_t bearer
|
||||
|
||||
arg.provisioner_enable.bearers = bearers;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ esp_err_t esp_ble_mesh_provisioner_prov_disable(esp_ble_mesh_prov_bearer_t beare
|
||||
|
||||
arg.provisioner_disable.bearers = bearers;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ esp_err_t esp_ble_mesh_provisioner_add_unprov_dev(esp_ble_mesh_unprov_dev_add_t
|
||||
memcpy(arg.provisioner_dev_add.add_dev.addr, add_dev->addr, sizeof(esp_ble_mesh_bd_addr_t));
|
||||
memcpy(arg.provisioner_dev_add.add_dev.uuid, add_dev->uuid, 16);
|
||||
arg.provisioner_dev_add.flags = flags;
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ esp_err_t esp_ble_mesh_provisioner_prov_device_with_addr(const uint8_t uuid[16],
|
||||
arg.provisioner_prov_dev_with_addr.bearer = bearer;
|
||||
arg.provisioner_prov_dev_with_addr.oob_info = oob_info;
|
||||
arg.provisioner_prov_dev_with_addr.unicast_addr = unicast_addr;
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ esp_err_t esp_ble_mesh_provisioner_delete_dev(esp_ble_mesh_device_delete_t *del_
|
||||
} else if (del_dev->flag & DEL_DEV_UUID_FLAG) {
|
||||
memcpy(arg.provisioner_dev_del.del_dev.uuid, del_dev->uuid, 16);
|
||||
}
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -392,7 +392,7 @@ esp_err_t esp_ble_mesh_provisioner_set_dev_uuid_match(const uint8_t *match_val,
|
||||
arg.set_dev_uuid_match.match_len = match_len;
|
||||
arg.set_dev_uuid_match.offset = offset;
|
||||
arg.set_dev_uuid_match.prov_after_match = prov_after_match;
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ esp_err_t esp_ble_mesh_provisioner_set_prov_data_info(esp_ble_mesh_prov_data_inf
|
||||
} else if (prov_data_info->flag & PROV_DATA_IV_INDEX_FLAG) {
|
||||
arg.set_prov_data_info.prov_data.iv_index = prov_data_info->iv_index;
|
||||
}
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -441,7 +441,7 @@ esp_err_t esp_ble_mesh_provisioner_set_static_oob_value(const uint8_t *value, ui
|
||||
|
||||
arg.set_static_oob_val.length = length;
|
||||
memcpy(arg.set_static_oob_val.value, value, length);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ esp_err_t esp_ble_mesh_provisioner_set_primary_elem_addr(uint16_t addr)
|
||||
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_SET_PRIMARY_ELEM_ADDR;
|
||||
|
||||
arg.set_primary_elem_addr.addr = addr;
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -497,7 +497,7 @@ esp_err_t esp_ble_mesh_set_fast_prov_info(esp_ble_mesh_fast_prov_info_t *fast_pr
|
||||
if (fast_prov_info->match_len && fast_prov_info->match_val) {
|
||||
memcpy(arg.set_fast_prov_info.match_val, fast_prov_info->match_val, fast_prov_info->match_len);
|
||||
}
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -517,7 +517,7 @@ esp_err_t esp_ble_mesh_set_fast_prov_action(esp_ble_mesh_fast_prov_action_t acti
|
||||
msg.act = BTC_BLE_MESH_ACT_SET_FAST_PROV_ACTION;
|
||||
|
||||
arg.set_fast_prov_action.action = action;
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ esp_err_t esp_ble_mesh_proxy_identity_enable(void)
|
||||
msg.pid = BTC_PID_PROV;
|
||||
msg.act = BTC_BLE_MESH_ACT_PROXY_IDENTITY_ENABLE;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_mesh_proxy_gatt_enable(void)
|
||||
@@ -35,7 +35,7 @@ esp_err_t esp_ble_mesh_proxy_gatt_enable(void)
|
||||
msg.pid = BTC_PID_PROV;
|
||||
msg.act = BTC_BLE_MESH_ACT_PROXY_GATT_ENABLE;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_mesh_proxy_gatt_disable(void)
|
||||
@@ -48,7 +48,7 @@ esp_err_t esp_ble_mesh_proxy_gatt_disable(void)
|
||||
msg.pid = BTC_PID_PROV;
|
||||
msg.act = BTC_BLE_MESH_ACT_PROXY_GATT_DISABLE;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_mesh_proxy_client_connect(esp_ble_mesh_bd_addr_t addr,
|
||||
@@ -72,7 +72,7 @@ esp_err_t esp_ble_mesh_proxy_client_connect(esp_ble_mesh_bd_addr_t addr,
|
||||
arg.proxy_client_connect.addr_type = addr_type;
|
||||
arg.proxy_client_connect.net_idx = net_idx;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ esp_err_t esp_ble_mesh_proxy_client_disconnect(uint8_t conn_handle)
|
||||
|
||||
arg.proxy_client_disconnect.conn_handle = conn_handle;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ esp_err_t esp_ble_mesh_proxy_client_set_filter_type(uint8_t conn_handle, uint16_
|
||||
arg.proxy_client_set_filter_type.net_idx = net_idx;
|
||||
arg.proxy_client_set_filter_type.filter_type = filter_type;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -138,8 +138,8 @@ esp_err_t esp_ble_mesh_proxy_client_add_filter_addr(uint8_t conn_handle, uint16_
|
||||
arg.proxy_client_add_filter_addr.addr_num = addr_num;
|
||||
arg.proxy_client_add_filter_addr.addr = addr;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy,
|
||||
btc_ble_mesh_prov_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_mesh_proxy_client_remove_filter_addr(uint8_t conn_handle, uint16_t net_idx,
|
||||
@@ -163,6 +163,6 @@ esp_err_t esp_ble_mesh_proxy_client_remove_filter_addr(uint8_t conn_handle, uint
|
||||
arg.proxy_client_remove_filter_addr.addr_num = addr_num;
|
||||
arg.proxy_client_remove_filter_addr.addr = addr;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy,
|
||||
btc_ble_mesh_prov_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -59,8 +59,8 @@ esp_err_t esp_ble_mesh_config_client_get_state(esp_ble_mesh_client_common_param_
|
||||
arg.cfg_client_get_state.params = params;
|
||||
arg.cfg_client_get_state.get_state = get_state;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_config_client_args_t), btc_ble_mesh_config_client_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_config_client_args_t), btc_ble_mesh_config_client_arg_deep_copy,
|
||||
btc_ble_mesh_config_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_mesh_config_client_set_state(esp_ble_mesh_client_common_param_t *params,
|
||||
@@ -84,8 +84,8 @@ esp_err_t esp_ble_mesh_config_client_set_state(esp_ble_mesh_client_common_param_
|
||||
arg.cfg_client_set_state.params = params;
|
||||
arg.cfg_client_set_state.set_state = set_state;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_config_client_args_t), btc_ble_mesh_config_client_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_config_client_args_t), btc_ble_mesh_config_client_arg_deep_copy,
|
||||
btc_ble_mesh_config_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_CFG_CLI */
|
||||
|
||||
|
||||
@@ -54,8 +54,8 @@ esp_err_t esp_ble_mesh_generic_client_get_state(esp_ble_mesh_client_common_param
|
||||
arg.generic_client_get_state.params = params;
|
||||
arg.generic_client_get_state.get_state = get_state;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_generic_client_args_t), btc_ble_mesh_generic_client_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_generic_client_args_t), btc_ble_mesh_generic_client_arg_deep_copy,
|
||||
btc_ble_mesh_generic_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_mesh_generic_client_set_state(esp_ble_mesh_client_common_param_t *params,
|
||||
@@ -79,8 +79,8 @@ esp_err_t esp_ble_mesh_generic_client_set_state(esp_ble_mesh_client_common_param
|
||||
arg.generic_client_set_state.params = params;
|
||||
arg.generic_client_set_state.set_state = set_state;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_generic_client_args_t), btc_ble_mesh_generic_client_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_generic_client_args_t), btc_ble_mesh_generic_client_arg_deep_copy,
|
||||
btc_ble_mesh_generic_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_GENERIC_CLIENT */
|
||||
|
||||
|
||||
@@ -41,8 +41,8 @@ esp_err_t esp_ble_mesh_health_client_get_state(esp_ble_mesh_client_common_param_
|
||||
arg.health_client_get_state.params = params;
|
||||
arg.health_client_get_state.get_state = get_state;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_client_args_t), btc_ble_mesh_health_client_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_client_args_t), btc_ble_mesh_health_client_arg_deep_copy,
|
||||
btc_ble_mesh_health_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_mesh_health_client_set_state(esp_ble_mesh_client_common_param_t *params,
|
||||
@@ -66,8 +66,8 @@ esp_err_t esp_ble_mesh_health_client_set_state(esp_ble_mesh_client_common_param_
|
||||
arg.health_client_set_state.params = params;
|
||||
arg.health_client_set_state.set_state = set_state;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_client_args_t), btc_ble_mesh_health_client_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_client_args_t), btc_ble_mesh_health_client_arg_deep_copy,
|
||||
btc_ble_mesh_health_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_HEALTH_CLI */
|
||||
|
||||
@@ -95,7 +95,7 @@ esp_err_t esp_ble_mesh_health_server_fault_update(esp_ble_mesh_elem_t *element)
|
||||
msg.act = BTC_BLE_MESH_ACT_HEALTH_SERVER_FAULT_UPDATE;
|
||||
arg.health_fault_update.element = element;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_server_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_server_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_HEALTH_SRV */
|
||||
|
||||
@@ -41,8 +41,8 @@ esp_err_t esp_ble_mesh_light_client_get_state(esp_ble_mesh_client_common_param_t
|
||||
arg.light_client_get_state.params = params;
|
||||
arg.light_client_get_state.get_state = get_state;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_lighting_client_args_t), btc_ble_mesh_lighting_client_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_lighting_client_args_t), btc_ble_mesh_lighting_client_arg_deep_copy,
|
||||
btc_ble_mesh_lighting_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_mesh_light_client_set_state(esp_ble_mesh_client_common_param_t *params,
|
||||
@@ -66,8 +66,8 @@ esp_err_t esp_ble_mesh_light_client_set_state(esp_ble_mesh_client_common_param_t
|
||||
arg.light_client_set_state.params = params;
|
||||
arg.light_client_set_state.set_state = set_state;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_lighting_client_args_t), btc_ble_mesh_lighting_client_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_lighting_client_args_t), btc_ble_mesh_lighting_client_arg_deep_copy,
|
||||
btc_ble_mesh_lighting_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_LIGHTING_CLIENT */
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ esp_err_t esp_ble_mesh_sensor_client_get_state(esp_ble_mesh_client_common_param_
|
||||
arg.sensor_client_get_state.params = params;
|
||||
arg.sensor_client_get_state.get_state = get_state;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_sensor_client_args_t), btc_ble_mesh_sensor_client_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_sensor_client_args_t), btc_ble_mesh_sensor_client_arg_deep_copy,
|
||||
btc_ble_mesh_sensor_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_mesh_sensor_client_set_state(esp_ble_mesh_client_common_param_t *params,
|
||||
@@ -65,8 +65,8 @@ esp_err_t esp_ble_mesh_sensor_client_set_state(esp_ble_mesh_client_common_param_
|
||||
arg.sensor_client_set_state.params = params;
|
||||
arg.sensor_client_set_state.set_state = set_state;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_sensor_client_args_t), btc_ble_mesh_sensor_client_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_sensor_client_args_t), btc_ble_mesh_sensor_client_arg_deep_copy,
|
||||
btc_ble_mesh_sensor_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_SENSOR_CLI */
|
||||
|
||||
|
||||
@@ -41,8 +41,8 @@ esp_err_t esp_ble_mesh_time_scene_client_get_state(esp_ble_mesh_client_common_pa
|
||||
arg.time_scene_client_get_state.params = params;
|
||||
arg.time_scene_client_get_state.get_state = get_state;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_time_scene_client_args_t), btc_ble_mesh_time_scene_client_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_time_scene_client_args_t), btc_ble_mesh_time_scene_client_arg_deep_copy,
|
||||
btc_ble_mesh_time_scene_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_mesh_time_scene_client_set_state(esp_ble_mesh_client_common_param_t *params,
|
||||
@@ -66,8 +66,8 @@ esp_err_t esp_ble_mesh_time_scene_client_set_state(esp_ble_mesh_client_common_pa
|
||||
arg.time_scene_client_set_state.params = params;
|
||||
arg.time_scene_client_set_state.set_state = set_state;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_time_scene_client_args_t), btc_ble_mesh_time_scene_client_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_time_scene_client_args_t), btc_ble_mesh_time_scene_client_arg_deep_copy,
|
||||
btc_ble_mesh_time_scene_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif /* CONFIG_BLE_MESH_TIME_SCENE_CLIENT */
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ static void btc_ble_mesh_ble_callback(esp_ble_mesh_ble_cb_param_t *cb_params, ui
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_ble_cb_param_t),
|
||||
btc_ble_mesh_ble_copy_req_data);
|
||||
btc_ble_mesh_ble_copy_req_data, btc_ble_mesh_ble_free_req_data);
|
||||
}
|
||||
|
||||
#if CONFIG_BLE_MESH_SUPPORT_BLE_SCAN
|
||||
|
||||
@@ -83,7 +83,7 @@ void btc_ble_mesh_config_client_arg_deep_copy(btc_msg_t *msg, void *p_dest, void
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_ble_mesh_config_client_arg_deep_free(btc_msg_t *msg)
|
||||
void btc_ble_mesh_config_client_arg_deep_free(btc_msg_t *msg)
|
||||
{
|
||||
btc_ble_mesh_config_client_args_t *arg = NULL;
|
||||
|
||||
@@ -299,7 +299,7 @@ static void btc_ble_mesh_config_client_callback(esp_ble_mesh_cfg_client_cb_param
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_cfg_client_cb_param_t),
|
||||
btc_ble_mesh_config_client_copy_req_data);
|
||||
btc_ble_mesh_config_client_copy_req_data, btc_ble_mesh_config_client_free_req_data);
|
||||
}
|
||||
|
||||
void bt_mesh_config_client_cb_evt_to_btc(uint32_t opcode, uint8_t evt_type,
|
||||
@@ -702,7 +702,7 @@ static void btc_ble_mesh_config_server_callback(esp_ble_mesh_cfg_server_cb_param
|
||||
msg.pid = BTC_PID_CONFIG_SERVER;
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_cfg_server_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_cfg_server_cb_param_t), NULL, NULL);
|
||||
}
|
||||
|
||||
void bt_mesh_config_server_cb_evt_to_btc(uint8_t evt_type, struct bt_mesh_model *model,
|
||||
|
||||
@@ -107,7 +107,7 @@ void btc_ble_mesh_generic_client_arg_deep_copy(btc_msg_t *msg, void *p_dest, voi
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_ble_mesh_generic_client_arg_deep_free(btc_msg_t *msg)
|
||||
void btc_ble_mesh_generic_client_arg_deep_free(btc_msg_t *msg)
|
||||
{
|
||||
btc_ble_mesh_generic_client_args_t *arg = NULL;
|
||||
|
||||
@@ -369,7 +369,7 @@ static void btc_ble_mesh_generic_client_callback(esp_ble_mesh_generic_client_cb_
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_generic_client_cb_param_t),
|
||||
btc_ble_mesh_generic_client_copy_req_data);
|
||||
btc_ble_mesh_generic_client_copy_req_data, btc_ble_mesh_generic_client_free_req_data);
|
||||
}
|
||||
|
||||
void bt_mesh_generic_client_cb_evt_to_btc(uint32_t opcode, uint8_t evt_type,
|
||||
@@ -686,7 +686,7 @@ static void btc_ble_mesh_generic_server_callback(esp_ble_mesh_generic_server_cb_
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_generic_server_cb_param_t),
|
||||
btc_ble_mesh_generic_server_copy_req_data);
|
||||
btc_ble_mesh_generic_server_copy_req_data, btc_ble_mesh_generic_server_free_req_data);
|
||||
}
|
||||
|
||||
void bt_mesh_generic_server_cb_evt_to_btc(uint8_t evt_type, struct bt_mesh_model *model,
|
||||
|
||||
@@ -76,7 +76,7 @@ void btc_ble_mesh_health_client_arg_deep_copy(btc_msg_t *msg, void *p_dest, void
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_ble_mesh_health_client_arg_deep_free(btc_msg_t *msg)
|
||||
void btc_ble_mesh_health_client_arg_deep_free(btc_msg_t *msg)
|
||||
{
|
||||
btc_ble_mesh_health_client_args_t *arg = NULL;
|
||||
|
||||
@@ -232,7 +232,7 @@ static void btc_ble_mesh_health_client_callback(esp_ble_mesh_health_client_cb_pa
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_health_client_cb_param_t),
|
||||
btc_ble_mesh_health_client_copy_req_data);
|
||||
btc_ble_mesh_health_client_copy_req_data, btc_ble_mesh_health_client_free_req_data);
|
||||
}
|
||||
|
||||
void bt_mesh_health_client_cb_evt_to_btc(uint32_t opcode, uint8_t evt_type,
|
||||
@@ -543,7 +543,7 @@ static void btc_ble_mesh_health_server_callback(esp_ble_mesh_health_server_cb_pa
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_health_server_cb_param_t),
|
||||
btc_ble_mesh_health_server_copy_req_data);
|
||||
btc_ble_mesh_health_server_copy_req_data, btc_ble_mesh_health_server_free_req_data);
|
||||
}
|
||||
|
||||
void btc_ble_mesh_health_server_call_handler(btc_msg_t *msg)
|
||||
|
||||
@@ -75,7 +75,7 @@ void btc_ble_mesh_lighting_client_arg_deep_copy(btc_msg_t *msg, void *p_dest, vo
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_ble_mesh_lighting_client_arg_deep_free(btc_msg_t *msg)
|
||||
void btc_ble_mesh_lighting_client_arg_deep_free(btc_msg_t *msg)
|
||||
{
|
||||
btc_ble_mesh_lighting_client_args_t *arg = NULL;
|
||||
|
||||
@@ -213,7 +213,7 @@ static void btc_ble_mesh_lighting_client_callback(esp_ble_mesh_light_client_cb_p
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_light_client_cb_param_t),
|
||||
btc_ble_mesh_lighting_client_copy_req_data);
|
||||
btc_ble_mesh_lighting_client_copy_req_data, btc_ble_mesh_lighting_client_free_req_data);
|
||||
}
|
||||
|
||||
void bt_mesh_lighting_client_cb_evt_to_btc(uint32_t opcode, uint8_t evt_type,
|
||||
@@ -498,7 +498,7 @@ static void btc_ble_mesh_lighting_server_callback(esp_ble_mesh_lighting_server_c
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_lighting_server_cb_param_t),
|
||||
btc_ble_mesh_lighting_server_copy_req_data);
|
||||
btc_ble_mesh_lighting_server_copy_req_data, btc_ble_mesh_lighting_server_free_req_data);
|
||||
}
|
||||
|
||||
void bt_mesh_lighting_server_cb_evt_to_btc(uint8_t evt_type, struct bt_mesh_model *model,
|
||||
|
||||
@@ -120,7 +120,7 @@ void btc_ble_mesh_prov_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_ble_mesh_prov_arg_deep_free(btc_msg_t *msg)
|
||||
void btc_ble_mesh_prov_arg_deep_free(btc_msg_t *msg)
|
||||
{
|
||||
btc_ble_mesh_prov_args_t *arg = NULL;
|
||||
|
||||
@@ -196,7 +196,7 @@ void btc_ble_mesh_model_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_ble_mesh_model_arg_deep_free(btc_msg_t *msg)
|
||||
void btc_ble_mesh_model_arg_deep_free(btc_msg_t *msg)
|
||||
{
|
||||
btc_ble_mesh_model_args_t *arg = NULL;
|
||||
|
||||
@@ -369,7 +369,7 @@ static bt_status_t btc_ble_mesh_model_callback(esp_ble_mesh_model_cb_param_t *pa
|
||||
msg.act = act;
|
||||
|
||||
ret = btc_transfer_context(&msg, param, param == NULL ? 0 : sizeof(esp_ble_mesh_model_cb_param_t),
|
||||
btc_ble_mesh_model_copy_req_data);
|
||||
btc_ble_mesh_model_copy_req_data, btc_ble_mesh_model_free_req_data);
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
BT_ERR("btc_transfer_context failed");
|
||||
}
|
||||
@@ -528,7 +528,7 @@ static bt_status_t btc_ble_mesh_prov_callback(esp_ble_mesh_prov_cb_param_t *para
|
||||
msg.pid = BTC_PID_PROV;
|
||||
msg.act = act;
|
||||
|
||||
ret = btc_transfer_context(&msg, param, param == NULL ? 0 : sizeof(esp_ble_mesh_prov_cb_param_t), NULL);
|
||||
ret = btc_transfer_context(&msg, param, param == NULL ? 0 : sizeof(esp_ble_mesh_prov_cb_param_t), NULL, NULL);
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
BT_ERR("btc_transfer_context failed");
|
||||
}
|
||||
|
||||
@@ -451,7 +451,7 @@ static void btc_ble_mesh_sensor_client_callback(esp_ble_mesh_sensor_client_cb_pa
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_sensor_client_cb_param_t),
|
||||
btc_ble_mesh_sensor_client_copy_req_data);
|
||||
btc_ble_mesh_sensor_client_copy_req_data, btc_ble_mesh_sensor_client_free_req_data);
|
||||
}
|
||||
|
||||
void bt_mesh_sensor_client_cb_evt_to_btc(uint32_t opcode, uint8_t evt_type,
|
||||
@@ -818,7 +818,7 @@ static void btc_ble_mesh_sensor_server_callback(esp_ble_mesh_sensor_server_cb_pa
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_sensor_server_cb_param_t),
|
||||
btc_ble_mesh_sensor_server_copy_req_data);
|
||||
btc_ble_mesh_sensor_server_copy_req_data, btc_ble_mesh_sensor_server_free_req_data);
|
||||
}
|
||||
|
||||
void bt_mesh_sensor_server_cb_evt_to_btc(uint8_t evt_type, struct bt_mesh_model *model,
|
||||
|
||||
@@ -215,7 +215,7 @@ static void btc_ble_mesh_time_scene_client_callback(esp_ble_mesh_time_scene_clie
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_time_scene_client_cb_param_t),
|
||||
btc_ble_mesh_time_scene_client_copy_req_data);
|
||||
btc_ble_mesh_time_scene_client_copy_req_data, btc_ble_mesh_time_scene_client_free_req_data);
|
||||
}
|
||||
|
||||
void bt_mesh_time_scene_client_cb_evt_to_btc(uint32_t opcode, uint8_t evt_type,
|
||||
@@ -401,7 +401,7 @@ static void btc_ble_mesh_time_scene_server_callback(esp_ble_mesh_time_scene_serv
|
||||
msg.pid = BTC_PID_TIME_SCENE_SERVER;
|
||||
msg.act = act;
|
||||
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_time_scene_server_cb_param_t), NULL);
|
||||
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_time_scene_server_cb_param_t), NULL, NULL);
|
||||
}
|
||||
|
||||
void bt_mesh_time_scene_server_cb_evt_to_btc(uint8_t evt_type, struct bt_mesh_model *model,
|
||||
|
||||
@@ -45,6 +45,8 @@ void btc_ble_mesh_config_client_cb_handler(btc_msg_t *msg);
|
||||
|
||||
void btc_ble_mesh_config_client_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
|
||||
|
||||
void btc_ble_mesh_config_client_arg_deep_free(btc_msg_t *msg);
|
||||
|
||||
void btc_ble_mesh_config_client_publish_callback(uint32_t opcode, struct bt_mesh_model *model,
|
||||
struct bt_mesh_msg_ctx *ctx,
|
||||
struct net_buf_simple *buf);
|
||||
|
||||
@@ -45,6 +45,8 @@ void btc_ble_mesh_generic_client_cb_handler(btc_msg_t *msg);
|
||||
|
||||
void btc_ble_mesh_generic_client_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
|
||||
|
||||
void btc_ble_mesh_generic_client_arg_deep_free(btc_msg_t *msg);
|
||||
|
||||
void btc_ble_mesh_generic_client_publish_callback(uint32_t opcode, struct bt_mesh_model *model,
|
||||
struct bt_mesh_msg_ctx *ctx,
|
||||
struct net_buf_simple *buf);
|
||||
|
||||
@@ -41,6 +41,8 @@ typedef enum {
|
||||
|
||||
void btc_ble_mesh_health_client_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
|
||||
|
||||
void btc_ble_mesh_health_client_arg_deep_free(btc_msg_t *msg);
|
||||
|
||||
void btc_ble_mesh_health_client_call_handler(btc_msg_t *msg);
|
||||
|
||||
void btc_ble_mesh_health_client_cb_handler(btc_msg_t *msg);
|
||||
|
||||
@@ -45,6 +45,8 @@ void btc_ble_mesh_lighting_client_cb_handler(btc_msg_t *msg);
|
||||
|
||||
void btc_ble_mesh_lighting_client_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
|
||||
|
||||
void btc_ble_mesh_lighting_client_arg_deep_free(btc_msg_t *msg);
|
||||
|
||||
void btc_ble_mesh_lighting_client_publish_callback(uint32_t opcode, struct bt_mesh_model *model,
|
||||
struct bt_mesh_msg_ctx *ctx,
|
||||
struct net_buf_simple *buf);
|
||||
|
||||
@@ -336,8 +336,12 @@ typedef union {
|
||||
|
||||
void btc_ble_mesh_prov_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
|
||||
|
||||
void btc_ble_mesh_prov_arg_deep_free(btc_msg_t *msg);
|
||||
|
||||
void btc_ble_mesh_model_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
|
||||
|
||||
void btc_ble_mesh_model_arg_deep_free(btc_msg_t *msg);
|
||||
|
||||
const uint8_t *btc_ble_mesh_node_get_local_net_key(uint16_t net_idx);
|
||||
|
||||
const uint8_t *btc_ble_mesh_node_get_local_app_key(uint16_t app_idx);
|
||||
|
||||
@@ -45,6 +45,8 @@ void btc_ble_mesh_sensor_client_cb_handler(btc_msg_t *msg);
|
||||
|
||||
void btc_ble_mesh_sensor_client_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
|
||||
|
||||
void btc_ble_mesh_sensor_client_arg_deep_free(btc_msg_t *msg);
|
||||
|
||||
void btc_ble_mesh_sensor_client_publish_callback(uint32_t opcode, struct bt_mesh_model *model,
|
||||
struct bt_mesh_msg_ctx *ctx,
|
||||
struct net_buf_simple *buf);
|
||||
|
||||
@@ -1959,17 +1959,20 @@ 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)
|
||||
{
|
||||
BD_ADDR value = {0};
|
||||
|
||||
if ((sub_code > BLE_MESH_EXCEP_LIST_CLEAN) ||
|
||||
(type > BLE_MESH_EXCEP_INFO_MESH_PROXY_ADV)) {
|
||||
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_INFO_MESH_LINK_ID) {
|
||||
if (type == BLE_MESH_EXCEP_LIST_TYPE_MESH_LINK_ID) {
|
||||
if (!info) {
|
||||
BT_ERR("Invalid Provisioning Link ID");
|
||||
return -EINVAL;
|
||||
@@ -1977,7 +1980,7 @@ int bt_mesh_update_exceptional_list(uint8_t sub_code, uint8_t type, void *info)
|
||||
sys_memcpy_swap(value, info, sizeof(uint32_t));
|
||||
}
|
||||
|
||||
BT_DBG("%s exceptional list, type 0x%02x", sub_code ? "Remove" : "Add", type);
|
||||
BT_DBG("%s exceptional list, type 0x%08x", sub_code ? "Remove" : "Add", type);
|
||||
|
||||
/* The parameter "device_info" can't be NULL in the API */
|
||||
BLE_MESH_BTM_CHECK_STATUS(BTM_UpdateBleDuplicateExceptionalList(sub_code, type, value, NULL));
|
||||
|
||||
@@ -776,29 +776,28 @@ int bt_mesh_encrypt_be(const uint8_t key[16], const uint8_t plaintext[16],
|
||||
uint8_t enc_data[16]);
|
||||
|
||||
enum {
|
||||
BLE_MESH_EXCEP_LIST_ADD = 0,
|
||||
BLE_MESH_EXCEP_LIST_REMOVE,
|
||||
BLE_MESH_EXCEP_LIST_CLEAN,
|
||||
BLE_MESH_EXCEP_LIST_SUB_CODE_ADD = 0,
|
||||
BLE_MESH_EXCEP_LIST_SUB_CODE_REMOVE,
|
||||
BLE_MESH_EXCEP_LIST_SUB_CODE_CLEAN,
|
||||
};
|
||||
|
||||
enum {
|
||||
BLE_MESH_EXCEP_INFO_ADV_ADDR = 0,
|
||||
BLE_MESH_EXCEP_INFO_MESH_LINK_ID,
|
||||
BLE_MESH_EXCEP_INFO_MESH_BEACON,
|
||||
BLE_MESH_EXCEP_INFO_MESH_PROV_ADV,
|
||||
BLE_MESH_EXCEP_INFO_MESH_PROXY_ADV,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_ADV_ADDR = 0,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_LINK_ID,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_BEACON,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_PROV_ADV,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_PROXY_ADV,
|
||||
};
|
||||
|
||||
enum {
|
||||
BLE_MESH_EXCEP_CLEAN_ADDR_LIST = BIT(0),
|
||||
BLE_MESH_EXCEP_CLEAN_MESH_LINK_ID_LIST = BIT(1),
|
||||
BLE_MESH_EXCEP_CLEAN_MESH_BEACON_LIST = BIT(2),
|
||||
BLE_MESH_EXCEP_CLEAN_MESH_PROV_ADV_LIST = BIT(3),
|
||||
BLE_MESH_EXCEP_CLEAN_MESH_PROXY_ADV_LIST = BIT(4),
|
||||
BLE_MESH_EXCEP_CLEAN_ALL_LIST = 0xFFFF,
|
||||
};
|
||||
#define BLE_MESH_EXCEP_LIST_CLEAN_ADDR_LIST BIT(0)
|
||||
#define BLE_MESH_EXCEP_LIST_CLEAN_MESH_LINK_ID_LIST BIT(1)
|
||||
#define BLE_MESH_EXCEP_LIST_CLEAN_MESH_BEACON_LIST BIT(2)
|
||||
#define BLE_MESH_EXCEP_LIST_CLEAN_MESH_PROV_ADV_LIST BIT(3)
|
||||
#define BLE_MESH_EXCEP_LIST_CLEAN_MESH_PROXY_ADV_LIST BIT(4)
|
||||
#define BLE_MESH_EXCEP_LIST_CLEAN_ALL_LIST (BIT(0) | BIT(1) | \
|
||||
BIT(2) | BIT(3) | BIT(4))
|
||||
|
||||
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);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -613,14 +613,14 @@ int bt_mesh_provisioner_enable(bt_mesh_prov_bearer_t bearers)
|
||||
#if defined(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN)
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_PB_ADV) &&
|
||||
(bearers & BLE_MESH_PROV_ADV)) {
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_ADD,
|
||||
BLE_MESH_EXCEP_INFO_MESH_BEACON, NULL);
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_SUB_CODE_ADD,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_BEACON, NULL);
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_PB_GATT) &&
|
||||
(bearers & BLE_MESH_PROV_GATT)) {
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_ADD,
|
||||
BLE_MESH_EXCEP_INFO_MESH_PROV_ADV, NULL);
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_SUB_CODE_ADD,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_PROV_ADV, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -668,8 +668,8 @@ int bt_mesh_provisioner_disable(bt_mesh_prov_bearer_t bearers)
|
||||
(bearers & BLE_MESH_PROV_GATT)) {
|
||||
bt_mesh_proxy_client_prov_disable();
|
||||
#if defined(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN)
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_REMOVE,
|
||||
BLE_MESH_EXCEP_INFO_MESH_PROV_ADV, NULL);
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_SUB_CODE_REMOVE,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_PROV_ADV, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -680,8 +680,8 @@ int bt_mesh_provisioner_disable(bt_mesh_prov_bearer_t bearers)
|
||||
#if defined(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN)
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_PB_ADV) &&
|
||||
(enable & BLE_MESH_PROV_ADV)) {
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_REMOVE,
|
||||
BLE_MESH_EXCEP_INFO_MESH_BEACON, NULL);
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_SUB_CODE_REMOVE,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_BEACON, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -673,7 +673,11 @@ bool bt_mesh_net_iv_update(uint32_t iv_index, bool iv_update)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (iv_index > bt_mesh.iv_index + 1) {
|
||||
if ((iv_index > bt_mesh.iv_index + 1)
|
||||
#if CONFIG_BLE_MESH_IVU_RECOVERY_IVI
|
||||
|| (iv_index == bt_mesh.iv_index + 1 && !iv_update)
|
||||
#endif
|
||||
) {
|
||||
BT_WARN("Performing IV Index Recovery");
|
||||
(void)memset(bt_mesh.rpl, 0, sizeof(bt_mesh.rpl));
|
||||
bt_mesh.iv_index = iv_index;
|
||||
@@ -681,10 +685,12 @@ bool bt_mesh_net_iv_update(uint32_t iv_index, bool iv_update)
|
||||
goto do_update;
|
||||
}
|
||||
|
||||
#if !CONFIG_BLE_MESH_IVU_RECOVERY_IVI
|
||||
if (iv_index == bt_mesh.iv_index + 1 && !iv_update) {
|
||||
BT_WARN("Ignoring new index in normal mode");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!iv_update) {
|
||||
/* Nothing to do */
|
||||
@@ -1544,8 +1550,8 @@ void bt_mesh_net_start(void)
|
||||
|
||||
#if defined(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN)
|
||||
/* Add Mesh beacon type (Secure Network Beacon) to the exceptional list */
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_ADD,
|
||||
BLE_MESH_EXCEP_INFO_MESH_BEACON, NULL);
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_SUB_CODE_ADD,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_BEACON, NULL);
|
||||
#endif
|
||||
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_LOW_POWER)) {
|
||||
|
||||
@@ -311,8 +311,8 @@ static void reset_adv_link(void)
|
||||
|
||||
#if defined(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN)
|
||||
/* Remove the link id from exceptional list */
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_REMOVE,
|
||||
BLE_MESH_EXCEP_INFO_MESH_LINK_ID, &link.id);
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_SUB_CODE_REMOVE,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_LINK_ID, &link.id);
|
||||
#endif
|
||||
|
||||
reset_state();
|
||||
@@ -1380,8 +1380,8 @@ static void link_open(struct prov_rx *rx, struct net_buf_simple *buf)
|
||||
|
||||
#if defined(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN)
|
||||
/* Add the link id into exceptional list */
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_ADD,
|
||||
BLE_MESH_EXCEP_INFO_MESH_LINK_ID, &link.id);
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_SUB_CODE_ADD,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_LINK_ID, &link.id);
|
||||
#endif
|
||||
|
||||
bearer_ctl_send(LINK_ACK, NULL, 0);
|
||||
@@ -1837,8 +1837,8 @@ int bt_mesh_prov_deinit(void)
|
||||
k_delayed_work_free(&link.tx.retransmit);
|
||||
#if defined(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN)
|
||||
/* Remove the link id from exceptional list */
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_REMOVE,
|
||||
BLE_MESH_EXCEP_INFO_MESH_LINK_ID, &link.id);
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_SUB_CODE_REMOVE,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_LINK_ID, &link.id);
|
||||
#endif /* CONFIG_BLE_MESH_USE_DUPLICATE_SCAN */
|
||||
#endif /* CONFIG_BLE_MESH_PB_ADV */
|
||||
|
||||
|
||||
@@ -1318,8 +1318,8 @@ static void reset_link(const uint8_t idx, uint8_t reason)
|
||||
|
||||
#if defined(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN)
|
||||
/* Remove the link id from exceptional list */
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_REMOVE,
|
||||
BLE_MESH_EXCEP_INFO_MESH_LINK_ID, &link[idx].link_id);
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_SUB_CODE_REMOVE,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_LINK_ID, &link[idx].link_id);
|
||||
#endif
|
||||
|
||||
/* Clear everything except the retransmit delayed work config */
|
||||
@@ -1478,8 +1478,8 @@ static void send_link_open(const uint8_t idx)
|
||||
|
||||
#if defined(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN)
|
||||
/* Add the link id into exceptional list */
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_ADD,
|
||||
BLE_MESH_EXCEP_INFO_MESH_LINK_ID, &link[idx].link_id);
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_SUB_CODE_ADD,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_LINK_ID, &link[idx].link_id);
|
||||
#endif
|
||||
|
||||
bearer_ctl_send(idx, LINK_OPEN, link[idx].uuid, 16);
|
||||
@@ -3338,8 +3338,8 @@ int bt_mesh_provisioner_prov_reset(bool erase)
|
||||
#if CONFIG_BLE_MESH_PB_ADV
|
||||
prov_clear_tx(i);
|
||||
#if CONFIG_BLE_MESH_USE_DUPLICATE_SCAN
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_REMOVE,
|
||||
BLE_MESH_EXCEP_INFO_MESH_LINK_ID, &link[i].link_id);
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_SUB_CODE_REMOVE,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_LINK_ID, &link[i].link_id);
|
||||
#endif
|
||||
memset(&link[i], 0, offsetof(struct prov_link, tx.retransmit));
|
||||
link[i].pending_ack = XACT_NVAL;
|
||||
|
||||
@@ -983,8 +983,8 @@ int bt_mesh_proxy_client_init(void)
|
||||
bt_mesh_gattc_conn_cb_register(&conn_callbacks);
|
||||
|
||||
#if CONFIG_BLE_MESH_USE_DUPLICATE_SCAN && CONFIG_BLE_MESH_GATT_PROXY_CLIENT
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_ADD,
|
||||
BLE_MESH_EXCEP_INFO_MESH_PROXY_ADV, NULL);
|
||||
bt_mesh_update_exceptional_list(BLE_MESH_EXCEP_LIST_SUB_CODE_ADD,
|
||||
BLE_MESH_EXCEP_LIST_TYPE_MESH_PROXY_ADV, NULL);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -73,6 +73,7 @@ static uint16_t proxy_ccc_val;
|
||||
#if defined(CONFIG_BLE_MESH_PB_GATT)
|
||||
static uint16_t prov_ccc_val;
|
||||
static bool prov_fast_adv;
|
||||
static uint32_t prov_start_time;
|
||||
#endif
|
||||
|
||||
static struct bt_mesh_proxy_client {
|
||||
@@ -1377,12 +1378,16 @@ int32_t bt_mesh_proxy_server_adv_start(void)
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BLE_MESH_PB_GATT)
|
||||
if (prov_fast_adv) {
|
||||
prov_start_time = k_uptime_get_32();
|
||||
}
|
||||
|
||||
if (!bt_mesh_is_provisioned()) {
|
||||
const struct bt_mesh_adv_param *param;
|
||||
struct bt_mesh_adv_data prov_sd[2];
|
||||
size_t prov_sd_len;
|
||||
|
||||
if (prov_fast_adv) {
|
||||
if (k_uptime_get_32() - prov_start_time < K_SECONDS(60)) {
|
||||
param = &fast_adv_param;
|
||||
} else {
|
||||
param = &slow_adv_param;
|
||||
|
||||
@@ -129,14 +129,6 @@ int bt_mesh_server_get_optional(struct bt_mesh_model *model,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Currently we only get optional msg info which dst is set to a unicast address */
|
||||
if (!BLE_MESH_ADDR_IS_UNICAST(ctx->recv_dst)) {
|
||||
*trans_time = 0U;
|
||||
*delay = 0U;
|
||||
*optional = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* No optional fields are available */
|
||||
if (buf->len == 0x00) {
|
||||
if (model->id == BLE_MESH_MODEL_ID_LIGHT_LC_SRV) {
|
||||
|
||||
@@ -165,6 +165,13 @@ config BT_GATT_MAX_SR_PROFILES
|
||||
help
|
||||
Maximum GATT Server Profiles Count
|
||||
|
||||
config BT_GATT_MAX_SR_ATTRIBUTES
|
||||
int "Max GATT Service Attributes"
|
||||
depends on BT_GATTS_ENABLE && BT_BLUEDROID_ENABLED
|
||||
range 1 500
|
||||
default 100
|
||||
help
|
||||
Maximum GATT Service Attributes Count
|
||||
|
||||
|
||||
choice BT_GATTS_SEND_SERVICE_CHANGE_MODE
|
||||
@@ -200,6 +207,14 @@ config BT_GATTC_ENABLE
|
||||
help
|
||||
This option can be close when the app work only on gatt server mode
|
||||
|
||||
config BT_GATTC_MAX_CACHE_CHAR
|
||||
int "Max gattc cache characteristic for discover"
|
||||
depends on BT_GATTC_ENABLE
|
||||
range 1 500
|
||||
default 40
|
||||
help
|
||||
Maximum GATTC cache characteristic count
|
||||
|
||||
config BT_GATTC_CACHE_NVS_FLASH
|
||||
bool "Save gattc cache data to nvs flash"
|
||||
depends on BT_GATTC_ENABLE
|
||||
@@ -978,12 +993,16 @@ menu "BT DEBUG LOG LEVEL"
|
||||
endmenu #BT DEBUG LOG LEVEL
|
||||
|
||||
config BT_ACL_CONNECTIONS
|
||||
int "BT/BLE MAX ACL CONNECTIONS(1~7)"
|
||||
int "BT/BLE MAX ACL CONNECTIONS(1~9)"
|
||||
depends on BT_BLUEDROID_ENABLED
|
||||
range 1 7
|
||||
range 1 9
|
||||
default 4
|
||||
help
|
||||
Maximum BT/BLE connection count
|
||||
Maximum BT/BLE connection count. The ESP32-C3/S3 chip supports a maximum of 10 instances,
|
||||
including ADV, SCAN and connections. The ESP32-C3/S3 chip can connect up to 9 devices if
|
||||
ADV or SCAN uses only one. If ADV and SCAN are both used, The ESP32-C3/S3 chip is connected
|
||||
to a maximum of 8 devices. Because Bluetooth cannot reclaim used instances once ADV or SCAN
|
||||
is used.
|
||||
|
||||
config BT_MULTI_CONNECTION_ENBALE
|
||||
bool "Enable BLE multi-conections"
|
||||
@@ -1022,7 +1041,7 @@ config BT_SMP_ENABLE
|
||||
|
||||
config BT_BLE_ACT_SCAN_REP_ADV_SCAN
|
||||
bool "Report adv data and scan response individually when BLE active scan"
|
||||
depends on BT_BLUEDROID_ENABLED && (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY)
|
||||
depends on BT_BLUEDROID_ENABLED && BT_BLE_ENABLED
|
||||
default n
|
||||
help
|
||||
Originally, when doing BLE active scan, Bluedroid will not report adv to application layer
|
||||
|
||||
@@ -40,7 +40,7 @@ esp_err_t esp_a2d_sink_init(void)
|
||||
msg.act = BTC_AV_SINK_API_INIT_EVT;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ esp_err_t esp_a2d_sink_deinit(void)
|
||||
msg.act = BTC_AV_SINK_API_DEINIT_EVT;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ esp_err_t esp_a2d_sink_register_data_callback(esp_a2d_sink_data_cb_t callback)
|
||||
arg.data_cb = callback;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_av_args_t), NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_av_args_t), NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ esp_err_t esp_a2d_sink_connect(esp_bd_addr_t remote_bda)
|
||||
|
||||
/* Switch to BTC context */
|
||||
memcpy(&(arg.connect), remote_bda, sizeof(bt_bdaddr_t));
|
||||
stat = btc_transfer_context(&msg, &arg, sizeof(btc_av_args_t), NULL);
|
||||
stat = btc_transfer_context(&msg, &arg, sizeof(btc_av_args_t), NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ esp_err_t esp_a2d_sink_disconnect(esp_bd_addr_t remote_bda)
|
||||
|
||||
/* Switch to BTC context */
|
||||
memcpy(&(arg.disconn), remote_bda, sizeof(bt_bdaddr_t));
|
||||
stat = btc_transfer_context(&msg, &arg, sizeof(btc_av_args_t), NULL);
|
||||
stat = btc_transfer_context(&msg, &arg, sizeof(btc_av_args_t), NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ esp_err_t esp_a2d_media_ctrl(esp_a2d_media_ctrl_t ctrl)
|
||||
|
||||
/* Switch to BTC context */
|
||||
arg.ctrl = ctrl;
|
||||
stat = btc_transfer_context(&msg, &arg, sizeof(btc_av_args_t), NULL);
|
||||
stat = btc_transfer_context(&msg, &arg, sizeof(btc_av_args_t), NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ esp_err_t esp_a2d_source_init(void)
|
||||
msg.act = BTC_AV_SRC_API_INIT_EVT;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ esp_err_t esp_a2d_source_deinit(void)
|
||||
msg.act = BTC_AV_SRC_API_DEINIT_EVT;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ esp_err_t esp_a2d_source_connect(esp_bd_addr_t remote_bda)
|
||||
|
||||
/* Switch to BTC context */
|
||||
memcpy(&(arg.src_connect), remote_bda, sizeof(bt_bdaddr_t));
|
||||
stat = btc_transfer_context(&msg, &arg, sizeof(btc_av_args_t), NULL);
|
||||
stat = btc_transfer_context(&msg, &arg, sizeof(btc_av_args_t), NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ esp_err_t esp_a2d_source_disconnect(esp_bd_addr_t remote_bda)
|
||||
|
||||
/* Switch to BTC context */
|
||||
memcpy(&(arg.src_disconn), remote_bda, sizeof(bt_bdaddr_t));
|
||||
stat = btc_transfer_context(&msg, &arg, sizeof(btc_av_args_t), NULL);
|
||||
stat = btc_transfer_context(&msg, &arg, sizeof(btc_av_args_t), NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ esp_err_t esp_a2d_source_register_data_callback(esp_a2d_source_data_cb_t callbac
|
||||
arg.src_data_cb = callback;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_av_args_t), NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_av_args_t), NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ esp_err_t esp_avrc_ct_init(void)
|
||||
msg.act = BTC_AVRC_CT_API_INIT_EVT;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ esp_err_t esp_avrc_ct_deinit(void)
|
||||
msg.act = BTC_AVRC_CT_API_DEINIT_EVT;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ esp_err_t esp_avrc_ct_send_set_player_value_cmd(uint8_t tl, uint8_t attr_id, uin
|
||||
arg.ps_cmd.value_id = value_id;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_args_t), NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_args_t), NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ esp_err_t esp_avrc_ct_send_get_rn_capabilities_cmd(uint8_t tl)
|
||||
arg.get_caps_cmd.tl = tl;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_args_t), NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_args_t), NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ esp_err_t esp_avrc_ct_send_register_notification_cmd(uint8_t tl, uint8_t event_i
|
||||
arg.rn_cmd.event_parameter = event_parameter;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_args_t), NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_args_t), NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ esp_err_t esp_avrc_ct_send_set_absolute_volume_cmd(uint8_t tl, uint8_t volume)
|
||||
arg.set_abs_vol_cmd.volume = volume;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_args_t), NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_args_t), NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ esp_err_t esp_avrc_ct_send_metadata_cmd(uint8_t tl, uint8_t attr_mask)
|
||||
arg.md_cmd.attr_mask = attr_mask;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_args_t), NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_args_t), NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ esp_err_t esp_avrc_ct_send_passthrough_cmd(uint8_t tl, uint8_t key_code, uint8_t
|
||||
arg.pt_cmd.key_state = key_state;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_args_t), NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_args_t), NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ esp_err_t esp_avrc_tg_init(void)
|
||||
msg.act = BTC_AVRC_TG_API_INIT_EVT;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ esp_err_t esp_avrc_tg_deinit(void)
|
||||
msg.act = BTC_AVRC_TG_API_DEINIT_EVT;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -369,7 +369,7 @@ esp_err_t esp_avrc_tg_set_psth_cmd_filter(esp_avrc_psth_filter_t filter, const e
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_tg_args_t),
|
||||
btc_avrc_tg_arg_deep_copy);
|
||||
btc_avrc_tg_arg_deep_copy, btc_avrc_tg_arg_deep_free);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
} else {
|
||||
return ESP_FAIL;
|
||||
@@ -422,7 +422,7 @@ esp_err_t esp_avrc_tg_set_rn_evt_cap(const esp_avrc_rn_evt_cap_mask_t *evt_set)
|
||||
arg.set_rn_evt = evt_set->bits;
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_tg_args_t), NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_tg_args_t), NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -477,7 +477,7 @@ esp_err_t esp_avrc_tg_send_rn_rsp(esp_avrc_rn_event_ids_t event_id, esp_avrc_rn_
|
||||
memcpy(&arg.rn_rsp.param, param, sizeof(esp_avrc_rn_param_t));
|
||||
|
||||
/* Switch to BTC context */
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_tg_args_t), NULL);
|
||||
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_tg_args_t), NULL, NULL);
|
||||
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
|
||||
|
||||
}
|
||||
|
||||
@@ -45,5 +45,5 @@ esp_err_t esp_bt_dev_set_device_name(const char *name)
|
||||
|
||||
strcpy(arg.set_dev_name.device_name, name);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_dev_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_dev_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ esp_err_t esp_bluedroid_enable(void)
|
||||
msg.pid = BTC_PID_MAIN_INIT;
|
||||
msg.act = BTC_MAIN_ACT_ENABLE;
|
||||
|
||||
if (btc_transfer_context(&msg, NULL, 0, NULL) != BT_STATUS_SUCCESS) {
|
||||
if (btc_transfer_context(&msg, NULL, 0, NULL, NULL) != BT_STATUS_SUCCESS) {
|
||||
LOG_ERROR("Bluedroid enable failed\n");
|
||||
return ESP_FAIL;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ esp_err_t esp_bluedroid_disable(void)
|
||||
msg.pid = BTC_PID_MAIN_INIT;
|
||||
msg.act = BTC_MAIN_ACT_DISABLE;
|
||||
|
||||
if (btc_transfer_context(&msg, NULL, 0, NULL) != BT_STATUS_SUCCESS) {
|
||||
if (btc_transfer_context(&msg, NULL, 0, NULL, NULL) != BT_STATUS_SUCCESS) {
|
||||
LOG_ERROR("Bluedroid disable failed\n");
|
||||
return ESP_FAIL;
|
||||
}
|
||||
@@ -153,7 +153,7 @@ esp_err_t esp_bluedroid_init(void)
|
||||
msg.pid = BTC_PID_MAIN_INIT;
|
||||
msg.act = BTC_MAIN_ACT_INIT;
|
||||
|
||||
if (btc_transfer_context(&msg, NULL, 0, NULL) != BT_STATUS_SUCCESS) {
|
||||
if (btc_transfer_context(&msg, NULL, 0, NULL, NULL) != BT_STATUS_SUCCESS) {
|
||||
LOG_ERROR("Bluedroid Initialize Fail");
|
||||
return ESP_FAIL;
|
||||
}
|
||||
@@ -195,7 +195,7 @@ esp_err_t esp_bluedroid_deinit(void)
|
||||
msg.pid = BTC_PID_MAIN_INIT;
|
||||
msg.act = BTC_MAIN_ACT_DEINIT;
|
||||
|
||||
if (btc_transfer_context(&msg, NULL, 0, NULL) != BT_STATUS_SUCCESS) {
|
||||
if (btc_transfer_context(&msg, NULL, 0, NULL, NULL) != BT_STATUS_SUCCESS) {
|
||||
LOG_ERROR("Bluedroid de-initialise failed\n");
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ esp_err_t esp_ble_gap_config_adv_data(esp_ble_adv_data_t *adv_data)
|
||||
msg.act = BTC_GAP_BLE_ACT_CFG_ADV_DATA;
|
||||
memcpy(&arg.cfg_adv_data.adv_data, adv_data, sizeof(esp_ble_adv_data_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), btc_gap_ble_arg_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ esp_err_t esp_ble_gap_set_scan_params(esp_ble_scan_params_t *scan_params)
|
||||
msg.act = BTC_GAP_BLE_ACT_SET_SCAN_PARAM;
|
||||
memcpy(&arg.set_scan_param.scan_params, scan_params, sizeof(esp_ble_scan_params_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_start_scanning(uint32_t duration)
|
||||
@@ -87,7 +87,7 @@ esp_err_t esp_ble_gap_start_scanning(uint32_t duration)
|
||||
msg.act = BTC_GAP_BLE_ACT_START_SCAN;
|
||||
arg.start_scan.duration = duration;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ esp_err_t esp_ble_gap_stop_scanning(void)
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_ACT_STOP_SCAN;
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_start_advertising(esp_ble_adv_params_t *adv_params)
|
||||
@@ -115,7 +115,7 @@ esp_err_t esp_ble_gap_start_advertising(esp_ble_adv_params_t *adv_params)
|
||||
msg.act = BTC_GAP_BLE_ACT_START_ADV;
|
||||
memcpy(&arg.start_adv.adv_params, adv_params, sizeof(esp_ble_adv_params_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_stop_advertising(void)
|
||||
@@ -128,7 +128,7 @@ esp_err_t esp_ble_gap_stop_advertising(void)
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_ACT_STOP_ADV;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
@@ -154,7 +154,7 @@ esp_err_t esp_ble_gap_update_conn_params(esp_ble_conn_update_params_t *params)
|
||||
msg.act = BTC_GAP_BLE_ACT_UPDATE_CONN_PARAM;
|
||||
memcpy(&arg.conn_update_params.conn_params, params, sizeof(esp_ble_conn_update_params_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
} else {
|
||||
LOG_ERROR("%s,invalid connection params:min_int = %d, max_int = %d, latency = %d, timeout = %d",\
|
||||
__func__, params->min_int, params->max_int, params->latency, params->timeout);
|
||||
@@ -175,7 +175,7 @@ esp_err_t esp_ble_gap_set_pkt_data_len(esp_bd_addr_t remote_device, uint16_t tx_
|
||||
arg.set_pkt_data_len.tx_data_length = tx_data_length;
|
||||
memcpy(arg.set_pkt_data_len.remote_device, remote_device, ESP_BD_ADDR_LEN);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ esp_err_t esp_ble_gap_set_rand_addr(esp_bd_addr_t rand_addr)
|
||||
msg.act = BTC_GAP_BLE_ACT_SET_RAND_ADDRESS;
|
||||
memcpy(arg.set_rand_addr.rand_addr, rand_addr, ESP_BD_ADDR_LEN);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_clear_rand_addr(void)
|
||||
@@ -204,7 +204,7 @@ esp_err_t esp_ble_gap_clear_rand_addr(void)
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_ACT_CLEAR_RAND_ADDRESS;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_config_local_privacy (bool privacy_enable)
|
||||
@@ -219,7 +219,7 @@ esp_err_t esp_ble_gap_config_local_privacy (bool privacy_enable)
|
||||
msg.act = BTC_GAP_BLE_ACT_CONFIG_LOCAL_PRIVACY;
|
||||
arg.cfg_local_privacy.privacy_enable = privacy_enable;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_config_local_icon (uint16_t icon)
|
||||
@@ -293,7 +293,7 @@ esp_err_t esp_ble_gap_config_local_icon (uint16_t icon)
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_ACT_CONFIG_LOCAL_ICON;
|
||||
arg.cfg_local_icon.icon = icon;
|
||||
ret = (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
ret = (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
break;
|
||||
default:
|
||||
ret = ESP_ERR_INVALID_ARG;
|
||||
@@ -320,7 +320,7 @@ esp_err_t esp_ble_gap_update_whitelist(bool add_remove, esp_bd_addr_t remote_bda
|
||||
arg.update_white_list.wl_addr_type = wl_addr_type;
|
||||
memcpy(arg.update_white_list.remote_bda, remote_bda, sizeof(esp_bd_addr_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -335,8 +335,7 @@ esp_err_t esp_ble_gap_clear_whitelist(void)
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_ACT_CLEAR_WHITE_LIST;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_get_whitelist_size(uint16_t *length)
|
||||
@@ -375,7 +374,7 @@ esp_err_t esp_ble_gap_set_prefer_conn_params(esp_bd_addr_t bd_addr,
|
||||
arg.set_conn_params.supervision_tout = supervision_tout;
|
||||
memcpy(arg.set_conn_params.bd_addr, bd_addr, sizeof(esp_bd_addr_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
} else {
|
||||
LOG_ERROR("%s,invalid connection params:min_int = %d, max_int = %d, latency = %d, timeout = %d",\
|
||||
@@ -438,7 +437,8 @@ esp_err_t esp_ble_gap_config_adv_data_raw(uint8_t *raw_data, uint32_t raw_data_l
|
||||
arg.cfg_adv_data_raw.raw_adv = raw_data;
|
||||
arg.cfg_adv_data_raw.raw_adv_len = raw_data_len;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), btc_gap_ble_arg_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
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);
|
||||
|
||||
}
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
@@ -456,7 +456,7 @@ esp_err_t esp_ble_gap_read_rssi(esp_bd_addr_t remote_addr)
|
||||
msg.act = BTC_GAP_BLE_ACT_READ_RSSI;
|
||||
memcpy(arg.read_rssi.remote_addr, remote_addr, sizeof(esp_bd_addr_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
esp_err_t esp_ble_gap_config_scan_rsp_data_raw(uint8_t *raw_data, uint32_t raw_data_len)
|
||||
@@ -477,7 +477,8 @@ esp_err_t esp_ble_gap_config_scan_rsp_data_raw(uint8_t *raw_data, uint32_t raw_d
|
||||
arg.cfg_scan_rsp_data_raw.raw_scan_rsp = raw_data;
|
||||
arg.cfg_scan_rsp_data_raw.raw_scan_rsp_len = raw_data_len;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), btc_gap_ble_arg_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
@@ -501,7 +502,7 @@ esp_err_t esp_ble_gap_add_duplicate_scan_exceptional_device(esp_ble_duplicate_ex
|
||||
memcpy(arg.update_duplicate_exceptional_list.device_info, device_info, sizeof(esp_bd_addr_t));
|
||||
}
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -525,7 +526,7 @@ esp_err_t esp_ble_gap_remove_duplicate_scan_exceptional_device(esp_ble_duplicate
|
||||
memcpy(arg.update_duplicate_exceptional_list.device_info, device_info, sizeof(esp_bd_addr_t));
|
||||
}
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -544,7 +545,7 @@ esp_err_t esp_ble_gap_clean_duplicate_scan_exceptional_list(esp_duplicate_scan_e
|
||||
arg.update_duplicate_exceptional_list.subcode = ESP_BLE_DUPLICATE_EXCEPTIONAL_LIST_CLEAN;
|
||||
arg.update_duplicate_exceptional_list.info_type = list_type;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
@@ -581,8 +582,8 @@ esp_err_t esp_ble_gap_set_security_param(esp_ble_sm_param_t param_type,
|
||||
arg.set_security_param.len = len;
|
||||
arg.set_security_param.value = value;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), btc_gap_ble_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
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_set_encryption(esp_bd_addr_t bd_addr, esp_ble_sec_act_t sec_act)
|
||||
@@ -598,7 +599,7 @@ esp_err_t esp_ble_set_encryption(esp_bd_addr_t bd_addr, esp_ble_sec_act_t sec_ac
|
||||
arg.set_encryption.sec_act = sec_act;
|
||||
memcpy(arg.set_encryption.bd_addr, bd_addr, ESP_BD_ADDR_LEN);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -615,7 +616,7 @@ esp_err_t esp_ble_gap_security_rsp(esp_bd_addr_t bd_addr, bool accept)
|
||||
arg.sec_rsp.accept = accept;
|
||||
memcpy(arg.sec_rsp.bd_addr, bd_addr, ESP_BD_ADDR_LEN);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
|
||||
}
|
||||
@@ -634,7 +635,7 @@ esp_err_t esp_ble_passkey_reply(esp_bd_addr_t bd_addr, bool accept, uint32_t pas
|
||||
arg.enc_passkey_replay.passkey = passkey;
|
||||
memcpy(arg.enc_passkey_replay.bd_addr, bd_addr, ESP_BD_ADDR_LEN);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -651,7 +652,7 @@ esp_err_t esp_ble_confirm_reply(esp_bd_addr_t bd_addr, bool accept)
|
||||
arg.enc_comfirm_replay.accept = accept;
|
||||
memcpy(arg.enc_comfirm_replay.bd_addr, bd_addr, ESP_BD_ADDR_LEN);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -664,7 +665,7 @@ esp_err_t esp_ble_remove_bond_device(esp_bd_addr_t bd_addr)
|
||||
msg.act = BTC_GAP_BLE_REMOVE_BOND_DEV_EVT;
|
||||
memcpy(arg.remove_bond_device.bd_addr, bd_addr, ESP_BD_ADDR_LEN);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -716,8 +717,8 @@ esp_err_t esp_ble_oob_req_reply(esp_bd_addr_t bd_addr, uint8_t *TK, uint8_t len)
|
||||
arg.oob_req_reply.len = len;
|
||||
arg.oob_req_reply.p_value = TK;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), btc_gap_ble_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
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);
|
||||
}
|
||||
|
||||
#endif /* #if (SMP_INCLUDED == TRUE) */
|
||||
@@ -734,7 +735,7 @@ esp_err_t esp_ble_gap_disconnect(esp_bd_addr_t remote_device)
|
||||
msg.act = BTC_GAP_BLE_DISCONNECT_EVT;
|
||||
memcpy(arg.disconnect.remote_device, remote_device, ESP_BD_ADDR_LEN);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_get_current_conn_params(esp_bd_addr_t bd_addr, esp_gap_conn_params_t *conn_params)
|
||||
@@ -763,7 +764,7 @@ esp_err_t esp_gap_ble_set_channels(esp_gap_ble_channels channels)
|
||||
|
||||
memcpy(&arg.set_channels.channels, channels, ESP_GAP_BLE_CHANNELS_LEN);
|
||||
arg.set_channels.channels[ESP_GAP_BLE_CHANNELS_LEN -1] &= 0x1F;
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_gap_ble_set_authorization(esp_bd_addr_t bd_addr, bool authorize)
|
||||
@@ -791,7 +792,7 @@ esp_err_t esp_ble_gap_read_phy(esp_bd_addr_t bd_addr)
|
||||
msg.act = BTC_GAP_BLE_READ_PHY;
|
||||
|
||||
memcpy(arg.read_phy.bd_addr, bd_addr, ESP_BD_ADDR_LEN);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -809,7 +810,7 @@ esp_err_t esp_ble_gap_set_prefered_default_phy(esp_ble_gap_phy_mask_t tx_phy_mas
|
||||
arg.set_perf_def_phy.tx_phy_mask = tx_phy_mask;
|
||||
arg.set_perf_def_phy.rx_phy_mask = rx_phy_mask;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -832,7 +833,7 @@ esp_err_t esp_ble_gap_set_prefered_phy(esp_bd_addr_t bd_addr,
|
||||
arg.set_def_phy.tx_phy_mask = tx_phy_mask;
|
||||
arg.set_def_phy.rx_phy_mask = rx_phy_mask;
|
||||
arg.set_def_phy.phy_options = phy_options;
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -849,7 +850,7 @@ esp_err_t esp_ble_gap_ext_adv_set_rand_addr(uint8_t instance, esp_bd_addr_t rand
|
||||
arg.ext_adv_set_rand_addr.instance = instance;
|
||||
memcpy(arg.ext_adv_set_rand_addr.rand_addr, rand_addr, BD_ADDR_LEN);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
|
||||
}
|
||||
@@ -883,7 +884,7 @@ esp_err_t esp_ble_gap_ext_adv_set_params(uint8_t instance,
|
||||
|
||||
arg.ext_adv_set_params.instance = instance;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -903,8 +904,8 @@ esp_err_t esp_ble_gap_config_ext_adv_data_raw(uint8_t instance, uint16_t length,
|
||||
arg.ext_adv_cfg_data.length = length;
|
||||
arg.ext_adv_cfg_data.data = (uint8_t *)data;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), btc_gap_ble_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
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);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_config_ext_scan_rsp_data_raw(uint8_t instance, uint16_t length,
|
||||
@@ -923,8 +924,8 @@ esp_err_t esp_ble_gap_config_ext_scan_rsp_data_raw(uint8_t instance, uint16_t le
|
||||
arg.cfg_scan_rsp.length = length;
|
||||
arg.cfg_scan_rsp.data = (uint8_t *)scan_rsp_data;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), btc_gap_ble_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
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);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_ext_adv_start(uint8_t num_adv, const esp_ble_gap_ext_adv_t *ext_adv)
|
||||
@@ -941,8 +942,8 @@ esp_err_t esp_ble_gap_ext_adv_start(uint8_t num_adv, const esp_ble_gap_ext_adv_t
|
||||
arg.ext_adv_start.num_adv = num_adv;
|
||||
arg.ext_adv_start.ext_adv = (esp_ble_gap_ext_adv_t *)ext_adv;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), btc_gap_ble_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
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);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_ext_adv_stop(uint8_t num_adv, const uint8_t *ext_adv_inst)
|
||||
@@ -958,8 +959,8 @@ esp_err_t esp_ble_gap_ext_adv_stop(uint8_t num_adv, const uint8_t *ext_adv_inst)
|
||||
arg.ext_adv_stop.num_adv = num_adv;
|
||||
arg.ext_adv_stop.ext_adv_inst = (uint8_t *)ext_adv_inst;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), btc_gap_ble_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
@@ -975,7 +976,7 @@ esp_err_t esp_ble_gap_ext_adv_set_remove(uint8_t instance)
|
||||
msg.act = BTC_GAP_BLE_EXT_ADV_SET_REMOVE;
|
||||
arg.ext_adv_set_remove.instance = instance;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -989,7 +990,7 @@ esp_err_t esp_ble_gap_ext_adv_set_clear(void)
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_EXT_ADV_SET_CLEAR;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_periodic_adv_set_params(uint8_t instance, const esp_ble_gap_periodic_adv_params_t *params)
|
||||
@@ -1006,7 +1007,7 @@ esp_err_t esp_ble_gap_periodic_adv_set_params(uint8_t instance, const esp_ble_ga
|
||||
arg.peridic_adv_set_params.instance = instance;
|
||||
memcpy(&arg.peridic_adv_set_params.params, params, sizeof(esp_ble_gap_periodic_adv_params_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
|
||||
}
|
||||
@@ -1027,8 +1028,8 @@ esp_err_t esp_ble_gap_config_periodic_adv_data_raw(uint8_t instance, uint16_t le
|
||||
arg.periodic_adv_cfg_data.len = length;
|
||||
arg.periodic_adv_cfg_data.data = (uint8_t *)data;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), btc_gap_ble_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
@@ -1045,7 +1046,7 @@ esp_err_t esp_ble_gap_periodic_adv_start(uint8_t instance)
|
||||
|
||||
arg.periodic_adv_start.instance = instance;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
|
||||
}
|
||||
@@ -1063,7 +1064,7 @@ esp_err_t esp_ble_gap_periodic_adv_stop(uint8_t instance)
|
||||
|
||||
arg.periodic_adv_stop.instance = instance;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
|
||||
}
|
||||
@@ -1081,7 +1082,7 @@ esp_err_t esp_ble_gap_periodic_adv_create_sync(const esp_ble_gap_periodic_adv_sy
|
||||
|
||||
memcpy(&arg.periodic_adv_create_sync.params, params, sizeof(esp_ble_gap_periodic_adv_sync_params_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
|
||||
}
|
||||
@@ -1096,7 +1097,7 @@ esp_err_t esp_ble_gap_periodic_adv_sync_cancel(void)
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_PERIODIC_ADV_SYNC_CANCEL;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL)
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
|
||||
}
|
||||
@@ -1114,7 +1115,7 @@ esp_err_t esp_ble_gap_periodic_adv_sync_terminate(uint16_t sync_handle)
|
||||
|
||||
arg.periodic_adv_sync_term.sync_handle = sync_handle;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -1137,7 +1138,7 @@ esp_err_t esp_ble_gap_periodic_adv_add_dev_to_list(esp_ble_addr_type_t addr_type
|
||||
|
||||
memcpy(arg.periodic_adv_add_dev.addr, addr, sizeof(esp_bd_addr_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
|
||||
}
|
||||
@@ -1161,7 +1162,7 @@ esp_err_t esp_ble_gap_periodic_adv_remove_dev_from_list(esp_ble_addr_type_t addr
|
||||
|
||||
memcpy(arg.periodic_adv_remove_dev.addr, addr, sizeof(esp_bd_addr_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
|
||||
}
|
||||
@@ -1176,7 +1177,7 @@ esp_err_t esp_ble_gap_periodic_adv_clear_dev(void)
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_PERIODIC_CLEAR_DEV;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL)
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
|
||||
}
|
||||
@@ -1198,7 +1199,7 @@ esp_err_t esp_ble_gap_set_ext_scan_params(const esp_ble_ext_scan_params_t *param
|
||||
|
||||
memcpy(&arg.set_ext_scan_params.params, params, sizeof(esp_ble_ext_scan_params_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -1216,7 +1217,7 @@ esp_err_t esp_ble_gap_start_ext_scan(uint32_t duration, uint16_t period)
|
||||
arg.start_ext_scan.duration = duration;
|
||||
arg.start_ext_scan.period = period;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -1230,7 +1231,7 @@ esp_err_t esp_ble_gap_stop_ext_scan(void)
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_STOP_EXT_SCAN;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_prefer_ext_connect_params_set(esp_bd_addr_t addr,
|
||||
@@ -1323,7 +1324,7 @@ esp_err_t esp_ble_gap_prefer_ext_connect_params_set(esp_bd_addr_t addr,
|
||||
|
||||
memcpy(arg.set_ext_conn_params.addr, addr, sizeof(esp_bd_addr_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ esp_err_t esp_bt_gap_set_scan_mode(esp_bt_connection_mode_t c_mode, esp_bt_disco
|
||||
arg.set_scan_mode.c_mode = c_mode;
|
||||
arg.set_scan_mode.d_mode = d_mode;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_gap_start_discovery(esp_bt_inq_mode_t mode, uint8_t inq_len, uint8_t num_rsps)
|
||||
@@ -83,7 +83,7 @@ esp_err_t esp_bt_gap_start_discovery(esp_bt_inq_mode_t mode, uint8_t inq_len, ui
|
||||
arg.start_disc.inq_len = inq_len;
|
||||
arg.start_disc.num_rsps = num_rsps;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_gap_cancel_discovery(void)
|
||||
@@ -98,7 +98,7 @@ esp_err_t esp_bt_gap_cancel_discovery(void)
|
||||
msg.pid = BTC_PID_GAP_BT;
|
||||
msg.act = BTC_GAP_BT_ACT_CANCEL_DISCOVERY;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_gap_get_remote_services(esp_bd_addr_t remote_bda)
|
||||
@@ -115,7 +115,7 @@ esp_err_t esp_bt_gap_get_remote_services(esp_bd_addr_t remote_bda)
|
||||
msg.act = BTC_GAP_BT_ACT_GET_REMOTE_SERVICES;
|
||||
|
||||
memcpy(&arg.bda, remote_bda, sizeof(bt_bdaddr_t));
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_gap_get_remote_service_record(esp_bd_addr_t remote_bda, esp_bt_uuid_t *uuid)
|
||||
@@ -133,7 +133,7 @@ esp_err_t esp_bt_gap_get_remote_service_record(esp_bd_addr_t remote_bda, esp_bt_
|
||||
|
||||
memcpy(&arg.get_rmt_srv_rcd.bda, remote_bda, sizeof(bt_bdaddr_t));
|
||||
memcpy(&arg.get_rmt_srv_rcd.uuid, uuid, sizeof(esp_bt_uuid_t));
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
uint8_t *esp_bt_gap_resolve_eir_data(uint8_t *eir, esp_bt_eir_type_t type, uint8_t *length)
|
||||
@@ -174,7 +174,8 @@ esp_err_t esp_bt_gap_config_eir_data(esp_bt_eir_data_t *eir_data)
|
||||
|
||||
memcpy(&arg.config_eir, eir_data, sizeof(esp_bt_eir_data_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), btc_gap_bt_arg_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), btc_gap_bt_arg_deep_copy,
|
||||
btc_gap_bt_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_gap_set_cod(esp_bt_cod_t cod, esp_bt_cod_mode_t mode)
|
||||
@@ -204,7 +205,7 @@ esp_err_t esp_bt_gap_set_cod(esp_bt_cod_t cod, esp_bt_cod_mode_t mode)
|
||||
|
||||
arg.set_cod.mode = mode;
|
||||
memcpy(&arg.set_cod.cod, &cod, sizeof(esp_bt_cod_t));
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
|
||||
@@ -223,7 +224,7 @@ esp_err_t esp_bt_gap_read_rssi_delta(esp_bd_addr_t remote_addr)
|
||||
msg.act = BTC_GAP_BT_ACT_READ_RSSI_DELTA;
|
||||
memcpy(arg.read_rssi_delta.bda.address, remote_addr, sizeof(esp_bd_addr_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_gap_remove_bond_device(esp_bd_addr_t bd_addr)
|
||||
@@ -240,7 +241,7 @@ esp_err_t esp_bt_gap_remove_bond_device(esp_bd_addr_t bd_addr)
|
||||
msg.act = BTC_GAP_BT_ACT_REMOVE_BOND_DEVICE;
|
||||
|
||||
memcpy(arg.rm_bond_device.bda.address, bd_addr, sizeof(esp_bd_addr_t));
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
int esp_bt_gap_get_bond_device_num(void)
|
||||
@@ -289,8 +290,8 @@ esp_err_t esp_bt_gap_set_pin(esp_bt_pin_type_t pin_type, uint8_t pin_code_len, e
|
||||
memset(arg.set_pin_type.pin_code, 0, ESP_BT_PIN_CODE_LEN);
|
||||
}
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), btc_gap_bt_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), btc_gap_bt_arg_deep_copy,
|
||||
btc_gap_bt_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_gap_pin_reply(esp_bd_addr_t bd_addr, bool accept, uint8_t pin_code_len, esp_bt_pin_code_t pin_code)
|
||||
@@ -310,8 +311,8 @@ esp_err_t esp_bt_gap_pin_reply(esp_bd_addr_t bd_addr, bool accept, uint8_t pin_c
|
||||
memcpy(arg.pin_reply.bda.address, bd_addr, sizeof(esp_bd_addr_t));
|
||||
memcpy(arg.pin_reply.pin_code, pin_code, pin_code_len);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), btc_gap_bt_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), btc_gap_bt_arg_deep_copy,
|
||||
btc_gap_bt_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
#if (BT_SSP_INCLUDED == TRUE)
|
||||
@@ -332,8 +333,8 @@ esp_err_t esp_bt_gap_set_security_param(esp_bt_sp_param_t param_type,
|
||||
arg.set_security_param.len = len;
|
||||
arg.set_security_param.value = value;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), btc_gap_bt_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), btc_gap_bt_arg_deep_copy,
|
||||
btc_gap_bt_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_gap_ssp_passkey_reply(esp_bd_addr_t bd_addr, bool accept, uint32_t passkey)
|
||||
@@ -351,8 +352,8 @@ esp_err_t esp_bt_gap_ssp_passkey_reply(esp_bd_addr_t bd_addr, bool accept, uint3
|
||||
arg.passkey_reply.accept = accept;
|
||||
arg.passkey_reply.passkey = passkey;
|
||||
memcpy(arg.passkey_reply.bda.address, bd_addr, sizeof(esp_bd_addr_t));
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), btc_gap_bt_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), btc_gap_bt_arg_deep_copy,
|
||||
btc_gap_bt_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_gap_ssp_confirm_reply(esp_bd_addr_t bd_addr, bool accept)
|
||||
@@ -369,8 +370,8 @@ esp_err_t esp_bt_gap_ssp_confirm_reply(esp_bd_addr_t bd_addr, bool accept)
|
||||
msg.act = BTC_GAP_BT_ACT_CONFIRM_REPLY;
|
||||
arg.confirm_reply.accept = accept;
|
||||
memcpy(arg.confirm_reply.bda.address, bd_addr, sizeof(esp_bd_addr_t));
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), btc_gap_bt_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), btc_gap_bt_arg_deep_copy,
|
||||
btc_gap_bt_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
#endif /*(BT_SSP_INCLUDED == TRUE)*/
|
||||
@@ -390,7 +391,7 @@ esp_err_t esp_bt_gap_set_afh_channels(esp_bt_gap_afh_channels channels)
|
||||
|
||||
memcpy(&arg.set_afh_channels.channels, channels, ESP_BT_GAP_AFH_CHANNELS_LEN);
|
||||
arg.set_afh_channels.channels[ESP_BT_GAP_AFH_CHANNELS_LEN -1] &= 0x7F;
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_gap_read_remote_name(esp_bd_addr_t remote_bda)
|
||||
@@ -407,7 +408,7 @@ esp_err_t esp_bt_gap_read_remote_name(esp_bd_addr_t remote_bda)
|
||||
msg.act = BTC_GAP_BT_ACT_READ_REMOTE_NAME;
|
||||
|
||||
memcpy(&arg.rmt_name_bda, remote_bda, sizeof(bt_bdaddr_t));
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_gap_set_qos(esp_bd_addr_t remote_bda, uint32_t t_poll)
|
||||
@@ -425,6 +426,6 @@ esp_err_t esp_bt_gap_set_qos(esp_bd_addr_t remote_bda, uint32_t t_poll)
|
||||
|
||||
memcpy(&arg.set_qos.bda, remote_bda, sizeof(bt_bdaddr_t));
|
||||
arg.set_qos.t_poll = t_poll;
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_gap_bt_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif /* #if BTC_GAP_BT_INCLUDED == TRUE */
|
||||
|
||||
@@ -37,7 +37,7 @@ esp_err_t esp_ble_gatt_set_local_mtu (uint16_t mtu)
|
||||
msg.act = BTC_GATT_ACT_SET_LOCAL_MTU;
|
||||
arg.set_mtu.mtu = mtu;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatt_com_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatt_com_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
|
||||
@@ -45,7 +45,7 @@ esp_err_t esp_ble_gattc_app_register(uint16_t app_id)
|
||||
msg.act = BTC_GATTC_ACT_APP_REGISTER;
|
||||
arg.app_reg.app_id = app_id;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : 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_app_unregister(esp_gatt_if_t gattc_if)
|
||||
@@ -60,7 +60,7 @@ esp_err_t esp_ble_gattc_app_unregister(esp_gatt_if_t gattc_if)
|
||||
msg.act = BTC_GATTC_ACT_APP_UNREGISTER;
|
||||
arg.app_unreg.gattc_if = gattc_if;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
esp_err_t esp_ble_gattc_open(esp_gatt_if_t gattc_if, esp_bd_addr_t remote_bda, esp_ble_addr_type_t remote_addr_type, bool is_direct)
|
||||
@@ -79,7 +79,7 @@ esp_err_t esp_ble_gattc_open(esp_gatt_if_t gattc_if, esp_bd_addr_t remote_bda, e
|
||||
arg.open.is_direct = is_direct;
|
||||
arg.open.is_aux = false;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
@@ -100,7 +100,7 @@ esp_err_t esp_ble_gattc_aux_open(esp_gatt_if_t gattc_if, esp_bd_addr_t remote_bd
|
||||
arg.open.is_direct = is_direct;
|
||||
arg.open.is_aux = true;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
|
||||
}
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
@@ -117,7 +117,7 @@ esp_err_t esp_ble_gattc_close (esp_gatt_if_t gattc_if, uint16_t conn_id)
|
||||
msg.act = BTC_GATTC_ACT_CLOSE;
|
||||
arg.close.conn_id = BTC_GATT_CREATE_CONN_ID(gattc_if, conn_id);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : 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_send_mtu_req (esp_gatt_if_t gattc_if, uint16_t conn_id)
|
||||
@@ -132,7 +132,7 @@ esp_err_t esp_ble_gattc_send_mtu_req (esp_gatt_if_t gattc_if, uint16_t conn_id)
|
||||
msg.act = BTC_GATTC_ACT_CFG_MTU;
|
||||
arg.cfg_mtu.conn_id = BTC_GATT_CREATE_CONN_ID(gattc_if, conn_id);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : 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_search_service(esp_gatt_if_t gattc_if, uint16_t conn_id, esp_bt_uuid_t *filter_uuid)
|
||||
@@ -154,7 +154,7 @@ esp_err_t esp_ble_gattc_search_service(esp_gatt_if_t gattc_if, uint16_t conn_id,
|
||||
arg.search_srvc.filter_uuid_enable = false;
|
||||
}
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_gatt_status_t esp_ble_gattc_get_service(esp_gatt_if_t gattc_if, uint16_t conn_id, esp_bt_uuid_t *svc_uuid,
|
||||
@@ -369,7 +369,7 @@ esp_err_t esp_ble_gattc_read_char (esp_gatt_if_t gattc_if,
|
||||
arg.read_char.handle = handle;
|
||||
arg.read_char.auth_req = auth_req;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : 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_by_type (esp_gatt_if_t gattc_if,
|
||||
@@ -408,7 +408,7 @@ esp_err_t esp_ble_gattc_read_by_type (esp_gatt_if_t gattc_if,
|
||||
arg.read_by_type.auth_req = auth_req;
|
||||
memcpy(&(arg.read_by_type.uuid), uuid, sizeof(esp_bt_uuid_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : 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_multiple(esp_gatt_if_t gattc_if,
|
||||
@@ -444,7 +444,7 @@ esp_err_t esp_ble_gattc_read_multiple(esp_gatt_if_t gattc_if,
|
||||
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) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
|
||||
@@ -475,7 +475,7 @@ esp_err_t esp_ble_gattc_read_char_descr (esp_gatt_if_t gattc_if,
|
||||
arg.read_descr.handle = handle;
|
||||
arg.read_descr.auth_req = auth_req;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : 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_write_char(esp_gatt_if_t gattc_if,
|
||||
@@ -513,7 +513,8 @@ esp_err_t esp_ble_gattc_write_char(esp_gatt_if_t gattc_if,
|
||||
if(write_type == ESP_GATT_WRITE_TYPE_NO_RSP){
|
||||
l2ble_update_att_acl_pkt_num(L2CA_ADD_BTC_NUM, NULL);
|
||||
}
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), btc_gattc_arg_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), btc_gattc_arg_deep_copy,
|
||||
btc_gattc_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gattc_write_char_descr (esp_gatt_if_t gattc_if,
|
||||
@@ -551,7 +552,8 @@ esp_err_t esp_ble_gattc_write_char_descr (esp_gatt_if_t gattc_if,
|
||||
if(write_type == ESP_GATT_WRITE_TYPE_NO_RSP){
|
||||
l2ble_update_att_acl_pkt_num(L2CA_ADD_BTC_NUM, NULL);
|
||||
}
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), btc_gattc_arg_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), btc_gattc_arg_deep_copy,
|
||||
btc_gattc_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gattc_prepare_write(esp_gatt_if_t gattc_if,
|
||||
@@ -587,7 +589,8 @@ esp_err_t esp_ble_gattc_prepare_write(esp_gatt_if_t gattc_if,
|
||||
arg.prep_write.value = value;
|
||||
arg.prep_write.auth_req = auth_req;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), btc_gattc_arg_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), btc_gattc_arg_deep_copy,
|
||||
btc_gattc_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gattc_prepare_write_char_descr(esp_gatt_if_t gattc_if,
|
||||
@@ -623,7 +626,8 @@ esp_err_t esp_ble_gattc_prepare_write_char_descr(esp_gatt_if_t gattc_if,
|
||||
arg.prep_write_descr.value = value;
|
||||
arg.prep_write_descr.auth_req = auth_req;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), btc_gattc_arg_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), btc_gattc_arg_deep_copy,
|
||||
btc_gattc_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gattc_execute_write (esp_gatt_if_t gattc_if, uint16_t conn_id, bool is_execute)
|
||||
@@ -639,7 +643,7 @@ esp_err_t esp_ble_gattc_execute_write (esp_gatt_if_t gattc_if, uint16_t conn_id,
|
||||
arg.exec_write.conn_id = BTC_GATT_CREATE_CONN_ID(gattc_if, conn_id);
|
||||
arg.exec_write.is_execute = is_execute;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : 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_register_for_notify (esp_gatt_if_t gattc_if,
|
||||
@@ -657,7 +661,7 @@ esp_err_t esp_ble_gattc_register_for_notify (esp_gatt_if_t gattc_if,
|
||||
memcpy(arg.reg_for_notify.remote_bda, server_bda, sizeof(esp_bd_addr_t));
|
||||
arg.reg_for_notify.handle = handle;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : 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_unregister_for_notify (esp_gatt_if_t gattc_if,
|
||||
@@ -674,7 +678,7 @@ esp_err_t esp_ble_gattc_unregister_for_notify (esp_gatt_if_t gattc_if,
|
||||
arg.unreg_for_notify.gattc_if = gattc_if;
|
||||
arg.unreg_for_notify.handle = handle;
|
||||
memcpy(arg.unreg_for_notify.remote_bda, server_bda, sizeof(esp_bd_addr_t));
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : 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_cache_refresh(esp_bd_addr_t remote_bda)
|
||||
@@ -689,7 +693,7 @@ esp_err_t esp_ble_gattc_cache_refresh(esp_bd_addr_t remote_bda)
|
||||
msg.act = BTC_GATTC_ACT_CACHE_REFRESH;
|
||||
memcpy(arg.cache_refresh.remote_bda, remote_bda, sizeof(esp_bd_addr_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : 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_cache_clean(esp_bd_addr_t remote_bda)
|
||||
@@ -704,7 +708,7 @@ esp_err_t esp_ble_gattc_cache_clean(esp_bd_addr_t remote_bda)
|
||||
msg.act = BTC_GATTC_ACT_CACHE_CLEAN;
|
||||
memcpy(arg.cache_clean.remote_bda, remote_bda, sizeof(esp_bd_addr_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : 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_cache_assoc(esp_gatt_if_t gattc_if, esp_bd_addr_t src_addr, esp_bd_addr_t assoc_addr, bool is_assoc)
|
||||
@@ -722,7 +726,7 @@ esp_err_t esp_ble_gattc_cache_assoc(esp_gatt_if_t gattc_if, esp_bd_addr_t src_ad
|
||||
memcpy(arg.cache_assoc.src_addr, src_addr, sizeof(esp_bd_addr_t));
|
||||
memcpy(arg.cache_assoc.assoc_addr, assoc_addr, sizeof(esp_bd_addr_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : 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_cache_get_addr_list(esp_gatt_if_t gattc_if)
|
||||
@@ -736,7 +740,7 @@ esp_err_t esp_ble_gattc_cache_get_addr_list(esp_gatt_if_t gattc_if)
|
||||
msg.pid = BTC_PID_GATTC;
|
||||
msg.act = BTC_GATTC_ATC_CACHE_GET_ADDR_LIST;
|
||||
arg.get_addr_list.gattc_if = gattc_if;
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
#endif ///GATTC_INCLUDED == TRUE
|
||||
|
||||
@@ -46,7 +46,7 @@ esp_err_t esp_ble_gatts_app_register(uint16_t app_id)
|
||||
msg.act = BTC_GATTS_ACT_APP_REGISTER;
|
||||
arg.app_reg.app_id = app_id;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ esp_err_t esp_ble_gatts_app_unregister(esp_gatt_if_t gatts_if)
|
||||
msg.act = BTC_GATTS_ACT_APP_UNREGISTER;
|
||||
arg.app_unreg.gatts_if = gatts_if;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gatts_create_service(esp_gatt_if_t gatts_if,
|
||||
@@ -80,12 +80,12 @@ esp_err_t esp_ble_gatts_create_service(esp_gatt_if_t gatts_if,
|
||||
arg.create_srvc.num_handle = num_handle;
|
||||
memcpy(&arg.create_srvc.service_id, service_id, sizeof(esp_gatt_srvc_id_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gatts_create_attr_tab(const esp_gatts_attr_db_t *gatts_attr_db,
|
||||
esp_gatt_if_t gatts_if,
|
||||
uint8_t max_nb_attr,
|
||||
uint16_t max_nb_attr,
|
||||
uint8_t srvc_inst_id)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
@@ -93,6 +93,11 @@ esp_err_t esp_ble_gatts_create_attr_tab(const esp_gatts_attr_db_t *gatts_attr_db
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
if (max_nb_attr > ESP_GATT_ATTR_HANDLE_MAX) {
|
||||
LOG_ERROR("The number of attribute should not be greater than CONFIG_BT_GATT_MAX_SR_ATTRIBUTES\n");
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GATTS;
|
||||
msg.act = BTC_GATTS_ACT_CREATE_ATTR_TAB;
|
||||
@@ -101,8 +106,8 @@ esp_err_t esp_ble_gatts_create_attr_tab(const esp_gatts_attr_db_t *gatts_attr_db
|
||||
arg.create_attr_tab.srvc_inst_id = srvc_inst_id;
|
||||
arg.create_attr_tab.gatts_attr_db = (esp_gatts_attr_db_t *)gatts_attr_db;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), btc_gatts_arg_deep_copy)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), btc_gatts_arg_deep_copy,
|
||||
btc_gatts_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +124,7 @@ esp_err_t esp_ble_gatts_add_included_service(uint16_t service_handle, uint16_t i
|
||||
arg.add_incl_srvc.service_handle = service_handle;
|
||||
arg.add_incl_srvc.included_service_handle = included_service_handle;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
|
||||
@@ -157,7 +162,8 @@ esp_err_t esp_ble_gatts_add_char(uint16_t service_handle, esp_bt_uuid_t *char_
|
||||
}
|
||||
memcpy(&arg.add_char.char_uuid, char_uuid, sizeof(esp_bt_uuid_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), btc_gatts_arg_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), btc_gatts_arg_deep_copy,
|
||||
btc_gatts_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
|
||||
@@ -196,7 +202,8 @@ esp_err_t esp_ble_gatts_add_char_descr (uint16_t service_handle,
|
||||
}
|
||||
memcpy(&arg.add_descr.descr_uuid, descr_uuid, sizeof(esp_bt_uuid_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), btc_gatts_arg_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), btc_gatts_arg_deep_copy,
|
||||
btc_gatts_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gatts_delete_service(uint16_t service_handle)
|
||||
@@ -211,7 +218,7 @@ esp_err_t esp_ble_gatts_delete_service(uint16_t service_handle)
|
||||
msg.act = BTC_GATTS_ACT_DELETE_SERVICE;
|
||||
arg.delete_srvc.service_handle = service_handle;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gatts_start_service(uint16_t service_handle)
|
||||
@@ -226,7 +233,7 @@ esp_err_t esp_ble_gatts_start_service(uint16_t service_handle)
|
||||
msg.act = BTC_GATTS_ACT_START_SERVICE;
|
||||
arg.start_srvc.service_handle = service_handle;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gatts_stop_service(uint16_t service_handle)
|
||||
@@ -241,7 +248,7 @@ esp_err_t esp_ble_gatts_stop_service(uint16_t service_handle)
|
||||
msg.act = BTC_GATTS_ACT_STOP_SERVICE;
|
||||
arg.stop_srvc.service_handle = service_handle;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
|
||||
@@ -275,8 +282,8 @@ esp_err_t esp_ble_gatts_send_indicate(esp_gatt_if_t gatts_if, uint16_t conn_id,
|
||||
if(need_confirm == false){
|
||||
l2ble_update_att_acl_pkt_num(L2CA_ADD_BTC_NUM, NULL);
|
||||
}
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t),
|
||||
btc_gatts_arg_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), btc_gatts_arg_deep_copy,
|
||||
btc_gatts_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gatts_send_response(esp_gatt_if_t gatts_if, uint16_t conn_id, uint32_t trans_id,
|
||||
@@ -301,8 +308,8 @@ esp_err_t esp_ble_gatts_send_response(esp_gatt_if_t gatts_if, uint16_t conn_id,
|
||||
arg.send_rsp.status = status;
|
||||
arg.send_rsp.rsp = rsp;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t),
|
||||
btc_gatts_arg_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), btc_gatts_arg_deep_copy,
|
||||
btc_gatts_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gatts_set_attr_value(uint16_t attr_handle, uint16_t length, const uint8_t *value)
|
||||
@@ -319,8 +326,8 @@ esp_err_t esp_ble_gatts_set_attr_value(uint16_t attr_handle, uint16_t length, co
|
||||
arg.set_attr_val.length = length;
|
||||
arg.set_attr_val.value = (uint8_t *)value;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t),
|
||||
btc_gatts_arg_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), btc_gatts_arg_deep_copy,
|
||||
btc_gatts_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_gatt_status_t esp_ble_gatts_get_attr_value(uint16_t attr_handle, uint16_t *length, const uint8_t **value)
|
||||
@@ -349,7 +356,7 @@ esp_err_t esp_ble_gatts_open(esp_gatt_if_t gatts_if, esp_bd_addr_t remote_bda, b
|
||||
arg.open.is_direct = is_direct;
|
||||
memcpy(&arg.open.remote_bda, remote_bda, sizeof(esp_bd_addr_t));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -365,7 +372,7 @@ esp_err_t esp_ble_gatts_close(esp_gatt_if_t gatts_if, uint16_t conn_id)
|
||||
msg.act = BTC_GATTS_ACT_CLOSE;
|
||||
arg.close.conn_id = BTC_GATT_CREATE_CONN_ID(gatts_if, conn_id);
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
@@ -387,7 +394,7 @@ esp_err_t esp_ble_gatts_send_service_change_indication(esp_gatt_if_t gatts_if, e
|
||||
}
|
||||
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL)
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user