Compare commits

...

582 Commits

Author SHA1 Message Date
Frank Mertens
3aa5c97ce7
Merge ba27281c3e into 46acfdce96 2024-09-23 08:57:30 +00:00
Rahul Tank
46acfdce96 Merge branch 'feat/send_data_len_afer_conn' into 'master'
Some checks failed
docker / docker (push) Has been cancelled
Vulnerability scan / Vulnerability scan (push) Has been cancelled
Sync remain PRs to Jira / Sync PRs to Jira (push) Has been cancelled
feat(nimble): Set data length after connection

See merge request espressif/esp-idf!32655
2024-09-21 21:24:54 +08:00
Jiang Jiang Jian
945af68d74 Merge branch 'feature/esp32c61_light_sleep_support_stage_3' into 'master'
feat(esp_hw_support): esp32c61 sleep support (Stage 3:  support system peripheral sleep retention)

Closes IDF-10384, IDF-10382, and IDF-11004

See merge request espressif/esp-idf!33298
2024-09-21 16:09:36 +08:00
Kapil Gupta
5d792910be Merge branch 'bugfix/wps_timer_causing_disconnect' into 'master'
fix(esp_wifi): Disable WPS timers once WPS succeed

Closes WIFIBUG-393

See merge request espressif/esp-idf!33240
2024-09-21 15:03:19 +08:00
David Čermák
82a29b7d21 Merge branch 'fix/lwip_drop_ipv6_if_no_ll' into 'master'
fix(lwip): Add default IPv6 input filter to drop traffic if ipv6 not assigned

Closes IDF-10472

See merge request espressif/esp-idf!32165
2024-09-20 23:33:49 +08:00
Kapil Gupta
0c9d7c9dd0 Merge branch 'bugfix/2g_5g_wnm_scan' into 'master'
fix(esp_wifi): Add changes to enable 5ghz scan

Closes WIFIBUG-773

See merge request espressif/esp-idf!33657
2024-09-20 22:20:26 +08:00
Kapil Gupta
3629909b11 fix(esp_wifi): Mask some error conditions in WPS
Mask some error conditions in WPS to increase the probability of
WPS success.
2024-09-20 22:08:01 +08:00
Kapil Gupta
3a35b26de1 fix(esp_wifi): Disable WPS timers once WPS succeed 2024-09-20 22:08:01 +08:00
Mahavir Jain
2a6be654cd Merge branch 'ci/enable_memprot_tests_for_esp32c61' into 'master'
Clear PMA entries before usage and enable tests for ESP32-C61

Closes IDF-10932

See merge request espressif/esp-idf!33438
2024-09-20 21:32:18 +08:00
Island
3000402fcf Merge branch 'bugfix/fix_ble_scan_assert_1728' into 'master'
fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(e9ae856)

Closes IDFCI-2222 and BLERP-1037

See merge request espressif/esp-idf!33643
2024-09-20 20:12:00 +08:00
Kapil Gupta
b0712b6a2b Merge branch 'bugfix/deinitialize_wps_registrar' into 'master'
fix(esp_wifi): Deinit WPS registrar during hostapd deinit

Closes WIFIBUG-786 and WIFIBUG-695

See merge request espressif/esp-idf!33658
2024-09-20 17:40:57 +08:00
Liu Xiao Yu
e051b921b8 Merge branch 'feat/lp_spinlock' into 'master'
feat(ulp): implement inter-hp-lp-cpu spinlock/critical section

Closes IDF-10206

See merge request espressif/esp-idf!32775
2024-09-20 17:09:50 +08:00
David Cermak
98fdb1a97f fix(lwip): Add default IPv6 input filter to drop traffic if ipv6 not assigned
* Makes LWIP_HOOK_IP6_INPUT default to LWIP_HOOK_IP6_INPUT_DEFAULT
* Updated the stub hook implementation to actually filter out all IPv6
packets if the input netif has no link local address.
2024-09-20 10:36:43 +02:00
Sudeep Mohanty
c01512f4b0 Merge branch 'fix/assert_fail_in_xtaskdeletewithcaps' into 'master'
Some checks failed
docker / docker (push) Has been cancelled
Fixed occational assert failure in vTaskDeleteWithCaps()

Closes IDFGH-13294

See merge request espressif/esp-idf!33468
2024-09-20 16:19:40 +08:00
Guillaume Souchere
19d512ebee Merge branch 'feat/heap-support-esp32c61' into 'master'
feat(heap): Add support for esp32c61

Closes IDF-9858 and IDF-10989

See merge request espressif/esp-idf!33556
2024-09-20 16:01:20 +08:00
Lou Tian Hao
9be8822b61 Merge branch 'feature/esp32c61_light_sleep_support_stage_deepsleep' into 'master'
feat(esp_hw_support): support esp32c61 deepsleep

Closes PM-203 and IDF-9245

See merge request espressif/esp-idf!33301
2024-09-20 15:30:30 +08:00
Kapil Gupta
1d7241acc1 fix(esp_wifi): Add changes to enable 5ghz scan 2024-09-20 12:58:14 +05:30
Kapil Gupta
903c11ff1a Merge branch 'bugfix/dpp_5ghz_chan_support' into 'master'
fix(esp_wifi): Add support for 5ghz channel list for easy connect

Closes WIFI-6420

See merge request espressif/esp-idf!32146
2024-09-20 14:46:05 +08:00
Kapil Gupta
e24005c8db fix(esp_wifi): Add support for 5ghz channel list for easy connect 2024-09-20 14:46:05 +08:00
Kapil Gupta
1ac6043bce Merge branch 'bugfix/wps_wpa_connection' into 'master'
fix(esp_wifi): Allow connection with WPA mode in WPS

See merge request espressif/esp-idf!32360
2024-09-20 14:16:26 +08:00
Kapil Gupta
52002bf92d fix(esp_wifi): Allow connection with WPA mode in WPS 2024-09-20 14:16:01 +08:00
Lou Tianhao
bc0404ae03 fix(ci): some actions taken to pass CI 2024-09-20 14:10:45 +08:00
Lou Tianhao
46350e362e fix(esp_hw_support): add clock retention contents for esp32c61 & esp32c5 2024-09-20 14:09:29 +08:00
Lou Tianhao
6be09eb5b8 change(pm): replace SOC_CLK_RC32K_NOT_TO_USE with CONFIG_ESP_CLK_RC32K_NOT_TO_USE 2024-09-20 14:07:18 +08:00
Li Shuai
3b6f8b1f3d fix(esp32c61): enable soc caps macro to fix regdma wait compare bug 2024-09-20 14:07:18 +08:00
Lou Tianhao
9529c4ece4 fix(esp_hw_support): fix mmu memory powered down issue by software backup and restore mmu table content
squash! fix(esp_hw_support): fix mmu memory powered down issue by software backup and restore mmu table content
2024-09-20 14:07:18 +08:00
Lou Tianhao
a30ed69f69 feat(pm): support top retention for esp32c61 2024-09-20 14:07:18 +08:00
Jaroslav Burian
180bc4bd8c Merge branch 'feat/enable_esp32c5_stub' into 'master'
feat: Enable ESP32-C5 stub

Closes IDF-8631

See merge request espressif/esp-idf!33115
2024-09-20 14:01:20 +08:00
Li Shuai
3edbd0741a Merge branch 'feat/esp32c5_wifi_sleep' into 'master'
esp32c5 wifi legacy sleep and modem state support

Closes WIFI-6424, WIFI-6425, PM-185, IDF-10597, and IDF-10601

See merge request espressif/esp-idf!33225
2024-09-20 13:53:07 +08:00
Mahavir Jain
a71e0fc028 Merge branch 'feature/enable_sha_support_for_esp32c61' into 'master'
feat: enable support for sha peripheral in esp32c61

Closes IDF-9234

See merge request espressif/esp-idf!32830
2024-09-20 13:22:14 +08:00
Mahavir Jain
f5b55b2967 Merge branch 'fix/ecdsa_verify_check_hash_len' into 'master'
Wrap some mbedtls' ECDSA verification related APIs

See merge request espressif/esp-idf!33349
2024-09-20 12:38:10 +08:00
Marius Vikhammer
564d777018 Merge branch 'feature/lp_core_40_mhz' into 'master'
feat(system): support choosing xtal as rtc-fast clock src on P4 and C5

Closes IDF-10203

See merge request espressif/esp-idf!32450
2024-09-20 10:57:15 +08:00
Lou Tianhao
d9c15bb772 fix(ci): some actions taken to pass CI 2024-09-20 10:53:05 +08:00
Lou Tianhao
d70f24e414 feat(pm): support example deepsleep for esp32c61 2024-09-20 10:53:05 +08:00
Shen Wei Long
8320e4281b Merge branch 'bugfix/fixed_ble_get_started_issue_for_esp32c5' into 'master'
fix(ble): correct gpio pin in examples/bluetooth/ble_get_started for ESP32-C5

See merge request espressif/esp-idf!33654
2024-09-20 10:44:18 +08:00
Island
db8ffcacf4 Merge branch 'bugfix/fixed_c5_ble_cache_error_240919' into 'master'
Bugfix/fixed c5 ble cache error 240919

Closes BLERP-1038, BLERP-1039, BLERP-1040, BLERP-1041, BLERP-1042, BLERP-1043, BLERP-1044, BLERP-1045, BLERP-1046, BLERP-1047, BLERP-1048, BLERP-1049, and BLERP-1036

See merge request espressif/esp-idf!33645
2024-09-20 10:37:36 +08:00
Island
ae67021e1e Merge branch 'feat/ble_mesh_lib_flash_size_optimized' into 'master'
feat(ble_mesh): ble mesh lib flash size optimized

Closes BLERP-1012

See merge request espressif/esp-idf!33476
2024-09-20 10:34:30 +08:00
Xiaoyu Liu
446528d40f feat(ulp): implement ulp lp core spinlock 2024-09-20 10:22:45 +08:00
morris
c44e7dcb14 Merge branch 'feat/adapt_spi_lcd_to_lvgl_v9' into 'master'
feat(spi_lcd): adapt spi_lcd example to LVGL v9

Closes IDF-10953 and IDFGH-13741

See merge request espressif/esp-idf!33620
2024-09-20 10:11:43 +08:00
Kapil Gupta
28f12bfb47 fix(esp_wifi): Deinit WPS registrar during hostapd deinit 2024-09-19 23:10:08 +05:30
Rahul Tank
675fac1a6c feat(nimble): Set data length after connection 2024-09-19 20:20:47 +05:30
Li Shuai
072ea6bb44 fix(ci): some modify for ci pass 2024-09-19 20:04:44 +08:00
Li Shuai
9588953e07 change(esp_phy): some fix for phy sleep 2024-09-19 20:04:44 +08:00
Li Shuai
d57ee7d87e refactor(esp_hw_support): seperate sleep modem state support for each target 2024-09-19 20:04:44 +08:00
Li Shuai
dad039e27f change(esp_hw_support): support wifi modem state for esp32c5 2024-09-19 20:04:44 +08:00
Li Shuai
eeb55c3f04 change(example/power_save): modify to support dfs min frequency select to 48 MHz xtal 2024-09-19 20:04:44 +08:00
Lou Tianhao
1604cef916 chanage(example/power_save): add wifi band (2.4 GHz and 5 GHz) menuconfig option for esp32c5 2024-09-19 20:04:44 +08:00
Li Shuai
d63beec095 change(esp_wifi): support legacy wifi power save for esp32c5 2024-09-19 20:04:41 +08:00
Shen Weilong
a30edf60eb fix(ble): correct gpio pin in examples/bluetooth/ble_get_started for ESP32-C5 2024-09-19 20:04:02 +08:00
Sudeep Mohanty
13d4235d73 Merge branch 'fix/lp_uart_garbled_print' into 'master'
fix(lp_uart): Added lp_uart_tx_flush API

Closes IDFGH-13650

See merge request espressif/esp-idf!33487
2024-09-19 19:54:36 +08:00
Yin Qing Zhao
ca331a2521 Merge branch 'feature/add_channel_bit_definition' into 'master'
feat(wifi):wifi add channel bit definition

Closes FCW-280 and FCW-281

See merge request espressif/esp-idf!32916
2024-09-19 19:51:06 +08:00
Peter Marcisovsky
c2366d5df6 Merge branch 'fix/usb_device_msc_example_fix_console' into 'master'
fix(usb_device): Fix console selection in MSC Device example

Closes IDF-11136

See merge request espressif/esp-idf!33517
2024-09-19 19:29:33 +08:00
Peter Marcisovsky
67c5d37e75 Merge branch 'feat/usb_host_create_usb_cmock' into 'master'
feat(usb_host): Create USB Host mock for CMock host tests

Closes IDF-11234

See merge request espressif/esp-idf!33619
2024-09-19 19:26:03 +08:00
Peter Marcisovsky
70ff700f56 Merge branch 'ci/usb_device_enable_p4_tests' into 'master'
ci(usb_device): Enable USB device tests in CI for esp32p4

See merge request espressif/esp-idf!33287
2024-09-19 19:17:40 +08:00
Guillaume Souchere
80eee8214e Merge branch 'feat/support-ringbuffer-esp32c61' into 'master'
feat(ringbuffer): Enable tests for esp32c61

Closes IDF-9266

See merge request espressif/esp-idf!33551
2024-09-19 17:56:00 +08:00
Guillaume Souchere
8ff8b520f3 Merge branch 'feat/update-to-latest-tlsf' into 'master'
feat(heap): Update component to latest TLSF

See merge request espressif/esp-idf!33193
2024-09-19 17:55:38 +08:00
Roland Dobai
fe29994924 Merge branch 'fix/specify_shell_in_exports' into 'master'
fix: explicitly set shell type in export.sh for bash and zsh

Closes IDF-11137, IDF-11138, and IDFGH-13713

See merge request espressif/esp-idf!33558
2024-09-19 17:47:01 +08:00
Sachin Billore
c843c2c4fe Merge branch 'feat/apm_api_esp32c61' into 'master'
feat(APM): Add APM APIs for ESP32-C61

See merge request espressif/esp-idf!33567
2024-09-19 17:46:40 +08:00
Marius Vikhammer
00eb97725b feat(system): support choosing xtal as rtc-fast clock src on P4 and C5
With xtal as rtc-fast clock source the LP-Core can run at twice the default
clock frequency. 40 MHz as opposed to 20 MHz.
2024-09-19 17:30:44 +08:00
Sudeep Mohanty
9b3eda0974 Merge branch 'fix/ringbuf_receives_item_not_yet_sent' into 'master'
Some checks failed
docker / docker (push) Has been cancelled
fix(esp_ringbuf): Fixed a bug where in a no-split buffer received items prematurely

Closes IDFGH-13694

See merge request espressif/esp-idf!33555
2024-09-19 17:07:20 +08:00
Jiang Jiang Jian
6b9242b5c7 Merge branch 'bugfix/fix_some_issues_of_cert_test' into 'master'
fix(phy): update cert_test docs

See merge request espressif/esp-idf!33635
2024-09-19 16:45:38 +08:00
Sudeep Mohanty
86c1ad216c Merge branch 'task/enable_freertos_tests_for_h2' into 'master'
test(freertos): Enabled FreeRTOS unit tests for esp32h2

See merge request espressif/esp-idf!33571
2024-09-19 16:42:22 +08:00
zwl
3c72084932 feat(ble): update bt cmakelists file for ESP32-C61 2024-09-19 16:06:46 +08:00
Guillaume Souchere
f0903aef6b feat(heap): Add test support for esp32c61 2024-09-19 09:53:45 +02:00
zwl
8e4cc79a27 fix(ble): unified ble memory allocation method 2024-09-19 15:49:23 +08:00
Sudeep Mohanty
3c65f1b654 fix(lp_uart): Added lp_uart flush feature
This commit adds the lp_core_uart_flush() API to flush the LP UART Tx
FIFO. This API is automatically called once the program returns from the
main function().

Closes https://github.com/espressif/esp-idf/issues/14530
2024-09-19 09:36:04 +02:00
zhanghaipeng
32c7694f56 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(e9ae856)
- Fixed BLE scan assert in lld_scan.c 1728
2024-09-19 15:22:04 +08:00
Wan Lei
115dec68ae Merge branch 'fix/p4_twai_enable_test' into 'master'
test(twai): p4 twai enable ci test

Closes IDF-8966

See merge request espressif/esp-idf!33428
2024-09-19 15:17:28 +08:00
muhaidong
da4a0798f4 fix(phy): update cert_test docs 2024-09-19 15:13:15 +08:00
Marius Vikhammer
4c7d9f9859 Merge branch 'contrib/github_pr_14384' into 'master'
fix(pthread): Add esp_pthread function implementations for linux target (GitHub PR)

Closes IDFGH-13485

See merge request espressif/esp-idf!33278
2024-09-19 14:42:59 +08:00
Island
c62555d132 Merge branch 'bugfix/fixed_c6_crash_c2_crash_issue' into 'master'
Bugfix/fixed c6 crash c2 crash issue

Closes BLERP-1024, BLERP-1009, BLERP-1010, IDFCI-2365, and IDFCI-2338

See merge request espressif/esp-idf!33575
2024-09-19 14:34:04 +08:00
Chen Jichang
5bef0f5664 docs(spi_lcd): update supported spi mode description
Closes https://github.com/espressif/esp-idf/issues/14605
2024-09-19 14:29:41 +08:00
Chen Jichang
7e2a7bd5b2 feat(spi_lcd): adapt spi_lcd example to LVGL v9 2024-09-19 14:29:41 +08:00
Armando (Dou Yiwen)
bff2f9b2dd Merge branch 'change/camera_example_readme_change' into 'master'
example(camera): update some info about camera related examples

See merge request espressif/esp-idf!33637
2024-09-19 14:15:42 +08:00
Armando
79da963c62 example(camera): update some info about camera related examples 2024-09-19 14:09:23 +08:00
Rahul Tank
2a12872d0a Merge branch 'fix/added_a_change_to_print_address_of_advertising_instance' into 'master'
fix(nimble): Added a change to print address of an advertising instance

Closes BLERP-1033

See merge request espressif/esp-idf!33550
2024-09-19 14:08:47 +08:00
Sachin Billore
b4749b88d9 feat(APM): Add APM APIs for ESP32-C61 2024-09-19 11:07:42 +05:30
luoxu
fde00f570a feat(ble_mesh): ble mesh lib flash size optimized 2024-09-19 12:14:32 +08:00
Jiang Jiang Jian
b01fd6b026 Merge branch 'feat/bringup_esp32c2_rom_mbedtls_to_formal_feature' into 'master'
feat(mbedtls): bringup esp32c2 rom mbedtls feature to formal

See merge request espressif/esp-idf!33434
2024-09-19 11:18:27 +08:00
Michael (XIAO Xufeng)
534c3288ae Merge branch 'docs/update_examples_in_sdio_slave' into 'master'
docs: Update the application examples in sdio_slave

Closes DOC-8319

See merge request espressif/esp-idf!31994
2024-09-19 11:14:49 +08:00
Armando (Dou Yiwen)
cba8c5d7ca Merge branch 'feat/supported_camera_sc2336_lcd_ek79007' into 'master'
camera: supported camera related example using sc2336 and ek79007

Closes IDFGH-13634

See merge request espressif/esp-idf!33518
2024-09-19 11:10:57 +08:00
Armando
b3ccc09ec3 feat(camera): supported camera related example using sc2336 and ek79007
Closes https://github.com/espressif/esp-idf/issues/14517
2024-09-19 10:47:56 +08:00
Alexey Gerenkov
81f4ef73c3 Merge branch 'feature/update-esp-clang-to-esp-18.1.2_20240815' into 'master'
Some checks are pending
docker / docker (push) Waiting to run
feat(tools): update esp-clang version to esp-18.1.2_20240912

Closes LLVM-333

See merge request espressif/esp-idf!32895
2024-09-19 03:49:46 +08:00
Alexey Gerenkov
391dd7b9ad fix(build): Fix declaration of linker labels for ROM reserved regions
It looks like as a part of optimization for inlined functions like 'mmu_ll_vaddr_to_laddr' Clang aligns constant value
used for bitwise AND operation with the pointer to external symbol passed to the function as parameter.
That led to assertion failures because boundaries can be unaligned to 4 bytes.
2024-09-18 21:40:39 +03:00
Alexey Gerenkov
b8d23b334b change(build): Enable 'xesppie' for esp32p4 Clang builds 2024-09-18 21:40:39 +03:00
Alexey Gerenkov
9ca231e76e change(build): Use integrated assembler with Clang for RISCV chips 2024-09-18 21:40:39 +03:00
Alexey Gerenkov
64203d1403 feat(tools): update esp-clang version to esp-18.1.2_20240912 2024-09-18 21:40:34 +03:00
Konstantin Kondrashov
dcd433e62c Merge branch 'bugfix/werror_hint' into 'master'
fix(tools): Fix a regular expression in hints.yml for Werror=

See merge request espressif/esp-idf!33625
2024-09-19 01:30:27 +08:00
Michael (XIAO Xufeng)
ed92c2c226 Merge branch 'test/add_cache2phys_xip_tests' into 'master'
fix(mmap): fixed spi_flash_phys2cache return addr in PSRAM issue

See merge request espressif/esp-idf!31083
2024-09-18 23:53:47 +08:00
Konstantin Kondrashov
d1a00f5808 fix(tools): Fix a regular expression in hints.yml for Werror= 2024-09-18 16:33:47 +03:00
Peter Marcisovsky
d071bb4c56 feat(usb_host): Create USB Host mock for CMock host tests 2024-09-18 15:04:03 +02:00
wanckl
bf9d01bf2a test(twai): p4 twai enable ci test 2024-09-18 20:56:55 +08:00
David Čermák
22facff58c Merge branch 'fix/ws_transport_linux_signed_promotions' into 'master'
fix(ws_transport): Fix incorrect packet-len on linux due to int promotions of char (GitHub PR)

Closes IDFGH-13642 and IDFGH-13657

See merge request espressif/esp-idf!33595
2024-09-18 20:56:51 +08:00
Lou Tian Hao
3415ff27d6 Merge branch 'fix/regdma_wait_node_issue' into 'master'
fix(pm): fix the issue of regdma wait node to immediately return to done caused by regdma wait mode comparator for esp32c6, esp32h2 and esp32p4

Closes PM-202

See merge request espressif/esp-idf!33547
2024-09-18 20:52:59 +08:00
yinqingzhao
97e42349aa feat(wifi):wifi add channel bit definition 2024-09-18 20:19:39 +08:00
Erhan Kurubas
2dbb811747 Merge branch 'fix/apptrace_print_lock' into 'master'
fix(apptrace): fix build error when print lock is enabled

See merge request espressif/esp-idf!33368
2024-09-18 19:50:21 +08:00
Sudeep Mohanty
6a82497bdc fix(esp_ringbuf): Fixed a bug where in a no-split buffer received items prematurely
This commit fixes a bug in the no-split buffer which could receive an
item prematurely if the space on the buffer is acquired until the buffer
is full. The commit also adds a unit test for this scenario.

Closes https://github.com/espressif/esp-idf/issues/14568
2024-09-18 13:39:52 +02:00
Alexey Gerenkov
5c43055e3e Merge branch 'esp32c61_jtag_doc_update' into 'master'
docs(jtag): update esp32c61 jtag debugging guide

Closes IDF-10168

See merge request espressif/esp-idf!33546
2024-09-18 19:36:23 +08:00
Frantisek Hrbata
6f3241a34b fix(tools): Upgrade shell detection & simplify autocompletion
Explicitly set shell type in export.sh for bash and zsh

-Most of the issues reported with the updated export scripts are related
 to shell detection. Since we already know the shell type for commonly
 used ones like bash or zsh, we can pass the shell type directly to the
 activate script. This should hopefully resolve the shell detection
 problems for most users.

 This update also modifies the shell type detection to rely solely on
 psutil.Process().cmdline() rather than psutil.Process().exe(). This
 change aims to resolve permission issues that may occur if, for example,
 the Python binary has certain capabilities assigned.

Move shell completion to the init script

- Currently we are expanding the autocompletion in the activate script and
 adding the expanded commands into the init script. To avoid
 concerns about shell versions, move the entire expansion to the init
 script.
2024-09-18 13:03:26 +02:00
Frantisek Hrbata
2109f81102 fix(tools): do not include rc scripts in export script
The rc scripts should be included only when a new shell is started. At
present, for bash and zsh, we are also including them in the export
scripts, which is incorrect and may cause recursion.

Closes https://github.com/espressif/esp-idf/issues/14584

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-09-18 13:03:26 +02:00
Sudeep Mohanty
01f521f3a0 test(freertos): Enabled FreeRTOS unit tests for esp32h2 2024-09-18 12:51:24 +02:00
Roland Dobai
eb606b9777 Merge branch 'feat/add_constraint_files' into 'master'
add a note regarding separate constraint files

Closes IDF-10232

See merge request espressif/esp-idf!33230
2024-09-18 18:48:06 +08:00
Sudeep Mohanty
eb676c0afc Merge branch 'task/enable_freertos_tests_for_c61' into 'master'
test(freertos): Enabled FreeRTOS unit tests for esp32c61

Closes IDF-10988

See merge request espressif/esp-idf!33568
2024-09-18 18:40:29 +08:00
Ren Peiying
91ad4bcbce Merge branch 'add_application_examples_peripherals' into 'master'
Add application examples for i2c, jpeg, temp_sensor and usb_serial-jtag-console

See merge request espressif/esp-idf!33274
2024-09-18 17:31:59 +08:00
Ren Peiying
fb1b91c8d7 Add application examples for i2c, jpeg, temp_sensor and usb_serial-jtag-console 2024-09-18 17:31:59 +08:00
Sudeep Mohanty
c36674eaa8 fix(freertos): Fixed assert failure in vTaskDeleteWithCaps
This commit fixes an assert failure in vTaskDeleteWithCaps() when
multiple un-pinned tasks are created with stack in the external memory
and such tasks delete themselves.

Closes https://github.com/espressif/esp-idf/issues/14222
2024-09-18 11:11:04 +02:00
Frantisek Hrbata
7a03ac385d change: add a note regarding separate constraint files
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-09-18 16:56:04 +08:00
Sudeep Mohanty
02cd0253a1 test(freertos): Added a test for vTaskDeleteWithCaps when stack is in ext RAM
This commit adds a stress tests for creating multiple tasks with
xTaskCreateWithCaps such that the stack is allocated in external SPIRAM.
Then the tasks self-delete. This is done iteratively as stress test.
2024-09-18 10:39:24 +02:00
Jiang Jiang Jian
f8894140ee Merge branch 'bugfix/11kv_prints' into 'master'
fix(esp_wifi): Added prints in btm roam for error condition

See merge request espressif/esp-idf!32658
2024-09-18 16:19:45 +08:00
Erhan Kurubas
6ade64eb05 docs(jtag): update esp32c61 jtag debugging guide 2024-09-18 10:44:41 +03:00
zwl
4d2c44f511 fix(ble): fixed memory leak issue when using uart hci 2024-09-18 15:39:26 +08:00
zwl
0ef9ecb715 fix(ble): fixed occasional assertion issue when enabling logging on ESP32-C2 2024-09-18 15:39:26 +08:00
zwl
c929a01931 fix(ble): fixed occasional acl data packet loss issue when using UHCI on ESP32-H2 2024-09-18 15:39:26 +08:00
zwl
afe08638a0 fix(ble): fixed occasional crash issue in multi-connect scenarios on ESP32-C6 2024-09-18 15:39:26 +08:00
Sudeep Mohanty
453850eff2 Merge branch 'contrib/github_pr_14593' into 'master'
feat(advanced_console): Add ESP32-P4 ESP32-C5 model support in 'version' command output (GitHub PR)

Closes IDFGH-13722

See merge request espressif/esp-idf!33565
2024-09-18 15:37:33 +08:00
Shu Chen
28a92e56db Merge branch 'feature/add_ot_nat64_curl_ci_case' into 'master'
feat(openthread): add thread curl https ci case

See merge request espressif/esp-idf!33486
2024-09-18 15:36:25 +08:00
Kapil Gupta
27cf5267a1 fix(esp_wifi): Added prints in btm roam for error condition 2024-09-18 14:44:24 +08:00
Guillaume Souchere
a1b8fc9635 feat(ringbuffer): Enable tests for esp32c61
Add ring buffer support for esp32c61
2024-09-18 08:39:17 +02:00
Zhang Shu Xian
6a0ec48b11 Merge branch 'docs/fix_wrong_statement' into 'master'
docs: Fix wrong statement about set/get gptimer raw count

Closes DOC-8882

See merge request espressif/esp-idf!33574
2024-09-18 14:28:32 +08:00
yiwenxiu
26be72307b feat(openthread): add thread curl https ci case 2024-09-18 14:04:08 +08:00
harshal.patil
7667d9ebbe
fix(cpu_region_protect): Reset PMA entries before using them
- ROM uses some PMA entries so we clear such PMA entries before using them in ESP-IDF
2024-09-18 10:25:18 +05:30
harshal.patil
fcd751e79c
ci(memprot): enable memory protection tests for ESP32-C61 2024-09-18 10:25:18 +05:30
Ren Peiying
84791fce2f Merge branch 'docs/add_app_examples_for_spi_master_twai_etc' into 'master'
docs: Update application examples for spi master, twai, and spi_slave

See merge request espressif/esp-idf!33276
2024-09-18 12:01:16 +08:00
Ren Peiying
a360c737ea Merge branch 'docs/update_app_examples_to_usb_host_device' into 'master'
docs: Add or update application examples for usb_host and usb_device

See merge request espressif/esp-idf!33275
2024-09-18 11:59:36 +08:00
Zhang Xiao Yan
40892b67c5 Merge branch 'docs/update_description_improve_io_performance' into 'master'
docs: update descriptions about improve I/O performance

See merge request espressif/esp-idf!33367
2024-09-18 11:48:05 +08:00
Wang Meng Yang
4b74e4e595 Merge branch 'bugfix/fix_sdp_compatibility' into 'master'
Bugfix/fix sdp compatibility

See merge request espressif/esp-idf!33442
2024-09-18 11:31:27 +08:00
Island
030470efa6 Merge branch 'ble_dev/esp32c61_chip_20240903' into 'master'
feat(ble): added ble support on esp32c61

Closes IDF-10360, IDF-10362, IDF-10363, and IDF-10365

See merge request espressif/esp-idf!33286
2024-09-18 11:17:58 +08:00
Island
1a065dc37a Merge branch 'feat/support_blecrt_242' into 'master'
fix(bt/bluedroid): Fixed access fault when reading BLE controller information fails

Closes BLERP-1019 and BLERP-1020

See merge request espressif/esp-idf!33406
2024-09-18 10:56:47 +08:00
Island
5f865a81b9 Merge branch 'refactor/ble_example_print_on_bluedroid' into 'master'
refactor(bt/bluedroid): Refactor the print for BLE examples

Closes BLERP-904, BLERP-910, BLERP-1026, and BLERP-1031

See merge request espressif/esp-idf!33296
2024-09-18 10:56:42 +08:00
Island
cb2624fb3f Merge branch 'bugfix/fix_ble_max_tx_power_on_esp32c3' into 'master'
fix(bt/controller): Change the max TX power to +20dBm on ESP32-C3 and ESP32-S3

Closes BLERP-1022

See merge request espressif/esp-idf!33264
2024-09-18 10:56:37 +08:00
Linda
ef1bffa937 docs: update descriptions about improve I/O performance 2024-09-18 10:53:42 +08:00
Zhang Shuxian
0244f7a9b5 docs: Fix wrong statement about set/get gptimer raw count 2024-09-18 10:14:55 +08:00
Sudeep Mohanty
812fbb7874 test(freertos): Enabled FreeRTOS unit tests for esp32c61 2024-09-17 14:17:01 +02:00
Sudeep Mohanty
328de495de fix(console): Fixed a typing error in the console advanced example 2024-09-17 09:16:06 +02:00
rudi ;-)
4281f58229 feat(advanced_console): Add support for ESP32-P4 and ESP32-C5 models in 'version' command output
The model ESP32P4 and ESP32C5 was unknown on version command in iperf example

add model ESP32P4 and ESP32C5
which prints out model names now by the knowed model
ESP32P4 = "ESP32-P4"
ESP32C5 = "ESP32-C5"

example app: iperf

before:
iperf> version
IDF Version:v5.4-dev-2744-g59e1838270-dirty
Chip info:
        model:Unknown
        cores:1
        feature:/802.11bgn/BLE/External-Flash:8 MB
        revision number:0
iperf>

after this add model is knowed now

iperf> version
IDF Version:v5.4-dev-2744-g59e1838270-dirty
Chip info:
        model:ESP32-C5
        cores:1
        feature:/802.11bgn/BLE/External-Flash:8 MB
        revision number:0
iperf>

Merges https://github.com/espressif/esp-idf/pull/14593
2024-09-17 09:04:52 +02:00
Aditya Patwardhan
fe47676a8b Merge branch 'feature/add_api_to_get_last_status_code_logged_during_ota' into 'master'
feat(esp_https_ota): added API to get last status code logged from http resonse

Closes IDFGH-13394

See merge request espressif/esp-idf!33356
2024-09-17 12:27:22 +08:00
Aditya Patwardhan
794c60411b Merge branch 'feat/update_random_number_docs_for_esp32c61' into 'master'
docs(systems): Updated the random number generator docs for esp32c61

Closes IDF-10153

See merge request espressif/esp-idf!33405
2024-09-17 11:58:03 +08:00
Rahul Tank
f68d16e7ad Merge branch 'bugfix/nimble_coverity_fixes' into 'master'
fix(nimble): Fix for coverity issues

Closes IDF-9419 and IDF-9425

See merge request espressif/esp-idf!33432
2024-09-16 22:26:42 +08:00
Guillaume Souchere
200241b9aa feat(heap): Add support for esp32c61 2024-09-16 14:44:57 +02:00
Jaroslav Burian
82c8973add feat: Enable ESP32-C5 stub 2024-09-16 20:27:25 +08:00
Roland Dobai
75fec0bdff Merge branch 'feat/move_sample_project' into 'master'
feat(tools): Move sample_project from examples to tools

Closes IDF-9812

See merge request espressif/esp-idf!33515
2024-09-16 20:00:07 +08:00
Tomas Borcin
4e4fb3a57b Merge branch 'docs/roadmap' into 'master'
docs: Adding ESP-IDF Project Roadmap

Closes RDT-668

See merge request espressif/esp-idf!31339
2024-09-16 19:02:31 +08:00
Rahul Tank
2113e99aeb fix(nimble): Fix for coverity issues 2024-09-16 14:24:32 +05:30
Rahul Tank
cfb78587f3 Merge branch 'bugfix/add_dummy_cb_during_deinit' into 'master'
fix(nimble): De-register host cb in stack deinit

See merge request espressif/esp-idf!33251
2024-09-16 16:40:19 +08:00
shreeyash
9725f3af74 fix(nimble): Added a change to print address of an advertising instance 2024-09-16 14:00:21 +05:30
Marek Fiala
6ec1e9107f feat(tools): Move sample_project from examples to tools
Extended example readme.md by further development options.
2024-09-16 09:12:50 +02:00
Guillaume Souchere
ccd8486462 feat(heap): Update component to latest TLSF
The new TLSF architecture has changed. tlsf.h public API
header is now moved into an include folder. tlsf_common.h
is removed from the repo.

This commit updates the heap component and respective
esp_rom patches to take into account this new
architecture.
2024-09-16 09:02:44 +02:00
Rahul Tank
2512588884 fix(nimble): De-register host cb in stack deinit 2024-09-16 10:35:47 +05:30
Jiang Jiang Jian
5a5c004691 Merge branch 'feature/optimize_coex_connectionless_pwr' into 'master'
feat(coex): optimize connectionless coexist pwr, optimize wifi pwr with BLE IDLE

Closes WIFI-6693 and WIFI-6645

See merge request espressif/esp-idf!33437
2024-09-15 23:41:21 +08:00
Jakob Hasse
f9e7305efd fix(pthread): configuration functions check for null pointer 2024-09-14 16:42:47 +02:00
Jakob Hasse
7834519af8 refactor(pthread): added esp_pthread unit tests for linux target 2024-09-14 16:42:41 +02:00
Jakob Hasse
0b70e296a0 refactor(pthread): avoid conflict due to two PTHREAD_STACK_MIN declarations 2024-09-14 16:34:20 +02:00
liuning
83809910d2 feat(coex): optimize connectionless coexist pwr, optimize wifi pwr with bt idle 2024-09-14 19:28:09 +08:00
Lou Tianhao
dd3d5f1598 fix(ci): :fix the issue of regdma wait node to immediately return to done caused by regdma wait mode comparator for esp32c6 & esp32h2 &esp32p4 2024-09-14 19:21:51 +08:00
Shen Meng Jing
3c99557eee Merge branch 'docs/update_cn_translation' into 'master'
Some checks failed
docker / docker (push) Has been cancelled
docs: Update CN translation for several docs

Closes DOC-8745 and DOC-8735

See merge request espressif/esp-idf!33071
2024-09-14 19:03:31 +08:00
Jiang Jiang Jian
db50b1ac63 Merge branch 'bugfix/support_cert_test' into 'master'
All chip support cert_test

Closes WIFI-5432, IDFGH-12197, and IDFHG-10756

See merge request espressif/esp-idf!27977
2024-09-14 16:44:21 +08:00
Konstantin Kondrashov
efdc853b45 Merge branch 'feature/esp32c61_esp_timer_systimer' into 'master'
feat(esp_timer): Updates systimer and esp_timer for ESP32-C61

Closes IDF-9284, IDF-10955, IDF-9307, and IDF-9308

See merge request espressif/esp-idf!33439
2024-09-14 16:08:40 +08:00
Armando (Dou Yiwen)
f4dd74ed96 Merge branch 'change/improve_xip_docs' into 'master'
psram: improve xip docs

See merge request espressif/esp-idf!33482
2024-09-14 15:59:03 +08:00
morris
46cccdea5f Merge branch 'change/mipi_dsi_remove_unused_ll' into 'master'
refactor(mipi_dsi): remove unused LL functions

See merge request espressif/esp-idf!33489
2024-09-14 15:52:37 +08:00
Konstantin Kondrashov
1489514ee5 Merge branch 'contrib/github_pr_14469' into 'master'
fix(spinlock): comparison of integer expressions of different signedness (GitHub PR)

Closes IDFGH-13581

See merge request espressif/esp-idf!33272
2024-09-14 15:34:41 +08:00
Kevin (Lao Kaiyao)
c45e084145 Merge branch 'bugfix/check_sdm_clock_range' into 'master'
refactor(sdm): add check and error info to the clock division

See merge request espressif/esp-idf!33394
2024-09-14 15:07:38 +08:00
Jiang Jiang Jian
b435473323 Merge branch 'ci/wifi_power_save_got_ip_time' into 'master'
ci: increase test_wifi_power_save got ip timeout

Closes IDFCI-2379, IDFCI-2122, and IDFCI-2132

See merge request espressif/esp-idf!33538
2024-09-14 14:52:31 +08:00
liqigan
205e66c9fd fix(bt/bluedroid): Fixed not deep copy service_name and user1_ptr in RAW SDP search event 2024-09-14 14:37:50 +08:00
liqigan
1cfb537813 fix(bt/bluedroid): Fixed the SDP API compatibility bug 2024-09-14 14:37:50 +08:00
Wang Meng Yang
cda2846558 Merge branch 'feature/support_bt_avrcp_cover_art' into 'master'
feat(bt/bluedroid): Support BT AVRCP Cover Art

Closes BT-3231

See merge request espressif/esp-idf!32538
2024-09-14 14:37:19 +08:00
Konstantin Kondrashov
48b1cd53d9 Merge branch 'bugfix/check_bootloader_size_with_sign' into 'master'
fix(esptool_py): Check the size of the bootloader + signature block

Closes IDFCI-1686

See merge request espressif/esp-idf!33417
2024-09-14 14:35:21 +08:00
Shen Weilong
bf52e37fa8 feat(ble): added ble support on esp32c61 2024-09-14 12:22:04 +08:00
Chen Yudong
353c1ea77e ci: increase test_wifi_power_save got ip timeout 2024-09-14 11:26:54 +08:00
Armando
6c4fb48783 doc(psram): clarify why psram speed is faster than flash 2024-09-14 11:13:20 +08:00
Armando
256ef127dd fix(linker): fixed extern linker symbol type from int to char 2024-09-14 11:11:55 +08:00
Mu Hai Dong
dacc1f94dd Apply 1 suggestion(s) to 1 file(s)
Co-authored-by: Jiang Jiang Jian <jack@espressif.com>
2024-09-14 10:37:30 +08:00
muhaidong
30a48b126e fix(phy): esp32s2 and esph2 support rf cert_test 2024-09-14 10:37:14 +08:00
muhaidong
aa80dbe251 fix(phy): fix esp32 build fail issue
Closes https://github.com/espressif/esp-idf/issues/11972
2024-09-14 10:33:58 +08:00
xiehang
c53cedb947 fix(phy): All chip support cert_test 2024-09-14 10:33:58 +08:00
Xiao Xufeng
436bcd6c06 ci(app_update): move test_apps to subfolder with a name 2024-09-14 10:19:30 +08:00
Xiao Xufeng
cdb9f2b098 ci(spi_flash): add tests for cache2phys with XIP 2024-09-14 10:19:30 +08:00
Xiao Xufeng
8bf68ff07b fix(mmap): fixed spi_flash_phys2cache return addr in PSRAM issue
When SPIRAM_FETCH_INSTRUCTIONS or SPIRAM_RODATA enabled
2024-09-14 10:19:30 +08:00
Michael (XIAO Xufeng)
28340977bd Merge branch 'doc/spi_flash_hpm_dc_aware_version' into 'master'
doc(spi_flash): add version number for bootloader version using explicit DC_AWARE

See merge request espressif/esp-idf!33470
2024-09-14 10:19:07 +08:00
Armando (Dou Yiwen)
c7415fc78d Merge branch 'fix/fix_csi_bridge_clock_enable_issue' into 'master'
csi: bridge clock enable shared control issue

See merge request espressif/esp-idf!33498
2024-09-14 10:01:27 +08:00
Gao Xu
e5fcc53755 Merge branch 'fix/fix_isp_color_contrast_max_value' into 'master'
Fix/fix isp color contrast max value

See merge request espressif/esp-idf!33507
2024-09-14 09:20:32 +08:00
Kevin (Lao Kaiyao)
bd38d80ff0 Merge branch 'bugfix/reserve_mspi_pin_regarding_line_mode' into 'master'
fix(gpio_reserve): reserve the mspi pin regarding line mode

See merge request espressif/esp-idf!33488
2024-09-13 22:22:28 +08:00
Jiang Jiang Jian
f98e288e24 Merge branch 'ci/enable_esp32c5_target_test' into 'master'
Ci: enable esp32c5/c61 basic wifi test

See merge request espressif/esp-idf!32253
2024-09-13 20:17:58 +08:00
Island
5f6971bfa7 Merge branch 'bugfix/fixed_multi_conn_example_crash_issue' into 'master'
fix(nimble): fiexed the crash issue of examples/bluetooth/nimble/ble_multi_conn

See merge request espressif/esp-idf!33491
2024-09-13 19:17:58 +08:00
Jiang Jiang Jian
16461de2b2 Merge branch 'bugfix/fixed_rx_bar_from_null_bss_issue' into 'master'
fix(wifi): fixed softap rx bar from null bss issue

Closes WIFI-6541, FCS-1423, FCS-1424, and IDFGH-13416

See merge request espressif/esp-idf!30680
2024-09-13 19:05:17 +08:00
linruihao
eb2307af36 fix(bt/bluedroid): Fixed some bugs in AVRCP 2024-09-13 17:58:49 +08:00
linruihao
147a249d7a feat(bt/bluedroid): Support AVRCP Cover Art feature in a2dp_sink demo 2024-09-13 17:58:49 +08:00
linruihao
0de83be0fe feat(bt/bluedroid): Add Kconfig options to controll AVRCP Cover Art feature 2024-09-13 17:58:49 +08:00
linruihao
cb0d073551 feat(bt/bluedroid): Support AVRCP Cover Art feature 2024-09-13 17:58:49 +08:00
linruihao
d7298a71c3 feat(bt/bluedroid): Support GOEP Client basic feature 2024-09-13 17:58:49 +08:00
linruihao
da858edb7a feat(bt/bluedroid): Support OBEX over L2CAP 2024-09-13 17:58:49 +08:00
Radek Tandler
928addee19 Merge branch 'feature/storage_nvs_doc_update' into 'master'
docs: Improved API Guides - File system considerations for NVS

See merge request espressif/esp-idf!33465
2024-09-13 17:54:21 +08:00
Wu Zheng Hui
21ee174957 Merge branch 'fix/allows_to_forcibly_disable_sleep_submodes' into 'master'
fix(esp_hw_support): allows to forcefully disable sleep submode

Closes IDFCI-2380 and PM-228

See merge request espressif/esp-idf!33481
2024-09-13 17:52:37 +08:00
renpeiying
5fe1f22b34 docs: Update application examples for spi master, twai, and spi_slave 2024-09-13 17:05:02 +08:00
Armando
9e9225dbc2 change(rcc): change rcc var i to rcc_cnt 2024-09-13 17:00:07 +08:00
Armando
45b7b7dc1c fix(csi): fixed csi bridge clock closed by csi host driver issue 2024-09-13 17:00:07 +08:00
Chen Yudong
a8482f580a ci: enable esp32c5/c6 wifi basic target tests 2024-09-13 16:42:47 +08:00
JiangGuangMing
ee9a072c82 feat(mbedtls): bringup rom mbedtls feature to formal 2024-09-13 16:40:20 +08:00
Peter Marcisovsky
2da0f66e9a fix(usb_device): Fix console periheral, enable USJ Console on P4 2024-09-13 10:28:43 +02:00
renpeiying
27a88b83fb docs: Add or update application examples for usb_host and usb_device 2024-09-13 16:12:21 +08:00
Jiang Jiang Jian
965986bcf1 Merge branch 'fix/esp32_tx_shake_issue' into 'master'
fix(wifi):fix esp32c2 tx shake issue

Closes WIFIBUG-489 and WIFIBUG-763

See merge request espressif/esp-idf!31908
2024-09-13 15:56:31 +08:00
Roland Dobai
82ddb6920c Merge branch 'fix/docs_tools_c5_c61' into 'master'
Docs: Remove tools from the docs_not_updated list

Closes IDF-9490 and IDF-10167

See merge request espressif/esp-idf!33496
2024-09-13 15:50:44 +08:00
Shu Chen
4d4062a2b8 Merge branch 'feat/thread_dns_ext_resolve' into 'master'
feat(openthread): Replace netconn external resolve hook with dns external hook

See merge request espressif/esp-idf!33344
2024-09-13 15:45:25 +08:00
David Čermák
d4f60febdd Merge branch 'feat/lwip_2.2.0' into 'master'
feat(lwip): Support for new lwip release 2.2.0

Closes IDFGH-11237

See merge request espressif/esp-idf!30388
2024-09-13 15:38:23 +08:00
muhaidong
8daa2e308b fix(wifi): fix some wifi issues
1. fixed softap rx bar from null bss issue
2. fixed multi country info issue
https://github.com/espressif/esp-idf/issues/14323
2024-09-13 15:14:32 +08:00
Xu Xiao
e035e798b7 Merge branch 'feat/add_support_for_ap_choose' into 'master'
feat(wifi): add support for ap choose

Closes WIFIBUG-732, WIFIBUG-741, WIFIBUG-744, WIFIBUG-735, WIFI-6430, and BT-3853

See merge request espressif/esp-idf!33353
2024-09-13 15:03:02 +08:00
gaoxu
5e46dba0f7 fix(adc): fix isp contrast and saturation max value 2024-09-13 14:21:06 +08:00
Roland Dobai
899879cfad fix(docs): Remove tools from the docs_not_updated list 2024-09-13 14:20:20 +08:00
laokaiyao
c6e7e82524 change(sdm): delete the confusing part in sdm programming guide 2024-09-13 14:13:20 +08:00
laokaiyao
d9d316b97d refactor(sdm): add check and error info to the clock division 2024-09-13 14:13:20 +08:00
Erhan Kurubas
d8d57e1965 Merge branch 'sysview_sbom_file' into 'master'
feat(sysview): add sbom manifest file

Closes IDF-8232

See merge request espressif/esp-idf!33330
2024-09-13 13:25:48 +08:00
morris
5ddeab65e3 refactor(mipi_dsi): remove unused LL functions
MIPI DSI PHY reference clock is controlled in hp_sys_clkrst register
2024-09-13 12:24:12 +08:00
xuxiao
73079de058 fix(phy): update libphy to fix tx power is not correct after enable tsens 2024-09-13 11:34:18 +08:00
xuxiao
ffb227ebd2 feat(wifi): add support for ap choose 2024-09-13 11:34:18 +08:00
Jiang Jiang Jian
68d504b4fd Merge branch 'ci/fix_bt_ci' into 'master'
test(ci): fix bt ci that there is no flash_80m config

See merge request espressif/esp-idf!33499
2024-09-13 11:33:51 +08:00
C.S.M
bfdb9f308d test(ci): fix bt ci that there is no flash_80m config 2024-09-13 11:06:20 +08:00
laokaiyao
a80603c05b fix(gpio_reserve): reserve the mspi pin regarding line mode 2024-09-13 11:02:07 +08:00
Fu Hanxi
a760bd2472 Merge branch 'feat/split_pytest_requirements' into 'master'
feat: split pytest requirements to base and test-specific

Closes IDFCI-2307 and IDFCI-2376

See merge request espressif/esp-idf!33429
2024-09-13 02:44:44 +08:00
Fu Hanxi
bc36fda936
ci: temp disable esp32p4 for loadable ram 2024-09-12 15:04:00 +02:00
Shen Weilong
798b7c92c4 fix(ble): fiexed the crash issue of examples/bluetooth/nimble/ble_multi_conn 2024-09-12 20:36:39 +08:00
Fu Hanxi
dc1851bd5a docs: fix indentation error in s3 spi_flash kconfig 2024-09-12 20:18:46 +08:00
Fu Hanxi
1fa6d49f6f ci: remove idf-env.json before install.sh for macos jobs 2024-09-12 20:18:46 +08:00
Fu Hanxi
dca0465095 feat: split pytest requirements to base and test-specific 2024-09-12 20:18:46 +08:00
chenjianhua
53a8345e60 refactor(bt/bluedroid): Refactor the print for BLE examples 2024-09-12 19:30:45 +08:00
Tomas Borcin
83393cdec8 docs: Adding ESP-IDF Project Roadmap 2024-09-12 12:51:22 +02:00
Abhik Roy
1889851d7c Merge branch 'contrib/github_pr_14411' into 'master'
fix(esp_netif): Fixed initializer order of ESP_IP macros for C++ (GitHub PR)

Closes IDFGH-13520

See merge request espressif/esp-idf!33175
2024-09-12 18:44:40 +08:00
morris
c6433de7cc Merge branch 'feat/rgb_lcd_example_lvgl9' into 'master'
feat(rgb_lcd): adapt to LVGL v9

See merge request espressif/esp-idf!33479
2024-09-12 18:32:26 +08:00
Song Ruo Jing
2cef80666b Merge branch 'feature/gpio_add_direction' into 'master'
feat(gpio): allow appending mode to IOs

See merge request espressif/esp-idf!33181
2024-09-12 18:20:11 +08:00
Jiang Jiang Jian
8b962f91a2 Merge branch 'ble_feat/esp32c5_mp_support_ble_light_sleep' into 'master'
feat(ble): support ble light sleep on esp32c5

Closes BLERP-1006

See merge request espressif/esp-idf!33325
2024-09-12 16:59:58 +08:00
David Čermák
4dd715922f Merge branch 'fix/freertos_sim_nonblock_select' into 'master'
fix(freertos): Made select function non-blocking on Linux target (GitHub PR)

Closes IDFGH-13569 and IDFGH-13498

See merge request espressif/esp-idf!33331
2024-09-12 16:57:58 +08:00
Roman Leonov
fac1966c9b Merge branch 'refactor/usb_host_ext_hub_cleanup' into 'master'
refactor(hub): Cleaned up dev_tree_node debug output, moved node freeing

See merge request espressif/esp-idf!33380
2024-09-12 16:01:36 +08:00
David Cermak
015ab1d18f fix(lwip): Fix linker/fr symbol for tcp_output_control segment
In lwip-2.1.3 tcp_output_control_segment() is used to send RST, empty
ACK, keepalive or zero window probe.
In lwip-2.2.0 this works the same, but the function is used when we
don't know the interface to send to (and if used it finds it and calls)
tcp_output_control_segment_netif().
When `LWIP_EXTRA_IRAM_OPTIMIZATION=y` we would ideally move both
variants to IRAM, but the pcb variant (tcp_output_control_segment) could
be optimized away on some targets and toolchain versions.
(esp32c6 with riscv32-esp-elf/esp-14.2.0_20240906)
It should be sufficient to keep tcp_output_control_segment_netif in IRAM
for most common performance usecases.
2024-09-12 09:52:13 +02:00
Konstantin Kondrashov
7b0b80f46f fix(examples): Increases partition table offset for SBV2+FE test 2024-09-12 15:38:18 +08:00
Konstantin Kondrashov
d2123cf531 fix(esptool_py): Check the size of the bootloader + signature block 2024-09-12 15:38:18 +08:00
Liu Xiao Yu
52175a6548 Merge branch 'refactor/supplement_plic_intr_rv_util_apis' into 'master'
refactor(intr): add plic and intc interrupt rv util apis

See merge request espressif/esp-idf!33244
2024-09-12 15:28:24 +08:00
morris
6e8a958754 feat(rgb_lcd): adapt to LVGL v9
This commit mainly refactor the RGB_LCD example to use the latest LVGL
V9 library.
2024-09-12 15:13:27 +08:00
wuzhenghui
0cd6532d36
docs(sleep_mode): update outdated sleep mode configure API in docs 2024-09-12 15:09:31 +08:00
wuzhenghui
37fa09f1dc
fix(esp_hw_support): allows to forcefully disable submodes at mode initialization 2024-09-12 15:09:25 +08:00
Konstantin Kondrashov
3081a4ea49 feat(esp_timer): Updates systimer and esp_timer 2024-09-12 14:26:37 +08:00
Konstantin Kondrashov
00991f1bf5 Merge branch 'feature/esp32c61_re_enable_base_mac_address_test' into 'master'
feat(system): Re-enables the pytest_base_mac_address test for ESP32-C61

Closes IDF-10956

See merge request espressif/esp-idf!33441
2024-09-12 13:24:07 +08:00
Mahavir Jain
fd192e0e9e Merge branch 'fix/ds_tries_acquiring_mpi_lock_twice' into 'master'
Clean up DS trying to re-acquire MPI lock post common crypto lock layer

See merge request espressif/esp-idf!33056
2024-09-12 12:18:22 +08:00
C.S.M
3008d11a68 Merge branch 'refactor/flash_frequency_esptool' into 'master'
refactor(spi_flash): Refactor the flash frequency config file

Closes IDF-10488

See merge request espressif/esp-idf!33427
2024-09-12 10:37:58 +08:00
Marius Vikhammer
35a6671072 Merge branch 'feature/c6_misc_core' into 'master'
feat(system): misc core-system C61 bringup changes

Closes IDF-10954, IDF-10986, IDF-10957, IDF-9281, and IDF-9257

See merge request espressif/esp-idf!33297
2024-09-12 09:46:30 +08:00
Marius Vikhammer
5486653a18 Merge branch 'contrib/github_pr_14422' into 'master'
feat(esp_system,ulp): LP core reserved mem optionally executable from HP core (GitHub PR)

Closes IDFGH-13533

See merge request espressif/esp-idf!33139
2024-09-12 09:10:22 +08:00
Erhan Kurubas
8fd3e8c0d3 fix(apptrace): fix build error when print lock is enabled 2024-09-11 23:02:11 +03:00
Konstantin Kondrashov
e8dab4c257 Merge branch 'feature/esp32c61_update_efuses' into 'master'
feat(efuse): Updates efuse table for esp32c61

Closes IDF-11057 and IDF-9282

See merge request espressif/esp-idf!33436
2024-09-12 01:20:20 +08:00
Xiao Xufeng
ba06e0cfc8 docs(spi_flash): add version number for bootloader version using explicit DC_AWARE 2024-09-12 00:09:15 +08:00
snake-4
09bbc75d96 fix(esp_netif): Fixed initializer order of ESP_IP macros for C++ 2024-09-12 01:25:42 +10:00
Wu Zheng Hui
6abe40e590 Merge branch 'feature/optimize_esp32p4_active_power_eco1' into 'master'
feat(system): Optimize esp32p4 active state  power consumption

Closes PM-103 and IDF-7688

See merge request espressif/esp-idf!32950
2024-09-11 23:15:29 +08:00
Abhik Roy
3aee7c920d Merge branch 'examples/icmpv6_ping_ll_support' into 'master'
fix(examples/icmpv6): Added support for pinging link-local address

Closes FCS-1499

See merge request espressif/esp-idf!32168
2024-09-11 22:58:58 +08:00
David Cermak
4d046b3732 feat(lwip): Reference official lwip-2.2.0-esp 2024-09-11 16:48:07 +02:00
David Cermak
b61a5e7636 change(openthread): Update prebuilt OT lib to comply with lwip ABI 2024-09-11 16:48:07 +02:00
David Cermak
c098388a2f fix(lwip): Use ACD light module for simple DHCP-ARP check 2024-09-11 16:48:07 +02:00
David Cermak
720b74026c fix(esp_netif): Use internal DHCP struct 2024-09-11 16:48:06 +02:00
David Cermak
e8ac6af67e fix(esp_netif): Fix per pppos callback update in new lwip 2024-09-11 16:48:06 +02:00
David Cermak
22f213b518 feat(lwip): Add support for lwip 2.2.0-esp release 2024-09-11 16:48:00 +02:00
Peter Marcisovsky
2e100a3518 Merge branch 'fix/usb_host_change_log_level' into 'master'
fix(usb_host): Update log level and error poropagation

See merge request espressif/esp-idf!33361
2024-09-11 22:37:24 +08:00
radek.tandler
65df4d6e34 fix(storage/nvs): improved documentation section in file system considerations
fix(storage/nvs): improved documentation section in file system considerations1
2024-09-11 16:10:10 +02:00
Wu Zheng Hui
f3c4d57f13 Merge branch 'fix/fix_clock_retention_link_context' into 'master'
fix(esp_hw_support): add clock retention contents for esp32c6 & esp32h2

Closes IDF-9629

See merge request espressif/esp-idf!33411
2024-09-11 21:12:23 +08:00
Rahul Tank
c6bed070d6 Merge branch 'feat/add_ext_adv_param_v2' into 'master'
feat(nimble): Add support for ext adv param v2 HCI command

Closes BLERP-499

See merge request espressif/esp-idf!32863
2024-09-11 18:47:07 +08:00
Abhik Roy
e1102e6794 fix(examples/icmpv6): Added support for pinging link-local address 2024-09-11 20:45:26 +10:00
Xiaoyu Liu
3d403a4ba8 refactor(intr): unify riscv freertos set/clear intr mask from isr apis
refactor(intr): find a potential bug that clic intr mask need extra nop ops
2024-09-11 18:26:07 +08:00
Xiaoyu Liu
8a608da2b0 refactor(intr): add plic and intc interrupt rv util apis
refactor(intr): remove the extra instructions in plic and intc
2024-09-11 18:26:07 +08:00
Cristian Funes
08a1e1350c fix(pthread): Add esp_pthread function implementations for linux target 2024-09-11 12:20:32 +02:00
Song Ruo Jing
e1d3d830ce refactor(gpio): public some IO configuration functions
This allows different peripheral drivers to act on the same IO.
2024-09-11 18:07:46 +08:00
nilesh.kale
12fc7a677e feat: enable support for sha peripheral in esp32c61 2024-09-11 14:49:01 +05:30
Sudeep Mohanty
1b6a829e81 Merge branch 'feat/lp_core_lp_adc_support' into 'master'
feat(lp_adc): Addded support for LP ADC for the LP core on esp32p4

Closes IDF-6875 and IDF-10205

See merge request espressif/esp-idf!33117
2024-09-11 17:16:40 +08:00
Wu Zheng Hui
eab98765ad Merge branch 'feature/introduce_internal_sleep_sub_mode_configure_api' into 'master'
feat(esp_hw_support): introduce internal sleep sub mode configure api

Closes PM-216

See merge request espressif/esp-idf!30687
2024-09-11 17:01:59 +08:00
Wang Meng Yang
c27614fdaa Merge branch 'bugfix/fix_missing_per_adv_sync_est_evt' into 'master'
fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(c66a703)

Closes BT-3859

See merge request espressif/esp-idf!33363
2024-09-11 16:40:26 +08:00
Jiang Jiang Jian
31c60963b5 Merge branch 'bugfix/roaming_app_support_wifi_disconnect' into 'master'
Stops roaming app upon application initiated disconnect

Closes WIFIBUG-551 and WIFIBUG-636

See merge request espressif/esp-idf!30738
2024-09-11 16:10:33 +08:00
Lou Tian Hao
c7d532049a Merge branch 'feature/esp32c61_light_sleep_support_stage_2' into 'master'
feat(esp_hw_support): esp32c61 sleep support (Stage 2: support basic pmu sleep function)

Closes IDF-9248, IDF-9247, IDF-9246, IDF-10993, IDF-9250, PM-203, and IDF-9244

See merge request espressif/esp-idf!33294
2024-09-11 15:11:58 +08:00
Song Ruo Jing
832e08c82f Merge branch 'feature/esp32c61_lp_io_support' into 'master'
feat(lp_io): Add LP_IO support for ESP32C61

Closes IDF-9317

See merge request espressif/esp-idf!33013
2024-09-11 14:45:54 +08:00
Roland Dobai
0b43a55625 Merge branch 'feat/update_tools_in_tools_json' into 'master'
feat(tools): Update tools: cmake, ninja, ccache

Closes IDF-10686 and IDFGH-13476

See merge request espressif/esp-idf!32726
2024-09-11 14:40:19 +08:00
Kapil Gupta
b66f4444d7 fix(esp_wifi): Stop roaming app when station stops 2024-09-11 12:01:31 +05:30
C.S.M
44ff115557 refactor(spi_flash): Refactor the flash frequency config file 2024-09-11 14:13:26 +08:00
Marius Vikhammer
40352943e3 ci(system): re-enable system test app for C61 2024-09-11 14:05:11 +08:00
Marius Vikhammer
b93e2a6915 test(intr): fix intr dump test for C61 and re-enable it 2024-09-11 14:05:11 +08:00
Marius Vikhammer
e1e02cae0c feat(system): enable WDT support on esp32c61 2024-09-11 14:05:11 +08:00
Rahul Tank
1f41827bc3 Merge branch 'bugfix/bidirectioanl_data_transfer_ble_spp' into 'master'
fix(nimble): Added support for bidirectional data trasfer

Closes BLERP-1021

See merge request espressif/esp-idf!33402
2024-09-11 14:02:51 +08:00
C.S.M
f5a2a1ff82 Merge branch 'fix/i2c_out_od_reg_value' into 'master'
fix(i2c): Fix the i2c sda/scl force out register value on some esp chips(c6,h2,p4,c5,c61)

See merge request espressif/esp-idf!33299
2024-09-11 13:52:37 +08:00
C.S.M
04e925e4a8 Merge branch 'feature/suspend_bringup' into 'master'
feat(spi_flash): Add suspend support on esp32c5, esp32c61

Closes IDF-9255 and IDF-8648

See merge request espressif/esp-idf!33364
2024-09-11 13:48:11 +08:00
Konstantin Kondrashov
2af66dac25 Merge branch 'feature/ipc_isr_riscv_test_enable' into 'master'
feat(system): Enables test_ipc_isr_riscv for ESP32-P4

Closes IDF-8353

See merge request espressif/esp-idf!33440
2024-09-11 12:56:30 +08:00
Kapil Gupta
09b421674b fix(esp_wifi): Remove duplicate declaration of function 2024-09-11 10:03:38 +05:30
jgujarathi
e411e43b4b fix(examples) : Common component's wifi disconnect handler should ignore roaming disconnect
- Common component's wifi disconnect handler should ignore roaming disconnect (WIFI_REASON_ROAMING)
  as connect gets issued internally in these cases.
2024-09-11 11:39:43 +08:00
jgujarathi
6547315dde fix(esp_wifi): Stops roaming app upon application initiated disconnect
Stops roaming app when the application initiates a disconnect.
Roaming app if enabled will be restarted when the station reconnects again.
2024-09-11 11:39:43 +08:00
jgujarathi
e2ba2cfbe2 fix(esp_supplicant): Fix compilation issues with btm and rrm status funcs
- Ensure that the btm and rrm status funcs can be used even if 80211.kv
  are not enabled in menuconfig. They will return false in such cases.
2024-09-11 11:39:43 +08:00
wangtao@espressif.com
c46cb415bd fix(wifi): fix esp32c2 tx shake issue 2024-09-11 11:32:25 +08:00
linruihao
b4100e5362 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(c66a703)
- Fixed missing sync established event after canceling sync
2024-09-11 11:14:19 +08:00
wuzhenghui
21f79616bd
change(esp_driver_spi): increase SPI_PER_TRANS_POLLING peformance tolerance 2024-09-11 10:53:45 +08:00
wuzhenghui
13e42707a0
feat(esp_hw_support): add clk tree source gate management api 2024-09-11 10:53:01 +08:00
wuzhenghui
c41d432397
fix(ulp): fix uart driver delete order in lp uart test case 2024-09-11 10:53:00 +08:00
wuzhenghui
71fb3d2f31
fix(esp_system): fix test rodata being prefetched into cache unexpectedly 2024-09-11 10:53:00 +08:00
wuzhenghui
05e74480f5
feat(esp_system): gate some clock by default to optmize esp32p4 active power 2024-09-11 10:53:00 +08:00
Zhang Xiao Yan
fba9b50456 Merge branch 'docs/update_startup_for_single_core_chip' into 'master'
docs: update startup.rst description for single-core chip support

See merge request espressif/esp-idf!33393
2024-09-11 10:32:44 +08:00
Zhang Xiao Yan
56ac70430e docs: update startup.rst description for single-core chip support 2024-09-11 10:32:44 +08:00
chenjianhua
e4e23087ee fix(bt/bluedroid): Fixed access fault when reading BLE controller information fails 2024-09-11 10:26:45 +08:00
chenjianhua
e4a372ab76 feat(bt/bluedroid): Add BLE connection id param for ESP_GATTS_RESPONSE_EVT 2024-09-11 10:26:45 +08:00
Wang Tao
9b242a4817 Merge branch 'feat/add_protect_for_softap_send_no_bss_deauth' into 'master'
feat(wifi): add protect for softap when sending mgmt frame to not connected station

Closes WIFIBUG-453、WIFIBUG-624、WIFIBUG-416、WIFIBUG-439、WIFI-6569

See merge request espressif/esp-idf!31780
2024-09-11 10:21:08 +08:00
WanqQixiang
f62628d334 feat(openthread): Replace netconn external resolve hook with dns external hook 2024-09-11 09:59:06 +08:00
Kevin (Lao Kaiyao)
a0e954b941 Merge branch 'refactor/prepare_to_split_soc_include_folder' into 'master'
refactor(soc): create soc include folders

See merge request espressif/esp-idf!33303
2024-09-11 09:58:15 +08:00
Zhang Xiao Yan
afd74267c8 Merge branch 'docs/add_application_examples_ble_mesh' into 'master'
docs: update application examples for BLE mesh

See merge request espressif/esp-idf!32187
2024-09-11 09:56:29 +08:00
Ivan Grokhotkov
0a2dc3b2d6 Merge branch 'doc/sdmmc_emmc_support' into 'master'
docs(sdmmc): update information about eMMC support

Closes DOC-8906

See merge request espressif/esp-idf!33022
2024-09-10 22:06:33 +08:00
Song Ruo Jing
9994f493ed feat(lp_io): Add LP_IO support for ESP32C61 2024-09-10 20:50:31 +08:00
Armando (Dou Yiwen)
87b295a35f Merge branch 'feat/ram_loadable_app_c5_c61' into 'master'
ram_app: support c5 c61, fixed PMA15 occupied by ROM issue

Closes IDF-8644, IDF-9251, IDF-10315, and IDF-10951

See merge request espressif/esp-idf!33381
2024-09-10 20:25:36 +08:00
Konstantin Kondrashov
75c917eef8 feat(system): Re-enables the pytest_base_mac_address test for ESP32-C61 2024-09-10 15:09:32 +03:00
Konstantin Kondrashov
f555812975 feat(system): Enables test_ipc_isr_riscv for ESP32-P4 2024-09-10 15:02:42 +03:00
Lou Tianhao
d242b662c4 change(pm): remove some cache regs that don not need to backup now 2024-09-10 19:37:50 +08:00
Lou Tianhao
50ec7f990c fix(ci): take some actions to pass ci 2024-09-10 19:37:50 +08:00
Lou Tianhao
ac76402aff fix(pm): write back cache for psram 2024-09-10 19:37:50 +08:00
Lou Tianhao
d5c58a1d8c fix(pm): add hp power_supply_wait_time_us to avoid power glitch 2024-09-10 19:37:45 +08:00
Rahul Tank
c7a238054a feat(nimble): Add support for ext adv param v2 HCI command 2024-09-10 16:59:40 +05:30
Konstantin Kondrashov
8539760e79 feat(efuse): Updates efuse table for esp32c61 2024-09-10 14:16:29 +03:00
Mahavir Jain
02c3445c66 Merge branch 'fix/adding_check_for_nvs_partition' into 'master'
fix(nvs_sec_provider): Added check for nvs_keys partition

See merge request espressif/esp-idf!33212
2024-09-10 18:11:26 +08:00
cjin
50d410e1c8 feat(ble): support ble light sleep on esp32c5 2024-09-10 15:19:22 +08:00
Ivan Grokhotkov
f789b4eb45 Merge branch 'bugfix/build_test_better_errors' into 'master'
test(build_system): print failed command and output when test fails

See merge request espressif/esp-idf!32962
2024-09-10 15:18:41 +08:00
Ivan Grokhotkov
71fe7543f1
docs(sdmmc): update information about eMMC support
Related to https://esp32.com/viewtopic.php?f=13&t=41088

Co-authored-by: Zhang Shu Xian <zhangshuxian@espressif.com>
2024-09-10 09:14:54 +02:00
Sudeep Mohanty
0b75e75f2c feat(lp_adc): Added example to demonstrate LP ADC usage from LP Core
This commit adds an example which demonstrates how to configure and use
the LP ADC from the LP core while the main core is in deep sleep.
2024-09-10 08:45:11 +02:00
Sudeep Mohanty
594880dae4 test(lp_adc): Added LP Core unit tests for testing LP ADC
Added a unit test to verify that LP ADC1 works and can be read from the
LP Core.
2024-09-10 08:45:11 +02:00
Sudeep Mohanty
1e5efd7fa7 feat(lp_adc): Added support to read LP ADC from the LP core
This commit adds APIs to initialize and configure the LP ADC from the HP
core and also adds APIs to read the raw and converted ADC values from the LP core.
2024-09-10 08:45:11 +02:00
Sudeep Mohanty
d604e09274 feat(lp_adc): Added support for LP ADC initialization to the esp_adc oneshot driver
This commit adds support for LP ADC initialization to the esp_adc
oneshot driver, when it is used from the HP core.
2024-09-10 08:45:11 +02:00
Sudeep Mohanty
f972cd4bbd feat(clk): Addded support for LP ADC clock source for esp32p4
This commit adds support for the LP ADC clock source on the esp32p4.
2024-09-10 08:45:11 +02:00
wangtao@espressif.com
85da8402be feat(wifi): add protect for softap send no bss deauth 2024-09-10 14:23:43 +08:00
Jiang Jiang Jian
72266fd7ce Merge branch 'feature/support_coexist_debug' into 'master'
feat(coex): support GPIO debug

Closes WIFI-6625

See merge request espressif/esp-idf!32371
2024-09-10 14:17:52 +08:00
C.S.M
c2f6144daa fix(i2c): Fix the i2c sda/scl force out register value on some esp chips 2024-09-10 13:45:50 +08:00
andylinpersonal
0e30c42625 feat(esp_system,ulp): Make LP core reserved memory optionally executable in HP core 2024-09-10 12:17:38 +08:00
hrushikesh.bhosale
aaf1f868d5 fix(nvs_sec_provider): Added check for nvs_keys partition
Added check to whether nvs_keys partition is provided or not in partiton csv.
Converted nvs_sec_provider_register_flash_enc_ctr and nvs_sec_provider_register_hmac_ctr
functions from __attribute__(constructor) to ESP_SYSTEM_INIT_FN.
2024-09-10 12:12:02 +08:00
Mahavir Jain
ef221d007a Merge branch 'feat/update_protocol_docs_for_esp32c61' into 'master'
docs(protocols): Updated the protocol docs for esp32c61

Closes IDF-10178

See merge request espressif/esp-idf!33384
2024-09-10 12:10:37 +08:00
Omar Chebib
bc0b04d779 Merge branch 'staging/enabling_panic_test_esp32c61' into 'master'
test(panic): enable tests for esp32c61

Closes IDF-10994

See merge request espressif/esp-idf!33277
2024-09-10 11:37:38 +08:00
Armando
9c81fe6114 fix(mspi): fixed mspi clock wrong on ram loadable app on c61, enable tests on c5 c61 2024-09-10 11:12:03 +08:00
Armando
17fc026c48 fix(pma): fixed pma 15 occupied by rom on c5 issue 2024-09-10 11:12:02 +08:00
Armando
42cf1d8867 fix(mspi): fixed mspi clock wrong on ram loadable app on c5 2024-09-10 11:12:02 +08:00
Lou Tianhao
46af50ee5a fix(pm): mspi cannot access flash when pd pll source 2024-09-10 10:45:57 +08:00
Lou Tianhao
d4447739a9 example(light_sleep); enable lp_timer/gpio/uart wakeup for esp32c61 2024-09-10 10:45:57 +08:00
Lou Tianhao
fd94fe1161 feat(pm): support cpu retention for esp32c61 2024-09-10 10:45:52 +08:00
Lou Tianhao
c9434aaebf change(pm): update pmu analog param for lightsleep(including pu xtal and fosc) & deepsleep 2024-09-10 10:44:13 +08:00
Lou Tianhao
0926a700c2 feat(pm): support basic pmu sleep 2024-09-10 10:44:13 +08:00
liuning
691b6e245b feat(coex): support GPIO debug 2024-09-10 10:40:15 +08:00
C.S.M
9e864ffe26 feat(spi_flash): Add suspend support on esp32c5, esp32c61 2024-09-10 10:36:27 +08:00
laokaiyao
65f49c6a7b refactor(soc): create soc include folders 2024-09-10 09:56:11 +08:00
morris
f0a2091e4d Merge branch 'bugfix/i2c_clear_bus_wrong_calue' into 'master'
fix(i2c): Fix the wrong return value of esp32,esp32s2,esp32s3

See merge request espressif/esp-idf!33403
2024-09-10 09:30:49 +08:00
Sean DuBois
58775cce6e fix(ws_transport): Fix crash when reading
When parsing WS framing protocol integer promotion would cause
invalid values to be read. Acting upon these values would eventually
cause a crash

Fixes esp-protocols#645
2024-09-09 12:32:37 -04:00
Roland Dobai
d5341bd455 Merge branch 'fix/fix_shell_detection' into 'master'
fix(activate): use exe instead of comm for parent shell detection

Closes IDF-11080

See merge request espressif/esp-idf!33378
2024-09-09 23:03:22 +08:00
David Cermak
f7129481ed fix(freertos): Update select on Linux target to handle edge cases
* Handle not found "select()" symbol if dlsym() return NULL
* Handle minimum wait time if remaining time < designated minimum sleep
time
2024-09-09 16:52:51 +02:00
Astha Verma
4cbf2eb899 fix(nimble): Added support for bidirectional data trasfer 2024-09-09 18:36:21 +05:30
wuzhenghui
2172aaf6a2
fix(esp_hw_support): add clock retention contents 2024-09-09 20:49:06 +08:00
hrushikesh.bhosale
952533bee3 docs(systems): Updated the random number generator docs for esp32c61
Udpated the non_updated_docs for esp32c61 for random number geneartor
2024-09-09 17:20:35 +05:30
C.S.M
5141f01e56 fix(i2c): Fix the wrong return value of esp32,esp32s2,esp32s3 2024-09-09 19:15:02 +08:00
Armando (Dou Yiwen)
8d75f0d198 Merge branch 'fix/ram_loadable_app_p4' into 'master'
ram_app: fixed ram loadable app on p4

Closes IDF-8994

See merge request espressif/esp-idf!33312
2024-09-09 18:07:26 +08:00
Jiang Jiang Jian
489ba7c2fa Merge branch 'bugfix/enable_ci_build_by_esp32p4_with_extconn' into 'master'
fix(wifi): enable ci build by sdkconfig.ci.esp32p4_with_extconn

See merge request espressif/esp-idf!33319
2024-09-09 17:27:36 +08:00
Jiang Jiang Jian
9a47de53e1 Merge branch 'feat/support_esp32c2_eco4_rom_mbedtls_v3.6.0_lts' into 'master'
feat(mbedtls): support esp32c2 rev2.0 ROM mbedTLS v3.6.0-LTS

Closes IDF-10680

See merge request espressif/esp-idf!33227
2024-09-09 16:53:53 +08:00
Chai Ji’e
a90000856c Merge branch 'bugfix/fix_wrong_sleep_memory_param_p4_c5_c61' into 'master'
fix(sleep): fix_wrong_sleep_param_for_lp_memory_retention

See merge request espressif/esp-idf!33304
2024-09-09 15:45:18 +08:00
Alexey Lapshin
599c14d8f0 Merge branch 'feature/update-toolchain-to-esp-14.2.0_20240903' into 'master'
feat(tools): update toolchain version to esp-14.2.0_20240906

Closes IDFGH-13033, IDFGH-13355, and IDFGH-13360

See merge request espressif/esp-idf!33295
2024-09-09 14:22:47 +08:00
C.S.M
2014e5ae10 Merge branch 'fix/bus_clear_error' into 'master'
fix(i2c): Fix possible error state in clear the bus

Closes IDFGH-12655

See merge request espressif/esp-idf!33174
2024-09-09 11:51:17 +08:00
hrushikesh.bhosale
737bbb4a91 docs(protocols): Updated the protocol docs for esp32c61
Checked and updated the not_updated_docs for esp32c61 for
protocols examples
2024-09-09 08:55:37 +05:30
chenjianhua
fe43c8f1b5 fix(bt/controller): Change the max TX power to +20dBm on ESP32-C3 and ESP32-S3 2024-09-09 11:25:10 +08:00
Zhang Xiao Yan
10f10ad313 Merge branch 'docs/update_application_examples_phy' into 'master'
docs: add application examples for phy.rst

See merge request espressif/esp-idf!32470
2024-09-09 10:47:11 +08:00
Linda
1263b97c5b docs: update application examples for BLE mesh 2024-09-09 10:45:55 +08:00
Armando
6933ba39bc fix(system): fixed ram loadable app on p4 2024-09-09 10:31:48 +08:00
morris
24047f9a04 Merge branch 'docs/sync_psram_noinit_and_bss_description' into 'master'
docs(psram): sync psram noinit description

See merge request espressif/esp-idf!33360
2024-09-09 10:00:07 +08:00
Peter Marcisovsky
3362e18432 fix(usb_host): Update log level and error poropagation 2024-09-08 18:43:42 +02:00
Wang Meng Yang
160bd658fc Merge branch 'bugfix/exit_sniff_immed_enter_sniff' into 'master'
fix(bt/bluedroid): Fix the protocol stack to exit sniff mode

Closes BTQABR2023-291

See merge request espressif/esp-idf!33305
2024-09-08 15:49:31 +08:00
Alexey Lapshin
57d39c3923 fix(driver_spi): supress overlapping buffers warning for GCC analyzer 2024-09-08 13:53:52 +07:00
Alexey Lapshin
401b395106 fix(hal): supress overlapping buffers warning for GCC analyzer 2024-09-08 13:53:52 +07:00
Alexey Lapshin
eee58bb717 fix(camera_dsi): update esp_cam_sensor example dependency 2024-09-08 13:53:52 +07:00
Alexey Lapshin
2dc4ca4fa6 fix(ci): ignore .section field for check_public_headers.py 2024-09-08 13:53:52 +07:00
Alexey Lapshin
d529da25c4 fix(driver_dac): fix GCC 14 analyzer warnings
error: check of 's_ddp' for NULL after already dereferencing it
2024-09-08 13:53:52 +07:00
Alexey Lapshin
1370511dff fix(esp_timer): place esp_timer_get_time test to IRAM 2024-09-08 13:53:52 +07:00
Alexey Lapshin
29b028076a feat(cxx): change test value of __cplusplus to 202302L 2024-09-08 13:53:52 +07:00
Alexey Lapshin
664c2e6b77 feat(build): add CONFIG_COMPILER_DISABLE_GCC14_WARNINGS option 2024-09-08 13:53:52 +07:00
Alexey Lapshin
6f1671c9c9 fix(i2c): fix memory allocation size in example 2024-09-08 13:53:52 +07:00
Alexey Lapshin
f1c0fc0bbd fix(bt): fix alloc-size warning
Warning: allocation of insufficient size '36' for type 'tBTA_DM_MSG'
with size '320' [-Werror=alloc-size]
2024-09-08 13:53:52 +07:00
Alexey Lapshin
205e814563 fix(esp_psram): fix dead code compilation 2024-09-08 13:53:52 +07:00
Alexey Lapshin
5737ba06c3 fix(esp_hw_support): fix acessing array bellow bounds 2024-09-08 13:53:52 +07:00
Alexey Lapshin
a262e879d1 fix(esp_http_server): fix GCC 14 analyzer warnings 2024-09-08 13:53:52 +07:00
Alexey Lapshin
725b9ec81e fix(freertos): fix GCC 14 analyzer warnings 2024-09-08 13:53:52 +07:00
Alexey Lapshin
06fdb02435 fix(newlib): fix GCC 14 analyzer warnings 2024-09-08 13:53:52 +07:00
Alexey Lapshin
5e4d6190d8 fix(pthread): fix GCC 14 analyzer warnings 2024-09-08 13:53:52 +07:00
Alexey Lapshin
4d2881dac1 fix(hal): fix GCC 14 analyzer warnings 2024-09-08 13:53:52 +07:00
Alexey Lapshin
7498f4655a fix(esp_system): fix GCC 14 analyzer warnings 2024-09-08 13:53:52 +07:00
Alexey Lapshin
4c87af6359 fix(build): fix calloc warnings 2024-09-08 13:53:52 +07:00
Alexey Lapshin
47212eaa3a feat(tools): update toolchain version to esp-14.2.0_20240903
Closes https://github.com/espressif/esp-idf/issues/13979
Closes https://github.com/espressif/esp-idf/issues/14273
Closes https://github.com/espressif/esp-idf/issues/14267
2024-09-08 13:52:22 +07:00
Roman Leonov
a9d960a81f refactor(hub): Cleaned up dev_tree_node debug output, moved node freeing 2024-09-06 22:44:37 +02:00
wuzhenghui
fd79c593fb fix(ci): increase uart driver test memory leak threshold 2024-09-07 02:04:43 +08:00
wuzhenghui
0272fc405b change(esp_hw_support): update test cases with new sub-mode setting API 2024-09-07 02:04:43 +08:00
wuzhenghui
5184d7ec98 change(esp_hw_support): replace esp_sleep_periph_use_8m with new API 2024-09-07 02:04:43 +08:00
wuzhenghui
7555686649 change(esp_hw_support): replace rtc_sleep_enable_ultra_low with new API 2024-09-07 02:04:43 +08:00
wuzhenghui
b1df2688ce change(esp_hw_support): replace esp_sleep_enable_adc_tsens_monitor with new API 2024-09-07 02:04:43 +08:00
wuzhenghui
417edbb2e2 feat(esp_hw_support): introduce sub sleep mode config API 2024-09-07 02:04:38 +08:00
Wan Lei
92fc3e9a5d Merge branch 'refa/replce_esp_dma_xxx_malloc_api' into 'master'
refa(spi): clean up esp_dma_xxx memory allocation code

Closes IDF-9656

See merge request espressif/esp-idf!31239
2024-09-06 22:08:22 +08:00
Frantisek Hrbata
65d18fce4c fix(activate): use exe instead of comm for parent shell detection
Currently, we are using psutil.Process().name(), which includes the
command as entered on the command line. This becomes an issue if the
export script is initiated within another script.

run.sh

    #!/usr/bin/bash
    . ./export.sh

In this case the activate script will see `run.sh` instead of bash.

/proc/<pid>/com vs /proc/<pid>/exe

Use exe(), which contains the full executable path to fix this.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-09-06 15:58:24 +02:00
Jiang Guang Ming
5bb93061a3 feat(mbedtls): support rom mbedtls threading layer 2024-09-06 19:27:57 +08:00
Marek Fiala
f90b847cb1 Merge branch 'fix/correct_shell_detection' into 'master'
fix(tools): Corrected detect_shell

See merge request espressif/esp-idf!33365
2024-09-06 19:22:15 +08:00
Alexey Lapshin
c605620073 Merge branch 'fix/keep-got-sections-for-riscv' into 'master'
feat(esp_system): drop .got* sections and add hint

See merge request espressif/esp-idf!32969
2024-09-06 19:21:06 +08:00
nilesh.kale
70d4414eeb feat(esp_https_ota): added API to get last status code logged from http resonse
Closes https://github.com/espressif/esp-idf/issues/14302
2024-09-06 15:09:42 +05:30
Guillaume Souchere
6f37ff7a8f Merge branch 'fix/bootloader-factory-reset-test-app-pin-range' into 'master'
fix(bootloader): Update pin range for factory reset and app test configurations

Closes IDFGH-13623

See merge request espressif/esp-idf!33342
2024-09-06 17:21:38 +08:00
Marek Fiala
24ae042bba fix(tools): Corrected detect_shell
When comparing process name with python,
lowercase the process name in condition.
2024-09-06 11:11:50 +02:00
Wang Meng Yang
ca05aa5cd2 Merge branch 'feature/add_di_api' into 'master'
Feature/add di api

Closes IDFGH-11785

See merge request espressif/esp-idf!32872
2024-09-06 17:11:19 +08:00
Jiang Jiang Jian
386420067a Merge branch 'bugfix/ftm_apsta_bw_issue' into 'master'
Fix FTM issues in AP-STA mode

Closes WIFIBUG-634

See merge request espressif/esp-idf!32276
2024-09-06 16:26:35 +08:00
shenmengjing
f6003fb8bf docs: Update CN translation for several docs 2024-09-06 16:17:32 +08:00
morris
dba8722bc0 Merge branch 'feat/support_esp32c2_eco4_rom_systimer_hal' into 'master'
feat(esp_rom): support esp32c2 rev2.0(ECO4) rom systimer hal

Closes IDF-10677

See merge request espressif/esp-idf!33335
2024-09-06 16:06:10 +08:00
Roland Dobai
e7c0d69215 Merge branch 'feature/python_activation' into 'master'
feat: add python script to activate ESP-IDF environment

Closes IDF-4803

See merge request espressif/esp-idf!31334
2024-09-06 14:37:53 +08:00
Chen Jichang
057b6b72ba docs(psram): sync psram noinit description 2024-09-06 14:30:54 +08:00
C.S.M
3ccdd8b397 fix(i2c): Fix possible error state in clear the bus,
Closes https://github.com/espressif/esp-idf/issues/13647
2024-09-06 14:28:26 +08:00
morris
9ec1042dff Merge branch 'test/fix_mspi_ci_c61' into 'master'
fix(mspi): Fix the mspi ci build test on esp32c61

See merge request espressif/esp-idf!33355
2024-09-06 14:23:53 +08:00
Roland Dobai
17fed13a27 Merge branch 'distutils' into 'master'
fix(tools): remove distutils to support python 3.12

Closes IDFGH-13510

See merge request espressif/esp-idf!33260
2024-09-06 14:23:04 +08:00
Chen Ji Chang
646d2f9e4a Merge branch 'feat/parlio_tx_support_psram_buffer' into 'master'
feat(parlio_tx): support transmit buffer in external PSRAM

Closes IDF-10981

See merge request espressif/esp-idf!33347
2024-09-06 14:00:35 +08:00
C.S.M
f36fb4cdb0 fix(mspi): Fix the mspi ci build test on esp32c61 2024-09-06 13:29:14 +08:00
Rahul Tank
0f11052406 Merge branch 'bugfix/add_notify_flag_for_wifi_prov' into 'master'
fix(wifi_prov): Add notify characteristic flag support

See merge request espressif/esp-idf!32311
2024-09-06 13:27:52 +08:00
Rahul Tank
b341791f78 Merge branch 'bugfix/make_cccd_flags_configurable' into 'master'
fix(nimble): Make CCCD flags configurable

Closes BLERP-954

See merge request espressif/esp-idf!32971
2024-09-06 13:19:17 +08:00
Guillaume Souchere
ab4e658af6 fix(bootloader): Update pin range for factory reset and app test
Update the range for pin selection of BOOTLOADER_NUM_PIN_APP_TEST
and BOOTLOADER_NUM_PIN_FACTORY_RESET based on the selected target.

Closes https://github.com/espressif/esp-idf/issues/14508
2024-09-06 07:18:46 +02:00
Island
53dff5357f Merge branch 'ble_dev/esp32c2eco4_chip_20240903' into 'master'
change(ble): update c2 eco4 ld file

See merge request espressif/esp-idf!33327
2024-09-06 11:24:43 +08:00
Chen Jichang
227f80ff88 feat(parlio_tx): support psram buffer 2024-09-06 11:20:39 +08:00
Armando (Dou Yiwen)
5dff189341 Merge branch 'feat/xip_psram_c5' into 'master'
psram: xip_psram support on c5/c61, also fixed cache writeback/invalidate not work issue on c61

Closes IDF-8688, IDF-9292, and IDF-11008

See merge request espressif/esp-idf!33265
2024-09-06 10:39:57 +08:00
Jiang Guang Ming
d0ec6fc04d fix(mbedtls): MBEDTLS_CMAC_C not effective when MBEDTLS_USE_CRYPTO_ROM_IMPL enabled 2024-09-06 09:55:27 +08:00
Jiang Guang Ming
d74ff5224c feat(mbedtls): support ROM mbedtls v3.6.0 on C2 rev2.0(ECO4) 2024-09-06 09:55:27 +08:00
Jiang Guang Ming
4955a199a8 feat(esp_rom): include rom.mbedtls.eco4.ld with C2 rev2.0(ECO4) select 2024-09-06 09:55:27 +08:00
Jiang Guang Ming
d7ea73ad66 feat(esp_rom): update esp32c2.rom.mbedtls.eco4.ld 2024-09-06 09:55:27 +08:00
Tomas Rezucha
c2b5339275 Merge branch 'feat/usb_disconnect_api' into 'master'
refactor(usb): Update HCD tests to use port power off for disconnections

Closes IDF-11006

See merge request espressif/esp-idf!31179
2024-09-06 09:46:57 +08:00
Marius Vikhammer
72bcaf1d74 Merge branch 'feature/c61_rtc_mem_remove' into 'master'
feat(system): remove references to RTC mem on C61

See merge request espressif/esp-idf!33291
2024-09-06 09:42:01 +08:00
Tomas Rezucha
19bf686d5e feat(usb/host): Enable USB Host tests on P4 2024-09-05 19:41:07 +02:00
Tomas Rezucha
3857f779cc fix(usb/host): Correctly handle unpowered port in HUB 2024-09-05 19:40:52 +02:00
muhaidong
5e4674775b fix(wifi): enable ci build by sdkconfig.ci.esp32p4_with_extconn 2024-09-05 20:29:40 +08:00
harshal.patil
c4f60d91f1
feat(mbedtls): Wrap mbedtls_ecdsa_read_signature to use ECDSA hardware when possible 2024-09-05 16:27:58 +05:30
harshal.patil
331fd7f79f
fix(mbedtls/port): Check signature hash length before using ECDSA hardware 2024-09-05 16:27:58 +05:30
Armando
5316a36175 fix(cache): fixed cache writeback/invalidate cannot reach higher vaddr parts 2024-09-05 18:47:02 +08:00
Rahul Tank
fb55646270 fix(nimble): Add notify characteristic flag support 2024-09-05 16:16:08 +05:30
Nachiket Kukade
4854bf8640 fix(esp_wifi): Fix FTM issues in AP-STA mode
Add AP-STA mode support in FTM example
Update wifi libs with below changes -
- Use ex-AP's bandwidth in FTM request when connected
- Allow Bandwidth downgrade in FTM negotiation
- Use separate calibration when Initiator performs 20MHz FTM
  while in-AP is in 40MHz
2024-09-05 16:02:27 +05:30
Darian Leung
cac0ef9d11 refactor(usb): Remove use of usb_phy_action() from unit tests
Currently, USB Host unit tests that require a software triggered disconnection/
reconnection rely on the 'usb_phy_action()' function.

This commit replaces those calls with 'hcd_port_command()' or
'usb_host_lib_set_root_port_power()'.

Note: Also removed 'test_usb_common.h/c' as it is no longer necessary are the
function call replacements.
2024-09-05 12:27:27 +02:00
Darian Leung
54db1cda8b feat(usb): Add usb_host_lib_set_root_port_power()
This commit adds the usb_host_lib_set_root_port_power() function. This provides
a public API for users to power the root port OFF or ON at runtime, thus trigger
a disconnection or allow connections respectively.

In addition, the usb_host_config_t.root_port_unpowered install configuration is
provided to allow users to install the USB Host Library without automatically
powering ON the root port.
2024-09-05 12:27:27 +02:00
C.S.M
59e1838270 Merge branch 'feat/gpspi_flash_support_c61' into 'master'
Some checks failed
docker / docker (push) Has been cancelled
test(esp_flash): Enable test for spi_flash component for c61/c5/p4

Closes IDF-10313, IDF-8715, IDF-9314, IDF-10991, and IDF-8985

See merge request espressif/esp-idf!33238
2024-09-05 18:13:55 +08:00
Chen Jichang
7dd15bee31 fix(parlio_tx): fix error in first transfer and 1 byte transfer
On p4, the clock was configured in the wrong order causing a dropped
count on the first transmission. And gdma eof event fails to trigger
parlio_tx eof event when transmitting single byte.
2024-09-05 17:12:49 +08:00
Alexey Lapshin
73987108cd feat(esp_system): drop .got* sections and add hint
Closes https://github.com/espressif/esp-idf/issues/14296
2024-09-05 15:47:01 +07:00
Marek Fiala
7b417fc3f2 feat(tools): Add backup option to use legacy export script
This feature serves as an immediate fix in case
the new export approach causes issues.
The user can simply set the environment variable `ESP_IDF_LEGACY_EXPORT`,
and the old export script will be used.
2024-09-05 10:13:05 +02:00
Marek Fiala
88527faff8 feat(tools): Added Windows shells support + refactoring 2024-09-05 10:13:04 +02:00
Frantisek Hrbata
1c22f6c4e8 feat: add python script to activate ESP-IDF environment
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-09-05 10:13:03 +02:00
liqigan
be1c677bdd feat(esp_hid): Create Device ID Service record in esp_hid_device example
Closes https://github.com/espressif/esp-idf/issues/12880
2024-09-05 15:33:03 +08:00
liqigan
c564817862 feat(bt/bluedroid): Add API to create Device ID Service record 2024-09-05 15:32:56 +08:00
liqigan
8a5184e68e change(bt/bluedroid): Limited SDP service discovery operation 2024-09-05 15:32:12 +08:00
liqigan
9becdfdc6d change(bt/bluedroid): Release record data after SDP record created 2024-09-05 15:32:12 +08:00
Peter Marcisovsky
0c388cf576 Merge branch 'refactor/usb_host_add_func_ret_values_description' into 'master'
Refactor: USB Host add function return values description

Closes IDF-10455

See merge request espressif/esp-idf!32106
2024-09-05 15:20:04 +08:00
Peter Marcisovsky
ee41fc8a4c Merge branch 'fix/usb_device_composite_pytest_exception' into 'master'
ci(usb_device): Fix exception for ACM port in USB composite device pytest

See merge request espressif/esp-idf!33288
2024-09-05 15:12:37 +08:00
David Čermák
5ef55584c1 Merge branch 'feat/lwip_dns_external_resolve_hook' into 'master'
feat(lwip): Add DNS external resolve hook

See merge request espressif/esp-idf!32595
2024-09-05 15:00:17 +08:00
Omar Chebib
d025ff4073 test(panic): enable tests for esp32c61 2024-09-05 14:50:58 +08:00
Island
1d8f1a584c Merge branch 'bugfix/fix_some_ble_bugs_240826' into 'master'
Fixed some BLE bugs 240826 on ESP32C3 (8ce789b)

Closes BLERP-1002, BLERP-1003, BLERP-1005, and BLERP-1004

See merge request espressif/esp-idf!33253
2024-09-05 11:34:36 +08:00
Island
c4d1c046a0 Merge branch 'feat/support_ble_scan_and_init_coex_on_esp32' into 'master'
Support BLE scanning and initiating coexist on ESP32

Closes BLERP-930, BLERP-931, BLERP-1003, and BLERP-1002

See merge request espressif/esp-idf!32791
2024-09-05 11:34:30 +08:00
Jiang Guang Ming
f3eaa7abae feat(esp_rom): support esp32c2 rev2.0(ECO4) rom systimer hal 2024-09-05 11:04:42 +08:00
wanlei
d15e53d876 refa(spi): clean up esp_dma_xxx memory allocation code 2024-09-05 10:56:30 +08:00
Jiang Jiang Jian
e813b32a3a Merge branch 'fix/fix_esp32c2_eco4_build_issue' into 'master'
fix(wifi): fix esp32c2 eco4 build issue

See merge request espressif/esp-idf!33326
2024-09-05 10:34:58 +08:00
WanqQixiang
9c4ae855bb feat(lwip): Add DNS external hook 2024-09-05 10:09:15 +08:00
Guilhem Saurel
727c6a82ea fix(tools): python3.12 support
remove distutils use
2024-09-04 18:00:56 +02:00
Erhan Kurubas
f8202963e6 feat(sysview): add sbom manifest file 2024-09-04 18:38:01 +03:00
Jiang Jiang Jian
93454579ef Merge branch 'bugfix/psram_fallback_in_wifi_osi' into 'master'
fix(wifi): Add PSRAM failure fallback in WiFi OSI API's

Closes WIFIBUG-700, WIFIBUG-705, WIFIBUG-713, WIFIBUG-736, and WIFI-6592

See merge request espressif/esp-idf!32713
2024-09-04 23:07:42 +08:00
Alexey Gerenkov
a07eed67ef Merge branch 'feat/ulp_debug' into 'master'
feat(ulp): Add LP core debugging support

See merge request espressif/esp-idf!31802
2024-09-04 22:56:16 +08:00
snake-4
8a39db3fae fix(freertos): Made select function non-blocking on Linux target
The select function wrapper was rewritten to be non-blocking
on Linux systems, as it was stealing all the CPU time
from lower priority tasks when called from a higher priority task.
This is because the FreeRTOS scheduler does not know
that the task thread is sleeping during the system call.

This issue manifests all "slow" system calls on the Linux target,
but handling the case of select fixes the problems for most ESP-IDF components.

The FreeRTOS POSIX port documentation lists this as a known issue,
so user code is responsible handling this case if other system calls are used,
even if unknowingly.

This closes GH issue #14395 "select() blocks the FreeRTOS scheduler on Linux target"
2024-09-04 15:15:26 +02:00
shreeyash
215f95c110 fix(nimble): Make CCCD flags configurable 2024-09-04 17:53:21 +05:30
morris
e163941205 Merge branch 'refactor/use_gdma_link_list_in_parlio_tx' into 'master'
refactor(parlio_tx): use gdma link list driver to mount buffer

See merge request espressif/esp-idf!33254
2024-09-04 20:16:09 +08:00
Erhan Kurubas
1e3c3b8738 Merge branch 'feature/esp32c5_coredump' into 'master'
ESP32-C5 enable core dump tests

Closes IDF-8661

See merge request espressif/esp-idf!30151
2024-09-04 20:08:48 +08:00
Shen Weilong
25189b190f change(ble): update c2 eco4 ld file 2024-09-04 20:08:09 +08:00
wangtao@espressif.com
5d66e8f729 fix(wifi): fix esp32c2 eco4 build issue 2024-09-04 19:56:57 +08:00
Marek Fiala
ccf5989505 feat(tools): Exclude modified folders by rebuild 2024-09-04 12:48:15 +02:00
Marek Fiala
f0ca91b103 feat(tools): Update tools: cmake, ninja, ccache
cmake  v3.24.0 -> v3.30.2
ninja  v1.11.1 -> v1.12.1
ccache v4.8    -> v4.10.2

Closes https://github.com/espressif/esp-idf/pull/14376
2024-09-04 12:48:14 +02:00
Aditya Patwardhan
1337828a0b Merge branch 'bugfix/security_guide_redirect_link' into 'master'
docs(security): add redirect link for host based workflow guide

See merge request espressif/esp-idf!33271
2024-09-04 18:30:50 +08:00
Shu Chen
f1008faa1a Merge branch 'feat/update_component_for_ot_examples' into 'master'
feat(openthread): update extension commands component for examples

See merge request espressif/esp-idf!33243
2024-09-04 17:59:54 +08:00
Jiang Jiang Jian
e963bff523 Merge branch 'bugfix/wps_pbc_overlap' into 'master'
fix(wpa_supplicant): Fix for WPS-PBC overlap detection in dual band

Closes WIFIBUG-680

See merge request espressif/esp-idf!32690
2024-09-04 17:42:45 +08:00
Shen Meng Jing
5ec3bebf00 Merge branch 'docs/translate_esp_timer' into 'master'
docs: Provide Chinese translation for esp_timer

Closes DOC-8234

See merge request espressif/esp-idf!31814
2024-09-04 16:50:37 +08:00
chenjianhua
83ea37bcfc feat(bt): Update esp32 bt-lib(bc393dd)
- Fixed BLE vendor HCI set scan perfer address command
- Support BLE vendor HCI get controller compile version command
- Support BLE scanning and initiating coexist
2024-09-04 16:45:26 +08:00
Wang Tao
e43ded7ed5 Merge branch 'feat/support_esp32c2_eco4' into 'master'
feat(wifi):support esp32c2 chip version 2.0 wifi

Closes WIFI-6637、IDF-10216、WIFI-6669

See merge request espressif/esp-idf!32511
2024-09-04 16:28:25 +08:00
Wang Meng Yang
89712154a8 Merge branch 'bugfix/fix_hid_cod_setting' into 'master'
Bugfix/fix hid cod setting

Closes IDFGH-12624 and IDFGH-13305

See merge request espressif/esp-idf!33219
2024-09-04 15:16:19 +08:00
xiongweichao
a55d8bf12b fix(bt/bluedroid): Fix the protocol stack to exit sniff mode
- Already in result mode but request change indication has not been cleared
2024-09-04 15:08:01 +08:00
chaijie@espressif.com
c9d4913393 fix(sleep): fix_wrong_sleep_param_for_lp_memory_retention 2024-09-04 15:02:15 +08:00
shenmengjing
26c8cae4dd docs: Provide Chinese translation for esp_timer 2024-09-04 14:51:36 +08:00
Nachiket Kukade
94a915fd5c fix(wifi): Add PSRAM failure fallback in WiFi Queue API's 2024-09-04 11:02:06 +05:30
Zhu Li Qun
b9c58c550c Merge branch 'bugfix/fix_s3c3_wrong_ext32k_config_bug' into 'master'
fix(ext_32k): fix the external 32K issue on C3&S3

See merge request espressif/esp-idf!33150
2024-09-04 11:30:55 +08:00
Marius Vikhammer
520fda61cd feat(system): remove references to RTC mem on C61 2024-09-04 11:16:36 +08:00
Adam Múdry
98cf50d140 Merge branch 'fix/nvs_tool_false_duplicate_warning' into 'master'
fix(nvs): nvs_tool.py refactor, reduce false duplicate warnings, add a test

Closes IDF-10684

See merge request espressif/esp-idf!32449
2024-09-04 11:05:44 +08:00
Armando (Dou Yiwen)
85bc5acfc7 Merge branch 'change/sdmmc_ll_layer' into 'master'
sdmmc: full ll layer

Closes IDF-10544 and IDF-10251

See merge request espressif/esp-idf!33156
2024-09-04 10:54:37 +08:00
Xu Si Yu
7f0a140f46 feat(openthread): update extension commands component for examples 2024-09-04 10:40:14 +08:00
Wan Lei
3606d9ebf7 Merge branch 'fix/soc_and_iomux_macro_refactor' into 'master'
fix(driver_spi): move spi related macros out from soc.h and iomux_reg.h

See merge request espressif/esp-idf!32953
2024-09-04 10:35:11 +08:00
wangtao@espressif.com
82a951447a feat(wifi): update esp32c2 eco4 wifi lib 2024-09-04 10:31:33 +08:00
Chen Jichang
35c6e44181 refactor(parlio_tx): use gdma link list driver to mount buffer 2024-09-04 10:20:01 +08:00
Alexey Gerenkov
625c437412 feat(ulp): Add LP core debugging support 2024-09-03 18:28:14 +03:00
Peter Marcisovsky
db6e37c975 ci(usb_device): Fix exception for ACM port in USB composite dev pytest 2024-09-03 17:05:34 +02:00
Peter Marcisovsky
67a8480aec ci(usb_device): Enable USB device tests in CI for esp32p4 2024-09-03 16:43:49 +02:00
Shen Meng Jing
6bfa408c7b Merge branch 'docs/update_ulp_lp_core_ulp_risc_v_cn' into 'master'
docs: Update the CN translation for ulp-lp-core.rst and ulp-risv-v.rst

See merge request espressif/esp-idf!32692
2024-09-03 21:50:59 +08:00
Shen Meng Jing
1611d1344f Merge branch 'docs/translate_style_guide' into 'master'
docs: Provide CN translation for style-guide

Closes DOC-8255

See merge request espressif/esp-idf!31886
2024-09-03 21:11:01 +08:00
Jiang Jiang Jian
2726023db4 Merge branch 'bugfix/support_c5mp_phy_sleep' into 'master'
fix(phy): update c5 libphy to support sleep, fix wifi coex scan no app issue, fix ble rx crc err

Closes WIFIBUG-682

See merge request espressif/esp-idf!33263
2024-09-03 19:37:59 +08:00
shenmengjing
5214656421 docs: Update the CN translation for ulp-lp-core.rst and ulp-risv-v.rst 2024-09-03 19:29:55 +08:00
shenmengjing
07c3be3398 docs: Provide CN translation for style-guide 2024-09-03 19:21:50 +08:00
Roman Leonov
6ee1c300c2 Merge branch 'refactor/usb_host_ext_port_prereq' into 'master'
refactor(ext_hub): Prerequisites for the Ext Port Driver

See merge request espressif/esp-idf!32213
2024-09-03 19:17:22 +08:00
Mahavir Jain
2b806c9772 Merge branch 'feature/update_security_docs_for_c61' into 'master'
feat: update security documents for ESP32C61

Closes IDF-10154, IDF-10155, IDF-10156, IDF-10157, and IDF-10158

See merge request espressif/esp-idf!31959
2024-09-03 19:11:09 +08:00
Gao Xu
c83bf0c3df Merge branch 'feature/support_isp_color' into 'master'
feat(isp): support color on P4

Closes IDF-10495

See merge request espressif/esp-idf!32901
2024-09-03 18:42:26 +08:00
Aleksei Apaseev
4f399061e7 Merge branch 'ci/print_retry_job_message_optionally' into 'master'
ci: add condition to print retry job message in dynamic pipeline report if any job has failed

See merge request espressif/esp-idf!33211
2024-09-03 18:35:22 +08:00
Fu Hanxi
5df76105d6 Merge branch 'ci/fix_test_freertos_markers' into 'master'
ci: fix test_freertos markers

Closes IDFCI-2358

See merge request espressif/esp-idf!33273
2024-09-03 18:20:49 +08:00
Armando
fce2680e91 feat(psram): xip psram c61 2024-09-03 18:17:03 +08:00
Armando
8842e5764f feat(psram): xip psram c5 2024-09-03 18:17:03 +08:00
Zhang Xiao Yan
c8de3754df Merge branch 'docs/add_application_examples_bluetooth' into 'master'
docs: update application examples for bluedroid and blufi

See merge request espressif/esp-idf!32185
2024-09-03 18:07:05 +08:00
wangtao@espressif.com
f82c7ee4d1 fix(rom):fix esp32c2 eco4 ld comments 2024-09-03 17:50:40 +08:00
wangtao@espressif.com
ef1c62b67d fix(wifi): fix esp32c2 eco4 ld 2024-09-03 17:50:40 +08:00
wangtao@espressif.com
fef76de1ce feat(wifi): support esp32c2 eco4 wifi bringup 2024-09-03 17:50:39 +08:00
Jiang Guang Ming
53272f7d11 feat(esp_rom): Add esp32c2.rom.eco4.ld 2024-09-03 17:50:39 +08:00
Jiang Guang Ming
7d2752dacd feat(esp_hw_support): Support esp32c2 rev2.0 chip 2024-09-03 17:50:39 +08:00
Armando
a1da4f8a01 feat(sdmmc): sdmmc full ll layer 2024-09-03 17:03:42 +08:00
Linda
1650681d64 docs: update application examples for bluedroid and blufi 2024-09-03 16:11:33 +08:00
aditi
e145e04fca fix(wpa_supplicant): Fix for WPS-PBC overlap detection in dual band
When WPS is running on dual band(e.g. a separate 2.4 GHz and 5 GHz band
    radios in an AP device), detect pbc overlap only if UUID differs.
2024-09-03 13:07:36 +05:30
Fu Hanxi
3c30341cfd
ci: fix test_freertos markers 2024-09-03 09:34:09 +02:00
C.S.M
0878ff90d6 test(esp_flash): Enable test for spi_flash component for c61/c5 2024-09-03 15:22:45 +08:00
Mahavir Jain
6a29e01a9e
docs(security): add redirect link for host based workflow guide 2024-09-03 12:36:26 +05:30
gaoxu
7b71d7aaac feat(isp_color): support ISP color on P4 2024-09-03 14:52:46 +08:00
Aleksei Apaseev
5a88c4d1ab ci: add condition to print retry job message in dynamic pipeline report if any job has failed
- Updated `generate_jobs_report` function to check if any job in the list has `is_failed = True`.
- Improved code readability and maintainability by reducing complexity in the `post_report` method.
2024-09-03 14:51:13 +08:00
C.S.M
ec3029ebb3 Merge branch 'test/p4_lp_i2c' into 'master'
feature(i2c): Support esp32p4 lp i2c instance

Closes IDF-7490

See merge request espressif/esp-idf!33249
2024-09-03 14:47:54 +08:00
Mahavir Jain
5be4aca831 Merge branch 'feature/update_security_docs_for_c5' into 'master'
feat: updated security docs for ESP32C5

Closes IDF-9476, IDF-9501, and IDF-9499

See merge request espressif/esp-idf!32928
2024-09-03 14:22:25 +08:00
Mahavir Jain
60890e9093 Merge branch 'ci/enable_mbedtls_psram_tests_for_p4_c5' into 'master'
Enable mbedtls' PSRAM-related tests for ESP32-P4 and ESP32-C5

See merge request espressif/esp-idf!33228
2024-09-03 14:21:01 +08:00
Tomas Rezucha
19d488370f Merge branch 'feat/usb_ls_p4' into 'master'
Fix USB Low-Speed devices on ESP32-P4

Closes IDF-9565

See merge request espressif/esp-idf!33201
2024-09-03 13:59:59 +08:00
wanckl
19c6e77a31 fix(mspi): collect mspi iomux pin macro from iomux_reg.h to spi_pins.h 2024-09-03 13:55:00 +08:00
wanckl
473f39c31f fix(driver_spi): move macro GPIO_MATRIX_DELAY_NS out from soc.h 2024-09-03 13:55:00 +08:00
Rahul Tank
259b7009e9 Merge branch 'bugfix/correct_per_adv_sync_enable' into 'master'
fix(nimble): Corrected parameters assignment in per_adv_transfer_enable

Closes BLERP-891

See merge request espressif/esp-idf!32317
2024-09-03 13:47:53 +08:00
Wan Lei
ae5c7d46d1 Merge branch 'ci/enable_c61_target_test' into 'master'
ci(esp32c61): enable c61 generic target test

Closes IDF-9285 and IDF-9288

See merge request espressif/esp-idf!33088
2024-09-03 11:53:02 +08:00
C.S.M
f3eec83421 test(i2c): Support test for esp32p4 lp i2c 2024-09-03 11:23:02 +08:00
liuning
0833cc9bcb fix(phy): update c5 libphy to support sleep, fix wifi coex scan no app issue, fix ble rx crc err
phy_version: 102, 91c24e2, Sep  2 2024
2024-09-03 09:53:03 +08:00
Peter Marcisovsky
f7b31defc9 refactor(usb_host): Fixed function return values in usb_host stack:
- updated doxygen for the whole usb_host stack
    - doxygen for test_apps is not updated
    - fixed error codes propagation problems in the usb_host stack
2024-09-02 16:41:38 +02:00
Song Ruo Jing
b6916ca304 Merge branch 'bugfix/custom_console_uart_pins_c5_c61' into 'master'
fix(uart): make custom console uart TX/RX pins same to the default console uart pins

See merge request espressif/esp-idf!33110
2024-09-02 21:26:56 +08:00
Peter Marcisovsky
81ad0eb544 Merge branch 'ci/add_advanced_usb_cdc_ci' into 'master'
Refactor(console): merge console advanced and advanced_usb_cdc examples

Closes IDF-9676 and DOC-8784

See merge request espressif/esp-idf!29626
2024-09-02 21:15:19 +08:00
Tomas Rezucha
ba16f50560 refactor(usb/host): Move P4 HS PHY function to correct LL file
Moved usb_wrap_ll_enable_precise_detection() in usb_wrap_ll.h
to usb_utmi_ll_enable_precise_detection() in usb_utmi_ll.h

Fixes commit 97d30e7c48
2024-09-02 14:39:28 +02:00
Tomas Rezucha
21c6c62087 fix(usb/host): Fix USB Low Speed devices connection on P4
P4 USB UTMI PHY was updated to specification v2.0
2024-09-02 14:39:22 +02:00
Roman Leonov
a971ddf17a refactor(ext_hub): Added port creation and freeing, cleaned up members 2024-09-02 14:25:21 +02:00
chenjianhua
832e728ac3 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(8ce789b)
- Fixed BLE vendor HCI set scan perfer address command
- Support BLE vendor HCI get controller compile version command
- Fixed BLE util buffer free after controller reset
- Fixed assert when connection already exist and be connected again
2024-09-02 20:08:31 +08:00
zlq
f567341168 fix(ext_32k): fix the external 32K issue on C3&S3 2024-09-02 19:33:30 +08:00
wanckl
4e095f4b9f ci(esp32c61): enable c61 generic target test 2024-09-02 19:26:12 +08:00
morris
a82b8565b7 Merge branch 'feat/add_ek79007_mipi_dsi' into 'master'
feat(lcd): adapt the mipi_dsi example for the EK79007 LCD IC

See merge request espressif/esp-idf!32499
2024-09-02 17:42:42 +08:00
Mahavir Jain
cd8009dc5b Merge branch 'fix/flash_encryption_for_esp32p4' into 'master'
fix(security): Fixed flash encryption for esp32p4

See merge request espressif/esp-idf!33018
2024-09-02 17:28:39 +08:00
Ondrej Kosta
b9f4822dcb Merge branch 'bugfix/eth_plus_wifi_doc' into 'master'
docs(esp_eth): added warning to not use ESP32 as ETH CLK source with WiFi

Closes DOC-8459

See merge request espressif/esp-idf!32736
2024-09-02 16:15:28 +08:00
Zhang Xiao Yan
360bbd62b8 Merge branch 'docs/update_application_examples_esp_nan_wifi_security' into 'master'
docs: update application examples for esp_nan.rst, esp_dpp.rst and wifi-security.rst

See merge request espressif/esp-idf!32209
2024-09-02 16:00:20 +08:00
Kevin (Lao Kaiyao)
9a5a94e75d Merge branch 'bugfix/fix_some_minor_issue_in_i2s_and_isp' into 'master'
fix: fix minor issues in isp and i2s

See merge request espressif/esp-idf!33224
2024-09-02 15:29:34 +08:00
morris
fe09637123 feat(lcd): support EK79007 LCD in the mipi dsi example 2024-09-02 15:24:53 +08:00
Song Ruo Jing
e1f27d04ed fix(uart): enable ci target test for uart for c5 2024-09-02 15:24:29 +08:00
Song Ruo Jing
8e53e91ec9 fix(uart): make custom console uart pins same to the default console uart pins 2024-09-02 15:24:29 +08:00
Peter Marcisovsky
82a4c12817 refactor(console/advanced): Merge console advanced and advanced_usb_cdc examples
- removed examples/system/console/advanced_usb_cdc
    - refactor resulting console/advanced example
    - enabled advanced console for all peripherals (UART, USB_OTG, USB_JTAG)
    - added pytest to check UART console output
    - update docs
2024-09-02 09:14:42 +02:00
Linda
58f18216ed docs: add application examples for phy.rst 2024-09-02 14:49:31 +08:00
Sudeep Mohanty
d3631b3afa Merge branch 'fix/adc_channel_num_caps' into 'master'
fix(adc): Corrected the ADC channel number caps for esp32p4

See merge request espressif/esp-idf!33141
2024-09-02 14:37:17 +08:00
nilesh.kale
3550e36a68 feat: updated security docs for ESP32C5
This commit modified document files for ESP32C5.
This revised chnages for security components, RNG, provisioning and
some minor changes in sample output for flash encryption example.
2024-09-02 11:50:07 +05:30
laokaiyao
7ac567df96 fix: fix minor issues in isp and i2s 2024-09-02 14:07:05 +08:00
Mahavir Jain
02da65314b Merge branch 'feat/adding_test_case_anti_rollback_and_flash_encryption' into 'master'
feat(ota): Added test for checking flash encryption and anti-rollback enabled

Closes IDF-9200

See merge request espressif/esp-idf!32951
2024-09-02 14:04:45 +08:00
Zhang Shu Xian
ff3e93af28 Merge branch 'docs/update_application_examples_of_uart' into 'master'
docs: Update the application examples in uart.rst

See merge request espressif/esp-idf!32653
2024-09-02 14:03:26 +08:00
Zhang Xiao Yan
8c8e9ae546 Merge branch 'docs/update_aplication_wifi' into 'master'
docs: update application examples for wifi.rst

See merge request espressif/esp-idf!32214
2024-09-02 14:02:51 +08:00
Aditya Patwardhan
d1c47835a2 fix(security): Fixed flash encryption for esp32p4
The flash encryption on esp32p4 was broken due to some code related
    to key manager not being executed when key manager support was
    disabled on esp32p4 target.
    This commit fixes that behaviour
    Additionally, the atomic env enablement for
    key_mgr_ll_enable_peripheral_clock was fixed.
2024-09-02 14:00:55 +08:00
nilesh.kale
1011cee7a7 feat: udpate security docs for c61 and c5
This commit update security documents for ESP32C61.
2024-09-02 11:04:38 +05:30
Island
53b7d63ba5 Merge branch 'fix/fix_length_ble_get_started_example' into 'master'
fix(ble): Increased the length of addr_str in ble_get_started nimble examples

Closes BLERP-979

See merge request espressif/esp-idf!33203
2024-09-02 12:13:39 +08:00
Xu Xiao
a3274e502e Merge branch 'chip/esp32c61_mp_support_wifi' into 'master'
esp32c61 mp support wifi

See merge request espressif/esp-idf!32960
2024-09-02 12:06:53 +08:00
Marius Vikhammer
7cf872e610 Merge branch 'bugfix/eh_frame_backtrace' into 'master'
fix(system): fixed eh-frame backtrace issue from WDT

See merge request espressif/esp-idf!33112
2024-09-02 11:48:58 +08:00
Omar Chebib
c68c404cdc Merge branch 'fix/xtensa_nmi' into 'master'
fix(esp_hw_support): make the NMI interrupts available for the main application

Closes IDF-1891 and IDFGH-12631

See merge request espressif/esp-idf!32767
2024-09-02 11:18:32 +08:00
Wan Lei
8410392567 Merge branch 'change/c61_twai_removal' into 'master'
change(twai): removal c61 twai due to not exist

Closes IDF-9336

See merge request espressif/esp-idf!33202
2024-09-02 10:40:18 +08:00
Linda
74ec959b38 docs: update application examples for wifi.rst 2024-09-02 10:36:11 +08:00
Island
9c25d54cb8 Merge branch 'bugfix/fixed_assert_on_esp32c2' into 'master'
fix(ble): fixed crash issue during deinit host after deinit controller on ESP32-C2

See merge request espressif/esp-idf!33204
2024-09-02 10:08:10 +08:00
Zhang Shuxian
a79159f5e1 docs: Update the application examples in uart.rst 2024-09-02 09:49:38 +08:00
Linda
09b53af171 docs: update application examples for esp_nan.rst, esp_dpp.rst and wifi-security.rst 2024-08-31 09:57:21 +08:00
Adam Múdry
05b356f87f feat(nvs): Test nvs_partition_gen.py and nvs_check.py with pytest
Little fixes in nvs_check.py
2024-08-30 16:21:42 +02:00
xuxiao
7c9109d9e1 fix(wifi): fix code comments 2024-08-30 21:02:02 +08:00
xuxiao
506bff240b feat(wifi): add SPIRAM wifi support for esp32c5 and esp32c61 2024-08-30 20:43:06 +08:00
liuning
418c856db0 feat(coex): support esp32c61 coex support 2024-08-30 20:43:06 +08:00
xuxiao
8780375859 feat(wifi): add wifi support for esp32c61 2024-08-30 20:43:06 +08:00
harshal.patil
945ad6ea5d
ci(mbedtls): Enable PSRAM-related tests for ESP32-P4 and ESP32-C5 2024-08-30 17:19:12 +05:30
Erhan Kurubas
23bc6eac43 test(coredump): enable esp32c5 coredump tests 2024-08-30 13:17:44 +03:00
Erhan Kurubas
e9f4fa08d6 docs(coredump): update esp32c5 docs_not_updated 2024-08-30 13:17:44 +03:00
Andste82
681b372668 fix(spinlock): comparison of integer expressions of different signedness 2024-08-30 11:28:16 +02:00
hrushikesh.bhosale
99f0e1b526 feat(ota): Added test for checking flash encryption and anti-rollback enabled
Added test to check if flash encryption and anti-rollback enbaled
together. Added marked pytest.mark.flash_encryption to advanced OTA
test.
2024-08-30 14:11:33 +05:30
liqigan
976066d537 fix(esp_hid): Fixed protocol mode mapping bug
Closes https://github.com/espressif/esp-idf/issues/14232
2024-08-30 15:37:14 +08:00
liqigan
53bb819e88 feat(bt/bluedroid): Added definition of minor class of COD for peripheral major class
Closes https://github.com/espressif/esp-idf/issues/13622
2024-08-30 15:37:17 +08:00
zwl
951d6e44eb fix(ble): fixed crash issue during deinit host after deinit controller on ESP32-C2 2024-08-30 11:46:13 +08:00
Yuhan Wei
3a1c212b41 fix(ble): Increased the length of addr_str in README.md 2024-08-30 11:45:36 +08:00
Yuhan Wei
77c17de379 fix(ble): Increased the length of addr_str in ble_get_started nimble examples 2024-08-30 11:38:25 +08:00
wanckl
e9d4e99a2a change(twai): removal c61 twai due to not exist 2024-08-29 21:23:50 +08:00
shenmengjing
04168efcaf docs: Update the application examples in sdio_slave 2024-08-29 16:00:13 +08:00
Omar Chebib
928859307f fix(esp_hw_support): make the NMI interrupts available for the main application
Closes https://github.com/espressif/esp-idf/issues/13629

NMI interrupt level has been freed for all the Xtensa targets, making it possible
for the main application to use it. An example has been added to show how to
proceed.
2024-08-29 13:55:47 +08:00
Marius Vikhammer
7f5496de53 test(system): add more eh-frame tests 2024-08-28 10:01:18 +08:00
Sudeep Mohanty
c92dfc0f3f fix(adc): Corrected the ADC channel number caps for esp32p4
This commit fixes the incorrect soc_caps for the ADC channel numbers on
the esp32p4.
2024-08-27 16:08:56 +02:00
renpeiying
f49b072ac7 docs: Update zh_CN translation for MR32736 2024-08-27 20:01:23 +08:00
Ondrej Kosta
50704ffa70 docs(esp_eth): added warning to not use ESP32 as ETH CLK source with WiFi 2024-08-27 20:01:23 +08:00
Marius Vikhammer
da3b28c29d fix(system): fixed broken backtrace from wdt when using eh-frame 2024-08-27 16:56:17 +08:00
Rahul Tank
4d7489a8ff fix(nimble): Corrected parameters assignment in per_adv_transfer_enable 2024-08-26 16:54:20 +05:30
harshal.patil
3b97011e39
fix(esp_security/ds): Clean up DS trying to re-acquire MPI lock post common crypto lock layer 2024-08-23 17:53:55 +05:30
Ivan Grokhotkov
5e9ac5bdf7
test(build_system): print failed command and output when test fails 2024-08-22 13:59:43 +02:00
Adam Múdry
6cb2080076 fix(nvs): nvs_tool.py reduce false duplicate warnings 2024-08-21 19:06:27 +08:00
Adam Múdry
4e7d2ec241 refactor(nvs): nvs_tool.py integrity check refactor 2024-08-21 19:06:27 +08:00
1368 changed files with 33589 additions and 8320 deletions

View File

@ -1,4 +1,4 @@
[codespell]
skip = build,*.yuv,components/fatfs/src/*,alice.txt,*.rgb,components/wpa_supplicant/*,components/esp_wifi/*,*.pem
ignore-words-list = ser,dout,rsource,fram,inout,shs,ans,aci,unstall,unstalling,hart,wheight,wel,ot,fane,assertIn
ignore-words-list = ser,dout,rsource,fram,inout,shs,ans,aci,unstall,unstalling,hart,wheight,wel,ot,fane,assertIn,registr
write-changes = true

View File

@ -59,6 +59,7 @@
/CONTRIBUTING.md @esp-idf-codeowners/docs
/Kconfig @esp-idf-codeowners/build-config
/README*.md @esp-idf-codeowners/docs
/ROADMAP*.md @esp-idf-codeowners/docs
/SUPPORT_POLICY*.md @esp-idf-codeowners/docs
/add_path.sh @esp-idf-codeowners/tools
/conftest.py @esp-idf-codeowners/ci

View File

@ -156,11 +156,12 @@ build_clang_test_apps_esp32s3:
extends:
- .build_cmake_clang_template
variables:
# For RISCV clang generates '.linker-options' sections of type 'llvm_linker_options' in asm files.
# See (https://llvm.org/docs/Extensions.html#linker-options-section-linker-options).
# Binutils gas ignores them with warning.
# TODO: LLVM-333, Use integrated assembler.
TEST_BUILD_OPTS_EXTRA: "--ignore-warning-str 'Warning: unrecognized section type'"
# https://reviews.llvm.org/D90108.
# GNU 'as' lets .weak override .globl since binutils-gdb
# https://github.com/bminor/binutils-gdb/commit/5ca547dc2399a0a5d9f20626d4bf5547c3ccfddd (1996)
# while MC lets the last directive win (PR38921).
# For RISCV chips we use integrated assembler by default, so suppress this warning to pass CI pipeline.
TEST_BUILD_OPTS_EXTRA: "--ignore-warning-str 'changed binding to STB_WEAK'"
build_clang_test_apps_esp32c3:
extends:

View File

@ -147,16 +147,16 @@ variables:
# install latest python packages
# target test jobs
if [[ "${CI_JOB_STAGE}" == "target_test" ]]; then
run_cmd bash install.sh --enable-ci --enable-pytest
run_cmd bash install.sh --enable-ci --enable-pytest --enable-test-specific
elif [[ "${CI_JOB_STAGE}" == "build_doc" ]]; then
run_cmd bash install.sh --enable-ci --enable-docs
elif [[ "${CI_JOB_STAGE}" == "build" ]]; then
run_cmd bash install.sh --enable-ci --enable-pytest
run_cmd bash install.sh --enable-ci
else
if ! echo "${CI_JOB_NAME}" | egrep ".*pytest.*"; then
run_cmd bash install.sh --enable-ci
else
run_cmd bash install.sh --enable-ci --enable-pytest
run_cmd bash install.sh --enable-ci --enable-pytest --enable-test-specific
fi
fi
@ -223,6 +223,8 @@ variables:
- *common-before_scripts
# On macOS, these tools need to be installed
- export IDF_TOOLS_PATH="${HOME}/.espressif_runner_${CI_RUNNER_ID}_${CI_CONCURRENT_ID}"
# remove idf-env.json, since it may contains enabled "features"
- rm -f $IDF_TOOLS_PATH/idf-env.json
- $IDF_PATH/tools/idf_tools.py --non-interactive install cmake ninja
# This adds tools (compilers) and the version-specific Python environment to PATH
- *setup_tools_and_idf_python_venv

View File

@ -11,7 +11,7 @@ extra_default_build_targets:
- esp32c61
bypass_check_test_targets:
- esp32c61
#
# These lines would
# - enable the README.md check for esp32c6. Don't forget to add the build jobs in .gitlab/ci/build.yml

View File

@ -388,3 +388,17 @@ test_idf_build_apps_load_soc_caps:
extends: .host_test_template
script:
- python tools/ci/check_soc_headers_load_in_idf_build_apps.py
test_nvs_gen_check:
extends: .host_test_template
artifacts:
paths:
- XUNIT_RESULT.xml
- components/nvs_flash/nvs_partition_tool
reports:
junit: XUNIT_RESULT.xml
variables:
LC_ALL: C.UTF-8
script:
- cd ${IDF_PATH}/components/nvs_flash/nvs_partition_tool
- pytest --noconftest test_nvs_gen_check.py --junitxml=XUNIT_RESULT.xml

View File

@ -83,6 +83,8 @@
- "tools/idf_monitor.py"
- "tools/activate.py"
- "tools/idf.py"
- "tools/idf_py_actions/**/*"
- "tools/test_idf_py/**/*"
@ -96,6 +98,11 @@
- "tools/test_idf_tools/**/*"
- "tools/install_util.py"
- "tools/export_utils/utils.py"
- "tools/export_utils/shell_types.py"
- "tools/export_utils/console_output.py"
- "tools/export_utils/activate_venv.py"
- "tools/requirements/*"
- "tools/requirements.json"
- "tools/requirements_schema.json"

View File

@ -175,6 +175,10 @@ if(CONFIG_COMPILER_DISABLE_GCC13_WARNINGS)
"-Wno-dangling-reference")
endif()
if(CONFIG_COMPILER_DISABLE_GCC14_WARNINGS)
list(APPEND compile_options "-Wno-calloc-transposed-args")
endif()
if(CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS)
if(NOT CMAKE_C_COMPILER_ID MATCHES "Clang")
idf_build_replace_option_from_property(COMPILE_OPTIONS "-Werror" "-Werror=all")

View File

@ -587,6 +587,13 @@ mainmenu "Espressif IoT Development Framework Configuration"
Enable this option if use GCC 13 or newer, and want to disable warnings which don't appear with
GCC 12.
config COMPILER_DISABLE_GCC14_WARNINGS
bool "Disable new warnings introduced in GCC 14"
default "n"
help
Enable this option if use GCC 14 or newer, and want to disable warnings which don't appear with
GCC 13.
config COMPILER_DUMP_RTL_FILES
bool "Dump RTL files during compilation"
help
@ -669,6 +676,5 @@ mainmenu "Espressif IoT Development Framework Configuration"
- CONFIG_ESPTOOLPY_FLASHFREQ_120M && CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_DTR
- CONFIG_SPIRAM_SPEED_120M && CONFIG_SPIRAM_MODE_OCT
- CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH
- CONFIG_MBEDTLS_USE_CRYPTO_ROM_IMPL
- CONFIG_ESP_WIFI_EAP_TLS1_3
- CONFIG_ESP_WIFI_ENABLE_ROAMING_APP

123
ROADMAP.md Normal file
View File

@ -0,0 +1,123 @@
# ESP-IDF Project Roadmap2024
This document outlines the goals of ESP-IDF project and is shared for the convenience of our customers. It is important to clarify that this document is not a binding commitment to our customers. Instead, its primary purpose is to offer a clear roadmap and direction for the project's development. By openly sharing this information, we aim to enhance our customers' understanding, promote transparency and ensure alignment with the overarching objectives of the ESP-IDF project.
## Project Overview
### Project Goals
In both minor and major releases, we integrate new chip support to enhance our product range. By expanding the chip matrix, we broaden the scope of our offerings, catering to a wider audience with diverse needs. This proactive approach ensures that our products remain at the forefront of technological advancements, consistently meeting and exceeding customer expectations.
Furthermore, we prioritize bugfix releases for active branches, focusing on improving the stability and performance of products already in production. By addressing bugs promptly, we aim to enhance the overall user experience and provide tangible benefits to customers relying on our solutions. This proactive maintenance strategy reflects our commitment to delivering reliable, high-quality products to our valued customer base.
Below are the main objectives that ESP-IDF project/teams would like to implement in 2024.
- New Chip Support
- Add support for ESP32-P4
- Add support for ESP32-C5
- Add support for ESP32-C61
- More Minor Releases
- Release IDF v5.3 in 2024
- Release IDF v5.4 at the start of 2025
- More Bugfix Releases
- Release v4.4.8 for IDF v4.4 before ESP-IDF v4.4 goes End of Life in July 2024
- Do more bugfix releases for IDF v5.1 before release/5.1 enters maintenance period in June 2024
- Do more bug fixes releases for release/5.2 and release/5.3, and push the two releases to be more stable and production-ready
- Updates of Libraries
- Update GDB to 14.2
- Update LLVM to 18.1.2
- Update MbedTLS to 3.6 (LTS)
- Update LWIP to 2.2.0
- Change minimal Python requirement to 3.9
Please note that support status of previous silicones could be found on [ESP-IDF Release and SoC Compatibility](https://github.com/espressif/esp-idf#esp-idf-release-and-soc-compatibility).
### Roadmap Details
The ESP-IDF project prioritizes consistent maintenance and updates to ensure our customers remain at the forefront of technological advancements. Our commitment to ongoing development ensures that customers continuously benefit from the latest innovations in the field.
Moreover, we are dedicated to empowering our customers to leverage newly implemented features and enhanced functionalities through iterative improvements. Our steadfast commitment to pushing boundaries ensures that clients not only keep pace with evolving technology but also extract optimal value from the cutting-edge capabilities of our products.
Below are the main roadmap details for functional areas inside ESP-IDF.
- New Chip Support
- Add full support for ESP32-P4 in ESP-IDF v5.3, refer to [ESP32-P4 Support Status](https://github.com/espressif/esp-idf/issues/12996)
- Add preview support for ESP32-C5 in ESP-IDF v5.3 and full support for ESP32-C5 in ESP-IDF v5.4, refer to [ESP32-C5 Support Status](https://github.com/espressif/esp-idf/issues/14021)
- Add preview support for the early samples of ESP32-C61 in ESP-IDF v5.4 and full support for mass production version in ESP-IDF v5.4.x. Refer to [ESP32-C61 Support Status](https://developer.espressif.com/pages/chip-support-status/esp32c61/#esp-idf)
- Bugfix releases
- Do bugfix release IDF v4.4.8 and stop maintaining ESP-IDF v4.4 in July 2024
- Release bugfix IDF v5.0.6 and IDF v5.0.7 in 2024 (maintenance period)
- Release bugfix IDF v5.1.3 and IDF v5.1.4 in H1 of 2024, and release IDF v5.1.5 in H2 of 2024
- Push release/5.1 to maintenance period from June 2024
- Do more bug fixes releases for release/5.2 (IDF v5.2.1, IDF v5.2.2, IDF v5.2.3) and release/5.3 (IDF v5.3.1, IDF v5.3.2), and push releases to be more stable and more production-ready
## ESP-IDF Planning information
For the full list of ESP-IDF releases, please visit https://github.com/espressif/esp-idf/releases
### ESP-IDF Major Releases
No Major Releases planned
### ESP-IDF Minor Releases
#### Quarter One
- v5.2-RC1, estimate release date: 2024/02/02
- v5.2 final release, estimate release date: 2024/02/08
#### Quarter Two
- v5.3-beta1, estimate release date:: 2024/05/13
- v5.3-beta2, estimate release date:: 2024/05/31
- v5.3-RC1, estimate release date:: 2024/07/08
#### Quarter Three
- v5.3-RC2, estimate release date:: 2024/07/26
- v5.3 final release, estimate release date:: 2024/08/02
#### Quarter Four
- v5.4-beta1, estimate release date:: 2024/11/08
- v5.4-beta2, estimate release date:: 2024/11/29
- v5.4-RC1, estimate release date:: 2025/01/09
- v5.4-RC2, estimate release date:: 2025/01/29
- v5.4 final release, estimate release date: 2025/02/05
### ESP-IDF Bugfix Releases
#### Quarter One
- v5.1.3, estimate release date: 2024/02/08
- v5.0.6, estimate release date: 2024/02/18
- v4.4.7, estimate release date:: 2024/03/19
- v5.2.1, estimate release date:: 2024/03/31
#### Quarter Two
- v5.1.4, estimate release date:: 2024/05/06
- v5.2.2, estimate release date:: 2024/06/17
- v4.4.8, estimate release date:: 2024/07/19
#### Quarter Three
- v5.0.7, estimate release date: 2024/08/22
- v5.3.1, estimate release date: 2024/09/16
- v5.2.3, estimate release date: 2024/10/10
#### Quarter Four
- v5.1.5, estimate release date: 2024/11/04 (Maintenance period since June 2024)
- v5.3.2, estimate release date: 2024/12/31
- v5.2.4, estimate release date: 2025/02/20 (Service period ends Feb. 2025)

View File

@ -26,8 +26,6 @@
#define ESP_APPTRACE_MAX_VPRINTF_ARGS 256
#define ESP_APPTRACE_HOST_BUF_SIZE 256
#define ESP_APPTRACE_PRINT_LOCK 0
const static char *TAG = "esp_apptrace";
/** tracing module internal data */
@ -90,7 +88,7 @@ void esp_apptrace_down_buffer_config(uint8_t *buf, uint32_t size)
return;
}
// currently down buffer is supported for JTAG interface only
// TODO: one more argument should be added to this function to specify HW inteface: JTAG, UART0 etc
// TODO: one more argument should be added to this function to specify HW interface: JTAG, UART0 etc
ch = &s_trace_channels[ESP_APPTRACE_DEST_JTAG];
if (ch->hw != NULL) {
if (ch->hw->down_buffer_config != NULL) {

View File

@ -9,12 +9,14 @@
#include "esp_app_trace_util.h"
#include "sdkconfig.h"
#define ESP_APPTRACE_PRINT_LOCK 0
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////// Locks /////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#if ESP_APPTRACE_PRINT_LOCK
static esp_apptrace_lock_t s_log_lock = {.irq_stat = 0, .portmux = portMUX_INITIALIZER_UNLOCKED};
static esp_apptrace_lock_t s_log_lock = { .mux = portMUX_INITIALIZER_UNLOCKED };
#endif
int esp_apptrace_log_lock(void)
@ -31,7 +33,7 @@ int esp_apptrace_log_lock(void)
void esp_apptrace_log_unlock(void)
{
#if ESP_APPTRACE_PRINT_LOCK
#if ESP_APPTRACE_PRINT_LOCK
esp_apptrace_lock_give(&s_log_lock);
#endif
}
@ -87,7 +89,7 @@ esp_err_t esp_apptrace_lock_give(esp_apptrace_lock_t *lock)
uint8_t *esp_apptrace_rb_produce(esp_apptrace_rb_t *rb, uint32_t size)
{
uint8_t *ptr = rb->data + rb->wr;
// check for avalable space
// check for available space
if (rb->rd <= rb->wr) {
// |?R......W??|
if (rb->wr + size >= rb->size) {

View File

@ -0,0 +1,6 @@
name: 'SystemView'
version: '3.42'
cpe: cpe:2.3:a:segger:systemview:{}:*:*:*:*:*:*:*
supplier: 'Organization: Espressif Systems (Shanghai) CO LTD'
originator: 'Organization: SEGGER Microcontroller GmbH'
description: Real-time recording and visualization tool for embedded systems.

View File

@ -157,7 +157,7 @@ esp_err_t esp_ota_begin(const esp_partition_t *partition, size_t image_size, esp
}
}
new_entry = (ota_ops_entry_t *) calloc(sizeof(ota_ops_entry_t), 1);
new_entry = (ota_ops_entry_t *) calloc(1, sizeof(ota_ops_entry_t));
if (new_entry == NULL) {
return ESP_ERR_NO_MEM;
}

View File

@ -1,7 +0,0 @@
# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps
components/app_update/test_apps:
disable:
- if: IDF_TARGET in ["esp32c61"]
temporary: true
reason: target esp32c61 is not supported yet # TODO: [ESP32C61] IDF-9245

View File

@ -1,2 +0,0 @@
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |

View File

@ -1,24 +0,0 @@
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import re
import pytest
from pytest_embedded import Dut
DEFAULT_TIMEOUT = 20
TEST_SUBMENU_PATTERN_PYTEST = re.compile(rb'\s+\((\d+)\)\s+"([^"]+)"\r?\n')
def run_multiple_stages(dut: Dut, test_case_num: int, stages: int) -> None:
for stage in range(1, stages + 1):
dut.write(str(test_case_num))
dut.expect(TEST_SUBMENU_PATTERN_PYTEST, timeout=DEFAULT_TIMEOUT)
dut.write(str(stage))
if stage != stages:
dut.expect_exact('Press ENTER to see the list of tests.')
@pytest.mark.supported_targets
@pytest.mark.generic
def test_app_update(dut: Dut) -> None:
dut.run_all_single_board_cases(timeout=90)

View File

@ -0,0 +1,12 @@
# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps
components/app_update/test_apps:
enable:
- if: CONFIG_NAME == "defaults" and IDF_TARGET != "linux"
- if: CONFIG_NAME == "xip_psram" and IDF_TARGET in ["esp32s2", "esp32s3", "esp32p4"]
# S2 doesn't have ROM for flash
- if: CONFIG_NAME == "xip_psram_with_rom_impl" and IDF_TARGET in ["esp32s3", "esp32p4"]
disable:
- if: IDF_TARGET in ["esp32c61"]
temporary: true
reason: target esp32c61 is not supported yet # TODO: [ESP32C61] IDF-9245

View File

@ -0,0 +1,2 @@
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- | -------- | -------- |

View File

@ -1,4 +1,4 @@
idf_component_register(SRC_DIRS "."
PRIV_INCLUDE_DIRS "."
PRIV_REQUIRES cmock test_utils app_update bootloader_support nvs_flash driver spi_flash
PRIV_REQUIRES cmock test_utils app_update bootloader_support nvs_flash driver spi_flash esp_psram
WHOLE_ARCHIVE)

View File

@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "esp_log.h"
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <freertos/semphr.h>
@ -113,3 +114,11 @@ TEST_CASE("esp_ota_get_partition_description", "[ota]")
};
TEST_ESP_ERR(ESP_ERR_NOT_FOUND, bootloader_common_get_partition_description(&not_app_pos, &app_desc1));
}
TEST_CASE("esp_ota_get_running_partition points to correct address", "[spi_flash]")
{
const esp_partition_t *factory = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_ANY, "factory");
const esp_partition_t* part = esp_ota_get_running_partition();
ESP_LOGI("running bin", "0x%p", (void*)part->address);
TEST_ASSERT_EQUAL_HEX32(factory->address, part->address);
}

View File

@ -0,0 +1,52 @@
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import re
import pytest
from pytest_embedded import Dut
DEFAULT_TIMEOUT = 20
TEST_SUBMENU_PATTERN_PYTEST = re.compile(rb'\s+\((\d+)\)\s+"([^"]+)"\r?\n')
@pytest.mark.supported_targets
@pytest.mark.temp_skip_ci(targets=['esp32c5'], reason='C5 has not supported deep sleep') # TODO: [ESP32C5] IDF-8640, IDF-10317
@pytest.mark.generic
@pytest.mark.parametrize(
'config',
[
'defaults',
],
indirect=True,
)
def test_app_update(dut: Dut) -> None:
dut.run_all_single_board_cases(timeout=90)
@pytest.mark.supported_targets
# TODO: [ESP32C61] IDF-9245, IDF-10983
@pytest.mark.temp_skip_ci(targets=['esp32c61'], reason='C61 has not supported deep sleep')
@pytest.mark.generic
@pytest.mark.parametrize(
'config',
[
'xip_psram',
],
indirect=True,
)
def test_app_update_xip_psram(dut: Dut) -> None:
dut.run_all_single_board_cases(timeout=90)
@pytest.mark.supported_targets
@pytest.mark.temp_skip_ci(targets=['esp32c5'], reason='C5 has not supported deep sleep') # TODO: [ESP32C5] IDF-8640, IDF-10317
@pytest.mark.generic
@pytest.mark.parametrize(
'config',
[
'xip_psram_with_rom_impl',
],
indirect=True,
)
def test_app_update_xip_psram_rom_impl(dut: Dut) -> None:
dut.run_all_single_board_cases(timeout=90)

View File

@ -0,0 +1,2 @@
# don't delete.
# used for CI to compile a default config when 'sdkconfig.ci.xxxx' is exist

View File

@ -0,0 +1,2 @@
CONFIG_SPIRAM=y
CONFIG_SPIRAM_XIP_FROM_PSRAM=y

View File

@ -0,0 +1,3 @@
CONFIG_SPIRAM=y
CONFIG_SPIRAM_XIP_FROM_PSRAM=y
CONFIG_SPI_FLASH_ROM_IMPL=y

View File

@ -158,13 +158,23 @@ menu "Bootloader config"
int "Number of the GPIO input for factory reset"
depends on BOOTLOADER_FACTORY_RESET
range 0 39 if IDF_TARGET_ESP32
range 0 44 if IDF_TARGET_ESP32S2
range 0 46 if IDF_TARGET_ESP32S2
range 0 48 if IDF_TARGET_ESP32S3
range 0 20 if IDF_TARGET_ESP32C2
range 0 21 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C61
range 0 28 if IDF_TARGET_ESP32C5
range 0 30 if IDF_TARGET_ESP32C6
range 0 27 if IDF_TARGET_ESP32H2
range 0 54 if IDF_TARGET_ESP32P4
default 4
help
The selected GPIO will be configured as an input with internal pull-up enabled (note that on some SoCs.
not all pins have an internal pull-up, consult the hardware datasheet for details.) To trigger a factory
The selected GPIO will be configured as an input with internal pull-up enabled. To trigger a factory
reset, this GPIO must be held high or low (as configured) on startup.
Note that on some SoCs not all pins have an internal pull-up and certain pins are already
used by ROM bootloader as bootstrapping. Refer to the technical reference manual for further
details on the selected SoC.
choice BOOTLOADER_FACTORY_RESET_PIN_LEVEL
bool "Factory reset GPIO level"
depends on BOOTLOADER_FACTORY_RESET
@ -210,14 +220,25 @@ menu "Bootloader config"
config BOOTLOADER_NUM_PIN_APP_TEST
int "Number of the GPIO input to boot TEST partition"
depends on BOOTLOADER_APP_TEST
range 0 39
range 0 39 if IDF_TARGET_ESP32
range 0 46 if IDF_TARGET_ESP32S2
range 0 48 if IDF_TARGET_ESP32S3
range 0 20 if IDF_TARGET_ESP32C2
range 0 21 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C61
range 0 28 if IDF_TARGET_ESP32C5
range 0 30 if IDF_TARGET_ESP32C6
range 0 27 if IDF_TARGET_ESP32H2
range 0 54 if IDF_TARGET_ESP32P4
default 18
help
The selected GPIO will be configured as an input with internal pull-up enabled.
To trigger a test app, this GPIO must be pulled low on reset.
After the GPIO input is deactivated and the device reboots, the old application will boot.
(factory or OTA[x]).
Note that GPIO34-39 do not have an internal pullup and an external one must be provided.
Note that on some SoCs not all pins have an internal pull-up and certain pins are already
used by ROM bootloader as bootstrapping. Refer to the technical reference manual for further
details on the selected SoC.
choice BOOTLOADER_APP_TEST_PIN_LEVEL
bool "App test GPIO level"

View File

@ -1,11 +1,12 @@
/*
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
#include <esp_err.h>
#include "soc/soc_caps.h"
#ifdef __cplusplus
extern "C" {
@ -27,6 +28,11 @@ esp_err_t bootloader_init_spi_flash(void);
void bootloader_flash_hardware_init(void);
#endif
/**
* @brief Initialise mspi core clock
*/
void bootloader_init_mspi_clock(void);
#ifdef __cplusplus
}
#endif

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2018-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -28,12 +28,12 @@
#include "bootloader_flash_priv.h"
#include "bootloader_init.h"
#define FLASH_CLK_IO SPI_CLK_GPIO_NUM
#define FLASH_CS_IO SPI_CS0_GPIO_NUM
#define FLASH_SPIQ_IO SPI_Q_GPIO_NUM
#define FLASH_SPID_IO SPI_D_GPIO_NUM
#define FLASH_SPIWP_IO SPI_WP_GPIO_NUM
#define FLASH_SPIHD_IO SPI_HD_GPIO_NUM
#define FLASH_CLK_IO MSPI_IOMUX_PIN_NUM_CLK
#define FLASH_CS_IO MSPI_IOMUX_PIN_NUM_CS0
#define FLASH_SPIQ_IO MSPI_IOMUX_PIN_NUM_MISO
#define FLASH_SPID_IO MSPI_IOMUX_PIN_NUM_MOSI
#define FLASH_SPIWP_IO MSPI_IOMUX_PIN_NUM_WP
#define FLASH_SPIHD_IO MSPI_IOMUX_PIN_NUM_HD
void bootloader_flash_update_id(void)
{
@ -98,15 +98,15 @@ void IRAM_ATTR bootloader_flash_gpio_config(const esp_image_header_t* pfhdr)
} else {
const uint32_t spiconfig = esp_rom_efuse_get_flash_gpio_info();
if (spiconfig == ESP_ROM_EFUSE_FLASH_DEFAULT_SPI) {
esp_rom_gpio_connect_out_signal(SPI_IOMUX_PIN_NUM_CS, SPICS0_OUT_IDX, 0, 0);
esp_rom_gpio_connect_out_signal(SPI_IOMUX_PIN_NUM_MISO, SPIQ_OUT_IDX, 0, 0);
esp_rom_gpio_connect_in_signal(SPI_IOMUX_PIN_NUM_MISO, SPIQ_IN_IDX, 0);
esp_rom_gpio_connect_out_signal(SPI_IOMUX_PIN_NUM_MOSI, SPID_OUT_IDX, 0, 0);
esp_rom_gpio_connect_in_signal(SPI_IOMUX_PIN_NUM_MOSI, SPID_IN_IDX, 0);
esp_rom_gpio_connect_out_signal(SPI_IOMUX_PIN_NUM_WP, SPIWP_OUT_IDX, 0, 0);
esp_rom_gpio_connect_in_signal(SPI_IOMUX_PIN_NUM_WP, SPIWP_IN_IDX, 0);
esp_rom_gpio_connect_out_signal(SPI_IOMUX_PIN_NUM_HD, SPIHD_OUT_IDX, 0, 0);
esp_rom_gpio_connect_in_signal(SPI_IOMUX_PIN_NUM_HD, SPIHD_IN_IDX, 0);
esp_rom_gpio_connect_out_signal(FLASH_CS_IO, SPICS0_OUT_IDX, 0, 0);
esp_rom_gpio_connect_out_signal(FLASH_SPIQ_IO, SPIQ_OUT_IDX, 0, 0);
esp_rom_gpio_connect_in_signal(FLASH_SPIQ_IO, SPIQ_IN_IDX, 0);
esp_rom_gpio_connect_out_signal(FLASH_SPID_IO, SPID_OUT_IDX, 0, 0);
esp_rom_gpio_connect_in_signal(FLASH_SPID_IO, SPID_IN_IDX, 0);
esp_rom_gpio_connect_out_signal(FLASH_SPIWP_IO, SPIWP_OUT_IDX, 0, 0);
esp_rom_gpio_connect_in_signal(FLASH_SPIWP_IO, SPIWP_IN_IDX, 0);
esp_rom_gpio_connect_out_signal(FLASH_SPIHD_IO, SPIHD_OUT_IDX, 0, 0);
esp_rom_gpio_connect_in_signal(FLASH_SPIHD_IO, SPIHD_IN_IDX, 0);
//select pin function gpio
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_DATA0_U, PIN_FUNC_GPIO);
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_DATA1_U, PIN_FUNC_GPIO);
@ -190,7 +190,7 @@ int bootloader_flash_get_wp_pin(void)
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOV302:
return ESP32_PICO_V3_GPIO;
default:
return SPI_WP_GPIO_NUM;
return MSPI_IOMUX_PIN_NUM_WP;
}
#endif
}

View File

@ -88,12 +88,12 @@ void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
// IDF-4066
const uint32_t spiconfig = 0;
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
if (spiconfig == 0) {
}

View File

@ -92,12 +92,12 @@ void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
const uint32_t spiconfig = esp_rom_efuse_get_flash_gpio_info();
uint8_t wp_pin = esp_rom_efuse_get_flash_wp_gpio();
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
if (spiconfig == 0) {
} else {

View File

@ -48,8 +48,18 @@ void IRAM_ATTR bootloader_flash_cs_timing_config()
SET_PERI_REG_BITS(SPI_MEM_CTRL2_REG(0), SPI_MEM_CS_SETUP_TIME_V, 0, SPI_MEM_CS_SETUP_TIME_S);
}
void IRAM_ATTR bootloader_init_mspi_clock(void)
{
// Set source mspi pll clock as 80M in bootloader stage.
// SPLL clock on C5 is 480MHz , and mspi_pll needs 80MHz
// in this stage, set divider as 6
mspi_ll_clock_src_sel(MSPI_CLK_SRC_SPLL);
mspi_ll_fast_set_hs_divider(6);
}
void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)
{
bootloader_init_mspi_clock();
uint32_t spi_clk_div = 0;
switch (pfhdr->spi_speed) {
case ESP_IMAGE_SPI_SPEED_DIV_1:
@ -74,12 +84,12 @@ static const char *TAG = "boot.esp32c5";
void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
esp_rom_gpio_pad_set_drv(clk_gpio_num, drv);
esp_rom_gpio_pad_set_drv(q_gpio_num, drv);
esp_rom_gpio_pad_set_drv(d_gpio_num, drv);
@ -204,11 +214,7 @@ static void bootloader_spi_flash_resume(void)
esp_err_t bootloader_init_spi_flash(void)
{
// Set source mspi pll clock as 80M in bootloader stage.
// SPLL clock on C5 is 480MHz , and mspi_pll needs 80MHz
// in this stage, set divider as 6
mspi_ll_clock_src_sel(MSPI_CLK_SRC_SPLL);
mspi_ll_fast_set_hs_divider(6);
bootloader_init_mspi_clock();
bootloader_init_flash_configure();
bootloader_spi_flash_resume();

View File

@ -69,12 +69,12 @@ static const char *TAG = "boot.esp32c6";
void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
esp_rom_gpio_pad_set_drv(clk_gpio_num, drv);
esp_rom_gpio_pad_set_drv(q_gpio_num, drv);
esp_rom_gpio_pad_set_drv(d_gpio_num, drv);

View File

@ -46,8 +46,19 @@ void IRAM_ATTR bootloader_flash_cs_timing_config()
SET_PERI_REG_BITS(SPI_MEM_CTRL2_REG(0), SPI_MEM_CS_SETUP_TIME_V, 0, SPI_MEM_CS_SETUP_TIME_S);
}
void IRAM_ATTR bootloader_init_mspi_clock(void)
{
// Set source mspi pll clock as 80M in bootloader stage.
// SPLL clock on C61 is 480MHz , and mspi_pll needs 80MHz
// in this stage, set divider as 6
mspi_ll_clock_src_sel(MSPI_CLK_SRC_SPLL);
mspi_ll_fast_set_hs_divider(6);
}
void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)
{
bootloader_init_mspi_clock();
uint32_t spi_clk_div = 0;
switch (pfhdr->spi_speed) {
case ESP_IMAGE_SPI_SPEED_DIV_1:
@ -70,12 +81,12 @@ void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)
void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
esp_rom_gpio_pad_set_drv(clk_gpio_num, drv);
esp_rom_gpio_pad_set_drv(q_gpio_num, drv);
esp_rom_gpio_pad_set_drv(d_gpio_num, drv);
@ -198,13 +209,7 @@ static void bootloader_spi_flash_resume(void)
esp_err_t bootloader_init_spi_flash(void)
{
// Set source mspi pll clock as 80M in bootloader stage.
// SPLL clock on C61 is 480MHz , and mspi_pll needs 80MHz
// in this stage, set divider as 6
mspi_ll_clock_src_sel(MSPI_CLK_SRC_SPLL);
mspi_ll_fast_set_hs_divider(6);
bootloader_init_mspi_clock();
bootloader_init_flash_configure();
bootloader_spi_flash_resume();
bootloader_flash_unlock();

View File

@ -70,12 +70,12 @@ static const char *TAG = "boot.esp32h2";
void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
esp_rom_gpio_pad_set_drv(clk_gpio_num, drv);
esp_rom_gpio_pad_set_drv(q_gpio_num, drv);
esp_rom_gpio_pad_set_drv(d_gpio_num, drv);

View File

@ -19,10 +19,12 @@
#include "bootloader_init.h"
#include "hal/mmu_hal.h"
#include "hal/mmu_ll.h"
#include "hal/spimem_flash_ll.h"
#include "hal/cache_hal.h"
#include "hal/cache_ll.h"
#include "esp_private/bootloader_flash_internal.h"
void IRAM_ATTR bootloader_flash_update_id()
void IRAM_ATTR bootloader_flash_update_id(void)
{
esp_rom_spiflash_chip_t *chip = &rom_spiflash_legacy_data->chip;
chip->device_id = bootloader_read_flash_id();
@ -33,15 +35,23 @@ void bootloader_flash_update_size(uint32_t size)
rom_spiflash_legacy_data->chip.chip_size = size;
}
void IRAM_ATTR bootloader_flash_cs_timing_config()
void IRAM_ATTR bootloader_flash_cs_timing_config(void)
{
SET_PERI_REG_MASK(SPI_MEM_C_USER_REG, SPI_MEM_C_CS_HOLD_M | SPI_MEM_C_CS_SETUP_M);
SET_PERI_REG_BITS(SPI_MEM_C_CTRL2_REG, SPI_MEM_C_CS_HOLD_TIME_V, 0, SPI_MEM_C_CS_HOLD_TIME_S);
SET_PERI_REG_BITS(SPI_MEM_C_CTRL2_REG, SPI_MEM_C_CS_SETUP_TIME_V, 0, SPI_MEM_C_CS_SETUP_TIME_S);
}
void IRAM_ATTR bootloader_init_mspi_clock(void)
{
_spimem_flash_ll_select_clk_source(0, FLASH_CLK_SRC_SPLL);
_spimem_ctrlr_ll_set_core_clock(0, 6);
}
void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)
{
bootloader_init_mspi_clock();
uint32_t spi_clk_div = 0;
switch (pfhdr->spi_speed) {
case ESP_IMAGE_SPI_SPEED_DIV_1:
@ -66,12 +76,12 @@ static const char *TAG = "boot.esp32p4";
void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
esp_rom_gpio_pad_set_drv(clk_gpio_num, drv);
esp_rom_gpio_pad_set_drv(q_gpio_num, drv);
esp_rom_gpio_pad_set_drv(d_gpio_num, drv);

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -94,12 +94,12 @@ void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
const uint32_t spiconfig = esp_rom_efuse_get_flash_gpio_info();
uint8_t wp_pin = esp_rom_efuse_get_flash_wp_gpio();
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
if (spiconfig == 0) {
} else {

View File

@ -105,12 +105,12 @@ void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
const uint32_t spiconfig = esp_rom_efuse_get_flash_gpio_info();
uint8_t wp_pin = esp_rom_efuse_get_flash_wp_gpio();
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
if (spiconfig == 0) {
} else {

View File

@ -48,8 +48,8 @@ void bootloader_console_init(void)
#if CONFIG_ESP_CONSOLE_UART_CUSTOM
// 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;
const int uart_tx_gpio = (CONFIG_ESP_CONSOLE_UART_TX_GPIO >= 0) ? CONFIG_ESP_CONSOLE_UART_TX_GPIO : UART_NUM_0_TXD_DIRECT_GPIO_NUM;
const int uart_rx_gpio = (CONFIG_ESP_CONSOLE_UART_RX_GPIO >= 0) ? CONFIG_ESP_CONSOLE_UART_RX_GPIO : UART_NUM_0_RXD_DIRECT_GPIO_NUM;
// Switch to the new UART (this just changes UART number used for esp_rom_printf in ROM code).
esp_rom_output_set_as_console(uart_num);

View File

@ -30,7 +30,7 @@ int bootloader_clock_get_rated_freq_mhz(void)
#elif CONFIG_IDF_TARGET_ESP32C6
return 160;
#elif CONFIG_IDF_TARGET_ESP32C61 //TODO: [ESP32C61] IDF-9282
#elif CONFIG_IDF_TARGET_ESP32C61
return 160;
#elif CONFIG_IDF_TARGET_ESP32C5

View File

@ -16,12 +16,6 @@
#include "hal/apm_hal.h"
#endif
#if CONFIG_IDF_TARGET_ESP32C61 // TODO: IDF-9230 Remove the workaround when APM supported on C61!
#include "soc/hp_apm_reg.h"
#include "soc/lp_apm_reg.h"
#endif
void bootloader_init_mem(void)
{
@ -38,13 +32,6 @@ void bootloader_init_mem(void)
#endif
#endif
#if CONFIG_IDF_TARGET_ESP32C61 // TODO: IDF-9230 Remove the workaround when APM supported on C61!
// disable apm filter
REG_WRITE(LP_APM_FUNC_CTRL_REG, 0);
REG_WRITE(HP_APM_FUNC_CTRL_REG, 0);
#endif
#ifdef CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE
// protect memory region
esp_cpu_configure_region_protection();

View File

@ -875,7 +875,7 @@ static void set_cache_and_start_app(
}
//we use the MMU_LL_END_DROM_ENTRY_ID mmu entry as a map page for app to find the boot partition
mmu_hal_map_region(0, MMU_TARGET_FLASH0, MMU_LL_END_DROM_ENTRY_VADDR, drom_addr_aligned, CONFIG_MMU_PAGE_SIZE, &actual_mapped_len);
ESP_EARLY_LOGV(TAG, "mapped one page of the rodata, from paddr=0x%08" PRIx32 " and vaddr=0x%08" PRIx32 ", 0x%" PRIx32 " bytes are mapped", drom_addr_aligned, drom_load_addr_aligned, actual_mapped_len);
ESP_EARLY_LOGV(TAG, "mapped one page of the rodata, from paddr=0x%08" PRIx32 " and vaddr=0x%08" PRIx32 ", 0x%" PRIx32 " bytes are mapped", drom_addr_aligned, MMU_LL_END_DROM_ENTRY_VADDR, actual_mapped_len);
#endif
//-----------------------MAP IROM--------------------------

View File

@ -13,8 +13,6 @@
static SHA_CTX ctx;
//TODO: [ESP32C61] IDF-9234
bootloader_sha256_handle_t bootloader_sha256_start()
{
// Enable SHA hardware

View File

@ -37,6 +37,7 @@
#include "bootloader_soc.h"
#include "esp_private/bootloader_flash_internal.h"
#include "esp_efuse.h"
#include "hal/assist_debug_ll.h"
#include "hal/mmu_hal.h"
#include "hal/cache_hal.h"
#include "hal/clk_tree_ll.h"
@ -55,7 +56,7 @@ static const char *TAG = "boot.esp32p4";
static void wdt_reset_cpu0_info_enable(void)
{
//TODO: IDF-7688
_assist_debug_ll_enable_bus_clock(true);
REG_WRITE(ASSIST_DEBUG_CORE_0_RCD_EN_REG, ASSIST_DEBUG_CORE_0_RCD_PDEBUGEN | ASSIST_DEBUG_CORE_0_RCD_RECORDEN);
}
@ -109,12 +110,12 @@ static inline void bootloader_hardware_init(void)
REGI2C_WRITE_MASK(I2C_BIAS, I2C_BIAS_DREG_1P1, 10);
REGI2C_WRITE_MASK(I2C_BIAS, I2C_BIAS_DREG_1P1_PVT, 10);
#if !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP
// IDF-10019 TODO: This is temporarily for ESP32P4-ECO0, please remove it when eco0 is not widly used.
int __DECLARE_RCC_ATOMIC_ENV __attribute__ ((unused));
if (likely(ESP_CHIP_REV_ABOVE(chip_version, 1))) {
spimem_flash_ll_select_clk_source(0, FLASH_CLK_SRC_SPLL);
spimem_ctrlr_ll_set_core_clock(0, 6);
bootloader_init_mspi_clock();
}
#endif
}
static inline void bootloader_ana_reset_config(void)

View File

@ -17,16 +17,15 @@
#include "hal/wdt_hal.h"
// Need to remove check and merge accordingly for ESP32C5 once key manager support added in IDF-8621
#if SOC_KEY_MANAGER_SUPPORTED || CONFIG_IDF_TARGET_ESP32C5
#if SOC_KEY_MANAGER_FE_KEY_DEPLOY || CONFIG_IDF_TARGET_ESP32C5
#if CONFIG_IDF_TARGET_ESP32C5
#include "soc/keymng_reg.h"
#include "hal/key_mgr_types.h"
#include "soc/pcr_reg.h"
#else
#include "hal/key_mgr_hal.h"
#else /* CONFIG_IDF_TARGET_ESP32C5 */
#include "hal/key_mgr_ll.h"
#include "hal/mspi_timing_tuning_ll.h"
#endif /* CONFIG_IDF_TARGET_ESP32C5 */
#endif
#endif /* !CONFIG_IDF_TARGET_ESP32C5 */
#endif /* SOC_KEY_MANAGER_FE_KEY_DEPLOY */
#ifdef CONFIG_SOC_EFUSE_CONSISTS_OF_ONE_KEY_BLOCK
#include "soc/sensitive_reg.h"
@ -223,17 +222,25 @@ static esp_err_t check_and_generate_encryption_keys(void)
ESP_LOGI(TAG, "Using pre-loaded flash encryption key in efuse");
}
// Need to remove check for ESP32C5 and merge accordingly once key manager support added in IDF-8621
#if SOC_KEY_MANAGER_SUPPORTED || CONFIG_IDF_TARGET_ESP32C5
#if SOC_KEY_MANAGER_FE_KEY_DEPLOY || CONFIG_IDF_TARGET_ESP32C5
#if CONFIG_IDF_TARGET_ESP32C5
REG_SET_FIELD(KEYMNG_STATIC_REG, KEYMNG_USE_EFUSE_KEY, 2);
REG_SET_BIT(PCR_MSPI_CLK_CONF_REG, PCR_MSPI_AXI_RST_EN);
REG_CLR_BIT(PCR_MSPI_CLK_CONF_REG, PCR_MSPI_AXI_RST_EN);
#else
#else /* CONFIG_IDF_TARGET_ESP32C5 */
// Enable and reset key manager
// To suppress build errors about spinlock's __DECLARE_RCC_ATOMIC_ENV
int __DECLARE_RCC_ATOMIC_ENV __attribute__ ((unused));
key_mgr_ll_enable_bus_clock(true);
key_mgr_ll_enable_peripheral_clock(true);
key_mgr_ll_reset_register();
while (key_mgr_ll_get_state() != ESP_KEY_MGR_STATE_IDLE) {
};
// Force Key Manager to use eFuse key for XTS-AES operation
key_mgr_hal_set_key_usage(ESP_KEY_MGR_XTS_AES_128_KEY, ESP_KEY_MGR_USE_EFUSE_KEY);
key_mgr_ll_set_key_usage(ESP_KEY_MGR_XTS_AES_128_KEY, ESP_KEY_MGR_USE_EFUSE_KEY);
_mspi_timing_ll_reset_mspi();
#endif /* CONFIG_IDF_TARGET_ESP32C5 */
#endif
#endif /* !CONFIG_IDF_TARGET_ESP32C5 */
#endif /* SOC_KEY_MANAGER_FE_KEY_DEPLOY */
return ESP_OK;
}

View File

@ -6,6 +6,8 @@ endif()
if(CONFIG_IDF_TARGET_ESP32S3)
set(target_name "esp32c3")
elseif(CONFIG_IDF_TARGET_ESP32C61)
set(target_name "esp32c6")
else()
set(target_name "${idf_target}")
endif()
@ -156,6 +158,8 @@ if(CONFIG_BT_ENABLED)
host/bluedroid/stack/avdt/include
host/bluedroid/stack/a2dp/include
host/bluedroid/stack/rfcomm/include
host/bluedroid/stack/obex/include
host/bluedroid/stack/goep/include
host/bluedroid/stack/include
host/bluedroid/common/include
host/bluedroid/config/include)
@ -183,6 +187,8 @@ if(CONFIG_BT_ENABLED)
"host/bluedroid/bta/av/bta_av_aact.c"
"host/bluedroid/bta/av/bta_av_act.c"
"host/bluedroid/bta/av/bta_av_api.c"
"host/bluedroid/bta/av/bta_av_ca_act.c"
"host/bluedroid/bta/av/bta_av_ca_sm.c"
"host/bluedroid/bta/av/bta_av_cfg.c"
"host/bluedroid/bta/av/bta_av_ci.c"
"host/bluedroid/bta/av/bta_av_main.c"
@ -378,6 +384,8 @@ if(CONFIG_BT_ENABLED)
"host/bluedroid/stack/gatt/gatt_sr.c"
"host/bluedroid/stack/gatt/gatt_sr_hash.c"
"host/bluedroid/stack/gatt/gatt_utils.c"
"host/bluedroid/stack/goep/goepc_api.c"
"host/bluedroid/stack/goep/goepc_main.c"
"host/bluedroid/stack/hcic/hciblecmds.c"
"host/bluedroid/stack/hcic/hcicmds.c"
"host/bluedroid/stack/l2cap/l2c_api.c"
@ -389,6 +397,9 @@ if(CONFIG_BT_ENABLED)
"host/bluedroid/stack/l2cap/l2c_ucd.c"
"host/bluedroid/stack/l2cap/l2c_utils.c"
"host/bluedroid/stack/l2cap/l2cap_client.c"
"host/bluedroid/stack/obex/obex_api.c"
"host/bluedroid/stack/obex/obex_main.c"
"host/bluedroid/stack/obex/obex_tl_l2cap.c"
"host/bluedroid/stack/rfcomm/port_api.c"
"host/bluedroid/stack/rfcomm/port_rfc.c"
"host/bluedroid/stack/rfcomm/port_utils.c"
@ -845,7 +856,16 @@ if(CONFIG_BT_ENABLED)
"${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c3_family/esp32s3")
target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app)
elseif(CONFIG_BT_CONTROLLER_ENABLED)
add_prebuilt_library(libble_app "controller/lib_${target_name}/${target_name}-bt-lib/libble_app.a")
if(CONFIG_IDF_TARGET_ESP32C6)
add_prebuilt_library(libble_app
"${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c6/esp32c6-bt-lib/esp32c6/libble_app.a")
elseif(CONFIG_IDF_TARGET_ESP32C61)
add_prebuilt_library(libble_app
"${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c6/esp32c6-bt-lib/esp32c61/libble_app.a")
else()
add_prebuilt_library(libble_app
"controller/lib_${target_name}/${target_name}-bt-lib/libble_app.a")
endif()
target_link_libraries(${COMPONENT_LIB} PRIVATE libble_app)
endif()

View File

@ -42,9 +42,9 @@
#if (BTC_L2CAP_INCLUDED == TRUE)
#include "btc_l2cap.h"
#endif /* #if (BTC_L2CAP_INCLUDED == TRUE) */
#if (BTC_SDP_INCLUDED == TRUE)
#if (BTC_SDP_COMMON_INCLUDED == TRUE)
#include "btc_sdp.h"
#endif /* #if (BTC_SDP_INCLUDED == TRUE) */
#endif /* #if (BTC_SDP_COMMON_INCLUDED == TRUE) */
#if BTC_HF_INCLUDED
#include "btc_hf_ag.h"
#endif/* #if BTC_HF_INCLUDED */
@ -138,9 +138,9 @@ static const btc_func_t profile_tab[BTC_PID_NUM] = {
#if (BTC_L2CAP_INCLUDED == TRUE)
[BTC_PID_L2CAP] = {btc_l2cap_call_handler, btc_l2cap_cb_handler },
#endif /* #if (BTC_L2CAP_INCLUDED == TRUE) */
#if (BTC_SDP_INCLUDED == TRUE)
#if (BTC_SDP_COMMON_INCLUDED == TRUE)
[BTC_PID_SDP] = {btc_sdp_call_handler, btc_sdp_cb_handler },
#endif /* #if (BTC_SDP_INCLUDED == TRUE) */
#endif /* #if (BTC_SDP_COMMON_INCLUDED == TRUE) */
#if BTC_HF_INCLUDED
[BTC_PID_HF] = {btc_hf_call_handler, btc_hf_cb_handler},
#endif /* #if BTC_HF_INCLUDED */
@ -295,8 +295,8 @@ static bt_status_t btc_task_post(btc_msg_t *msg, uint32_t timeout)
/**
* transfer an message to another module in the different task.
* @param msg message
* @param arg paramter
* @param arg_len length of paramter
* @param arg parameter
* @param arg_len length of parameter
* @param copy_func deep copy function
* @param free_func deep free function
* @return BT_STATUS_SUCCESS: success
@ -342,7 +342,7 @@ bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg
}
/**
* transfer an message to another module in tha same task.
* transfer an message to another module in the same task.
* @param msg message
* @return BT_STATUS_SUCCESS: success
* others: fail

View File

@ -200,8 +200,8 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL
bool "+15dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P18
bool "+18dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P21
bool "+21dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P20
bool "+20dBm"
endchoice
config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
@ -221,7 +221,7 @@ config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P12
default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P15
default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P18
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P21
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P20
default 0
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP

View File

@ -40,12 +40,12 @@
#include "esp_phy_init.h"
#include "esp_private/periph_ctrl.h"
#include "soc/retention_periph_defs.h"
#include "esp_private/sleep_retention.h"
#include "soc/regdma.h"
#include "bt_osi_mem.h"
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#include "esp_private/sleep_modem.h"
#include "esp_private/sleep_retention.h"
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
#include "freertos/FreeRTOS.h"
@ -128,8 +128,8 @@ extern void r_ble_rtc_wake_up_state_clr(void);
extern int os_msys_init(void);
extern void os_msys_deinit(void);
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
extern const sleep_retention_entries_config_t *esp_ble_mac_retention_link_get(uint8_t *size, uint8_t extra);
extern void esp_ble_set_wakeup_overhead(uint32_t overhead);
extern sleep_retention_entries_config_t *r_esp_ble_mac_retention_link_get(uint8_t *size, uint8_t extra);
extern void r_esp_ble_set_wakeup_overhead(uint32_t overhead);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
extern void r_esp_ble_change_rtc_freq(uint32_t freq);
extern int ble_sm_alg_gen_dhkey(const uint8_t *peer_pub_key_x,
@ -303,12 +303,7 @@ void esp_bt_rtc_slow_clk_select(uint8_t slow_clk_src)
switch (slow_clk_src) {
case MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using main XTAL as clock source");
uint32_t chip_version = efuse_hal_chip_revision();
if (chip_version == 0) {
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (400 - 1));
} else{
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (5 - 1));
}
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (480 - 1));
break;
case MODEM_CLOCK_LPCLK_SRC_RC_SLOW:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using 136 kHz RC as clock source, can only run legacy ADV or SCAN due to low clock accuracy!");
@ -373,57 +368,48 @@ IRAM_ATTR void controller_wakeup_cb(void *arg)
}
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
// TODO: IDF-10765
// static esp_err_t sleep_modem_ble_mac_retention_init(void *arg)
// {
// uint8_t size;
// int extra = *(int *)arg;
// const sleep_retention_entries_config_t *ble_mac_modem_config = esp_ble_mac_retention_link_get(&size, extra);
// esp_err_t err = sleep_retention_entries_create(ble_mac_modem_config, size, REGDMA_LINK_PRI_BT_MAC_BB, SLEEP_RETENTION_MODULE_BLE_MAC);
// if (err == ESP_OK) {
// ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Modem BLE MAC retention initialization");
// }
// return err;
// return ESP_OK;
// }
static esp_err_t sleep_modem_ble_mac_retention_init(void *arg)
{
uint8_t size;
int extra = *(int *)arg;
sleep_retention_entries_config_t *ble_mac_modem_config = r_esp_ble_mac_retention_link_get(&size, extra);
esp_err_t err = sleep_retention_entries_create(ble_mac_modem_config, size, REGDMA_LINK_PRI_BT_MAC_BB, SLEEP_RETENTION_MODULE_BLE_MAC);
if (err == ESP_OK) {
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Modem BLE MAC retention initialization");
}
return err;
return ESP_OK;
}
static esp_err_t sleep_modem_ble_mac_modem_state_init(uint8_t extra)
{
// TODO: IDF-10765
// int retention_args = extra;
// sleep_retention_module_init_param_t init_param = {
// .cbs = { .create = { .handle = sleep_modem_ble_mac_retention_init, .arg = &retention_args } },
// .depends = BIT(SLEEP_RETENTION_MODULE_BT_BB)
// };
// esp_err_t err = sleep_retention_module_init(SLEEP_RETENTION_MODULE_BLE_MAC, &init_param);
// if (err == ESP_OK) {
// err = sleep_retention_module_allocate(SLEEP_RETENTION_MODULE_BLE_MAC);
// }
// return err;
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "This func temporary not supported for current target!");
return ESP_OK;
int retention_args = extra;
sleep_retention_module_init_param_t init_param = {
.cbs = { .create = { .handle = sleep_modem_ble_mac_retention_init, .arg = &retention_args } },
.depends = BIT(SLEEP_RETENTION_MODULE_BT_BB)
};
esp_err_t err = sleep_retention_module_init(SLEEP_RETENTION_MODULE_BLE_MAC, &init_param);
if (err == ESP_OK) {
err = sleep_retention_module_allocate(SLEEP_RETENTION_MODULE_BLE_MAC);
}
return err;
}
static void sleep_modem_ble_mac_modem_state_deinit(void)
{
// TODO: IDF-10765
// esp_err_t err = sleep_retention_module_free(SLEEP_RETENTION_MODULE_BLE_MAC);
// if (err == ESP_OK) {
// err = sleep_retention_module_deinit(SLEEP_RETENTION_MODULE_BLE_MAC);
// assert(err == ESP_OK);
// }
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "This func temporary not supported for current target!");
esp_err_t err = sleep_retention_module_free(SLEEP_RETENTION_MODULE_BLE_MAC);
if (err == ESP_OK) {
err = sleep_retention_module_deinit(SLEEP_RETENTION_MODULE_BLE_MAC);
assert(err == ESP_OK);
}
}
void sleep_modem_light_sleep_overhead_set(uint32_t overhead)
{
// TODO: IDF-10765
// esp_ble_set_wakeup_overhead(overhead);
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "This func temporary not supported for current target!");
r_esp_ble_set_wakeup_overhead(overhead);
}
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
esp_err_t controller_sleep_init(void)
{
esp_err_t rc = 0;
@ -446,7 +432,7 @@ esp_err_t controller_sleep_init(void)
}
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
/* Create a new regdma link for BLE related register restoration */
rc = sleep_modem_ble_mac_modem_state_init(1);
rc = sleep_modem_ble_mac_modem_state_init(0);
assert(rc == 0);
esp_sleep_enable_bt_wakeup();
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer");

View File

@ -0,0 +1 @@
source "$IDF_PATH/components/bt/controller/esp32c6/Kconfig.in"

@ -1 +1 @@
Subproject commit 3bb36a79cdfad65c656b9238e0d46b935775ed72
Subproject commit 8112ca2c575c6feb32d755623f097f1b66759490

@ -1 +1 @@
Subproject commit e652624750341aca124e9f850e261b0c1ac63529
Subproject commit e5c7ef0bf701d02c2203e26081fdd348d45935e5

@ -1 +1 @@
Subproject commit ef1dfc518572e9cda55f13906e32207b40ee280b
Subproject commit 5c913171361dac0821e15e83cc0cf604149e1b84

@ -1 +1 @@
Subproject commit 53056440bc6e76f5bf00fd920769a4979dcc7d66
Subproject commit b4f67e85c54cc8f55b5130e47805dc8c906a736c

@ -1 +1 @@
Subproject commit f95513f22be7b21429b01ba05dbfbc98097b5e67
Subproject commit 3f15aa1d602aedf510dd9c686b3f7e5ea8a44002

@ -1 +1 @@
Subproject commit 58a293a2b4c305157723908ea29c2776f5803bbc
Subproject commit 50f567fff506f63b4d06ebea80d0405fe9e39568

@ -1 +1 @@
Subproject commit 8312e0e0d5390d04fd282e8005528d2b5c351c08
Subproject commit cba99c5a2e7f5d4bccb04e8f3f968dc888bb5667

View File

@ -84,9 +84,30 @@ config BT_A2DP_ENABLE
bool "A2DP"
depends on BT_CLASSIC_ENABLED
default n
select BT_AVRCP_ENABLED
help
Advanced Audio Distribution Profile
config BT_AVRCP_ENABLED
bool
depends on BT_A2DP_ENABLE
default y
help
Audio/Video Remote Control Profile, AVRCP and A2DP are coupled in Bluedroid,
AVRCP still controlled by A2DP option, this is a dummy option currently
menu "AVRCP Features"
depends on BT_AVRCP_ENABLED
config BT_AVRCP_CT_COVER_ART_ENABLED
bool "AVRCP CT Cover Art"
default y
select BT_GOEPC_ENABLED
help
This enable Cover Art feature of AVRCP CT role
endmenu
config BT_SPP_ENABLED
bool "SPP"
depends on BT_CLASSIC_ENABLED
@ -102,6 +123,14 @@ config BT_L2CAP_ENABLED
This enables the Logical Link Control and Adaptation Layer Protocol.
Only supported classic bluetooth.
config BT_SDP_COMMON_ENABLED
bool "BT SDP COMMON"
depends on BT_CLASSIC_ENABLED
default y if BT_L2CAP_ENABLED
default n
help
This enables common SDP operation, such as SDP record creation and deletion.
menuconfig BT_HFP_ENABLE
bool "Hands Free/Handset Profile"
depends on BT_CLASSIC_ENABLED
@ -136,19 +165,18 @@ endchoice
config BT_HFP_WBS_ENABLE
bool "Wide Band Speech"
depends on BT_HFP_AUDIO_DATA_PATH_HCI
depends on BT_HFP_ENABLE && BT_HFP_AUDIO_DATA_PATH_HCI
default y
help
This enables Wide Band Speech. Should disable it when SCO data path is PCM.
Otherwise there will be no data transmitted via GPIOs.
menuconfig BT_HID_ENABLED
bool "Classic BT HID"
depends on BT_CLASSIC_ENABLED
default n
help
This enables the BT HID Host
This enables the BT HID functionalities
config BT_HID_HOST_ENABLED
bool "Classic BT HID Host"
@ -163,6 +191,13 @@ config BT_HID_DEVICE_ENABLED
help
This enables the BT HID Device
config BT_GOEPC_ENABLED
bool
depends on BT_CLASSIC_ENABLED
default n
help
This enables the BT GOEP Profile Client role
config BT_BLE_ENABLED
bool "Bluetooth Low Energy"
depends on BT_BLUEDROID_ENABLED

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -232,6 +232,149 @@ esp_err_t esp_avrc_ct_send_passthrough_cmd(uint8_t tl, uint8_t key_code, uint8_t
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}
#if BTC_AV_CA_INCLUDED
esp_err_t esp_avrc_ct_cover_art_connect(uint16_t mtu)
{
if ((esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) ||
(!btc_avrc_ct_connected_p())) {
return ESP_ERR_INVALID_STATE;
}
if (!btc_avrc_ct_check_cover_art_support()) {
return ESP_ERR_NOT_SUPPORTED;
}
if (mtu > ESP_AVRC_CA_MTU_MAX || mtu < ESP_AVRC_CA_MTU_MIN) {
mtu = ESP_AVRC_CA_MTU_MAX;
}
btc_msg_t msg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_AVRC_CT;
msg.act = BTC_AVRC_CT_API_COVER_ART_CONNECT_EVT;
btc_avrc_args_t arg;
memset(&arg, 0, sizeof(btc_avrc_args_t));
arg.ca_conn.mtu = mtu;
/* Switch to BTC context */
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;
}
esp_err_t esp_avrc_ct_cover_art_disconnect(void)
{
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
return ESP_ERR_INVALID_STATE;
}
if (!btc_avrc_ct_check_cover_art_support()) {
return ESP_ERR_NOT_SUPPORTED;
}
btc_msg_t msg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_AVRC_CT;
msg.act = BTC_AVRC_CT_API_COVER_ART_DISCONNECT_EVT;
/* Switch to BTC context */
bt_status_t stat = btc_transfer_context(&msg, NULL, 0, NULL, NULL);
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}
esp_err_t esp_avrc_ct_cover_art_get_image_properties(uint8_t *image_handle)
{
if ((esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) ||
(!btc_avrc_ct_connected_p())) {
return ESP_ERR_INVALID_STATE;
}
if (!btc_avrc_ct_check_cover_art_support()) {
return ESP_ERR_NOT_SUPPORTED;
}
if (image_handle == NULL) {
return ESP_ERR_INVALID_ARG;
}
btc_msg_t msg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_AVRC_CT;
msg.act = BTC_AVRC_CT_API_COVER_ART_GET_IMAGE_PROPERTIES_EVT;
btc_avrc_args_t arg;
memset(&arg, 0, sizeof(btc_avrc_args_t));
memcpy(arg.ca_get_img_prop.image_handle, image_handle, ESP_AVRC_CA_IMAGE_HANDLE_LEN);
/* Switch to BTC context */
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;
}
esp_err_t esp_avrc_ct_cover_art_get_image(uint8_t *image_handle, uint8_t *image_descriptor, uint16_t image_descriptor_len)
{
if ((esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) ||
(!btc_avrc_ct_connected_p())) {
return ESP_ERR_INVALID_STATE;
}
if (!btc_avrc_ct_check_cover_art_support()) {
return ESP_ERR_NOT_SUPPORTED;
}
if (image_handle == NULL || image_descriptor == NULL || image_descriptor_len == 0) {
return ESP_ERR_INVALID_ARG;
}
btc_msg_t msg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_AVRC_CT;
msg.act = BTC_AVRC_CT_API_COVER_ART_GET_IMAGE_EVT;
btc_avrc_args_t arg;
memset(&arg, 0, sizeof(btc_avrc_args_t));
memcpy(arg.ca_get_img.image_handle, image_handle, ESP_AVRC_CA_IMAGE_HANDLE_LEN);
arg.ca_get_img.image_descriptor_len = image_descriptor_len;
arg.ca_get_img.image_descriptor = image_descriptor;
/* Switch to BTC context */
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_avrc_args_t), btc_avrc_arg_deep_copy, btc_avrc_arg_deep_free);
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}
esp_err_t esp_avrc_ct_cover_art_get_linked_thumbnail(uint8_t *image_handle)
{
if ((esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) ||
(!btc_avrc_ct_connected_p())) {
return ESP_ERR_INVALID_STATE;
}
if (!btc_avrc_ct_check_cover_art_support()) {
return ESP_ERR_NOT_SUPPORTED;
}
if (image_handle == NULL) {
return ESP_ERR_INVALID_ARG;
}
btc_msg_t msg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_AVRC_CT;
msg.act = BTC_AVRC_CT_API_COVER_ART_GET_LINKED_THUMBNAIL_EVT;
btc_avrc_args_t arg;
memset(&arg, 0, sizeof(btc_avrc_args_t));
memcpy(arg.ca_get_lk_thn.image_handle, image_handle, ESP_AVRC_CA_IMAGE_HANDLE_LEN);
/* Switch to BTC context */
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;
}
#endif /* #if BTC_AV_CA_INCLUDED */
/*********************************************************************************************/
/** following is the API of AVRCP target role **/
/*********************************************************************************************/

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -8,12 +8,43 @@
#include "esp_bt_main.h"
#include "btc/btc_manage.h"
#include "stack/sdpdefs.h"
#include "btc_sdp.h"
#include "esp_sdp_api.h"
#include "common/bt_target.h"
#if (defined BTC_SDP_INCLUDED && BTC_SDP_INCLUDED == TRUE)
#if (defined BTC_SDP_COMMON_INCLUDED && BTC_SDP_COMMON_INCLUDED == TRUE)
static bool esp_sdp_record_integrity_check(esp_bluetooth_sdp_record_t *record)
{
bool ret = true;
if (record != NULL) {
switch (record->hdr.type) {
case ESP_SDP_TYPE_DIP_SERVER:
if (record->dip.vendor_id_source != ESP_SDP_VENDOR_ID_SRC_BT &&
record->dip.vendor_id_source != ESP_SDP_VENDOR_ID_SRC_USB) {
LOG_ERROR("Invalid vendor_id_source!\n");
ret = false;
}
break;
default:
if (record->hdr.service_name_length > ESP_SDP_SERVER_NAME_MAX ||
strlen(record->hdr.service_name) + 1 != record->hdr.service_name_length) {
LOG_ERROR("Invalid server name!\n");
ret = false;
}
break;
}
} else {
LOG_ERROR("record is NULL!\n");
ret = false;
}
return ret;
}
esp_err_t esp_sdp_register_callback(esp_sdp_cb_t callback)
{
@ -85,9 +116,7 @@ esp_err_t esp_sdp_create_record(esp_bluetooth_sdp_record_t *record)
{
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
if (record == NULL || record->hdr.service_name_length > ESP_SDP_SERVER_NAME_MAX
|| strlen(record->hdr.service_name)+1 != record->hdr.service_name_length) {
LOG_ERROR("Invalid server name!\n");
if (!esp_sdp_record_integrity_check(record)) {
return ESP_ERR_INVALID_ARG;
}
@ -100,7 +129,7 @@ esp_err_t esp_sdp_create_record(esp_bluetooth_sdp_record_t *record)
msg.act = BTC_SDP_ACT_CREATE_RECORD;
memset(&arg, 0, sizeof(btc_sdp_args_t));
arg.creat_record.record = (bluetooth_sdp_record *)record;
arg.create_record.record = (bluetooth_sdp_record *)record;
/* Switch to BTC context */
stat = btc_transfer_context(&msg, &arg, sizeof(btc_sdp_args_t),
@ -127,4 +156,4 @@ esp_err_t esp_sdp_remove_record(int record_handle)
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}
#endif ///defined BTC_SDP_INCLUDED && BTC_SDP_INCLUDED == TRUE
#endif ///defined BTC_SDP_COMMON_INCLUDED && BTC_SDP_COMMON_INCLUDED == TRUE

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -18,6 +18,10 @@ extern "C" {
#define ESP_AVRC_TRANS_LABEL_MAX 15 /*!< max transaction label */
#define ESP_AVRC_CA_IMAGE_HANDLE_LEN 7 /* The image handle length is fixed to 7, specified by Basic Image Profile */
#define ESP_AVRC_CA_MTU_MIN 255 /* Minimal MTU can be used in Cover Art OBEX connection */
#define ESP_AVRC_CA_MTU_MAX 1691 /* Maximum MTU can be used in Cover Art OBEX connection */
/// AVRC feature bit mask
typedef enum {
ESP_AVRC_FEAT_RCTG = 0x0001, /*!< remote control target */
@ -30,14 +34,18 @@ typedef enum {
/// AVRC supported features flag retrieved in SDP record
typedef enum {
/* CT and TG common features flag */
ESP_AVRC_FEAT_FLAG_CAT1 = 0x0001, /*!< category 1 */
ESP_AVRC_FEAT_FLAG_CAT2 = 0x0002, /*!< category 2 */
ESP_AVRC_FEAT_FLAG_CAT3 = 0x0004, /*!< category 3 */
ESP_AVRC_FEAT_FLAG_CAT4 = 0x0008, /*!< category 4 */
ESP_AVRC_FEAT_FLAG_BROWSING = 0x0040, /*!< browsing */
ESP_AVRC_FEAT_FLAG_COVER_ART_GET_IMAGE_PROP = 0x0080, /*!< Cover Art GetImageProperties */
ESP_AVRC_FEAT_FLAG_COVER_ART_GET_IMAGE = 0x0100, /*!< Cover Art GetImage */
ESP_AVRC_FEAT_FLAG_COVER_ART_GET_LINKED_THUMBNAIL = 0x0200, /*!< Cover Art GetLinkedThumbnail */
/* CT only features flag */
ESP_AVRC_FEAT_FLAG_COVER_ART_GET_IMAGE_PROP = 0x0080, /*!< CT support Cover Art GetImageProperties */
ESP_AVRC_FEAT_FLAG_COVER_ART_GET_IMAGE = 0x0100, /*!< CT support Cover Art GetImage */
ESP_AVRC_FEAT_FLAG_COVER_ART_GET_LINKED_THUMBNAIL = 0x0200, /*!< CT support Cover Art GetLinkedThumbnail */
/* TG only features flag */
ESP_AVRC_FEAT_FLAG_TG_COVER_ART = 0x0100, /*!< TG support Cover Art */
} esp_avrc_feature_flag_t;
/// AVRC passthrough command code
@ -133,8 +141,10 @@ typedef enum {
ESP_AVRC_CT_PLAY_STATUS_RSP_EVT = 3, /*!< play status response event */
ESP_AVRC_CT_CHANGE_NOTIFY_EVT = 4, /*!< notification event */
ESP_AVRC_CT_REMOTE_FEATURES_EVT = 5, /*!< feature of remote device indication event */
ESP_AVRC_CT_GET_RN_CAPABILITIES_RSP_EVT = 6, /*!< supported notification events capability of peer device */
ESP_AVRC_CT_GET_RN_CAPABILITIES_RSP_EVT = 6, /*!< supported notification events capability of peer device */
ESP_AVRC_CT_SET_ABSOLUTE_VOLUME_RSP_EVT = 7, /*!< set absolute volume response event */
ESP_AVRC_CT_COVER_ART_STATE_EVT = 8, /*!< cover art client connection state changed event */
ESP_AVRC_CT_COVER_ART_DATA_EVT = 9, /*!< cover art client data event */
} esp_avrc_ct_cb_event_t;
/// AVRC Target callback events
@ -155,7 +165,8 @@ typedef enum {
ESP_AVRC_MD_ATTR_TRACK_NUM = 0x8, /*!< track position on the album */
ESP_AVRC_MD_ATTR_NUM_TRACKS = 0x10, /*!< number of tracks on the album */
ESP_AVRC_MD_ATTR_GENRE = 0x20, /*!< track genre */
ESP_AVRC_MD_ATTR_PLAYING_TIME = 0x40 /*!< total album playing time in miliseconds */
ESP_AVRC_MD_ATTR_PLAYING_TIME = 0x40, /*!< total album playing time in milliseconds */
ESP_AVRC_MD_ATTR_COVER_ART = 0x80 /*!< cover art image handle */
} esp_avrc_md_attr_mask_t;
/// AVRC event notification ids
@ -261,6 +272,12 @@ typedef enum {
ESP_AVRC_PLAYBACK_ERROR = 0xFF, /*!< error */
} esp_avrc_playback_stat_t;
/// AVRC Cover Art connection error code
typedef enum {
ESP_AVRC_COVER_ART_DISCONNECTED, /*!< Cover Art connection disconnected or connection failed */
ESP_AVRC_COVER_ART_CONNECTED, /*!< Cover Art connection established */
} esp_avrc_cover_art_conn_state_t;
/// AVRCP notification parameters
typedef union
{
@ -337,6 +354,24 @@ typedef union {
struct avrc_ct_set_volume_rsp_param {
uint8_t volume; /*!< the volume which has actually been set, range is 0 to 0x7f, means 0% to 100% */
} set_volume_rsp; /*!< set absolute volume response event */
/**
* @brief ESP_AVRC_CT_COVER_ART_STATE_EVT
*/
struct avrc_ct_cover_art_state_param {
esp_avrc_cover_art_conn_state_t state; /*!< indicate the Cover Art connection status */
esp_bt_status_t reason; /*!< the disconnect reason of Cover Art connection */
} cover_art_state; /*!< AVRC Cover Art connection state change event */
/**
* @brief ESP_AVRC_CT_COVER_ART_DATA_EVT
*/
struct avrc_ct_cover_art_data_param {
esp_bt_status_t status; /*!< indicate whether the get operation is success, p_data is valid only when status is ESP_BT_STATUS_SUCCESS */
bool final; /*!< indicate whether this data event is the final one, true if we have received the entire object */
uint16_t data_len; /*!< the data length of this data event, in bytes */
uint8_t *p_data; /*!< pointer to data, should copy to other buff before event callback return */
} cover_art_data; /*!< AVRC Cover Art data event */
} esp_avrc_ct_cb_param_t;
/// AVRC target callback parameters
@ -656,11 +691,11 @@ bool esp_avrc_psth_bit_mask_operation(esp_avrc_bit_mask_op_t op, esp_avrc_psth_b
/**
*
* @brief Get the requested event notification capabilies on local AVRC target. The capability is returned
* @brief Get the requested event notification capabilities on local AVRC target. The capability is returned
* in a bit mask representation in evt_set. This function should be called after esp_avrc_tg_init().
*
* For capability type "ESP_AVRC_RN_CAP_ALLOWED_EVT, the retrieved event set is constant and
* it covers all of the notifcation events that can possibly be supported with current
* it covers all of the notification events that can possibly be supported with current
* implementation.
*
* For capability type ESP_AVRC_RN_CAP_SUPPORTED_EVT, the event set covers the notification
@ -729,6 +764,92 @@ bool esp_avrc_rn_evt_bit_mask_operation(esp_avrc_bit_mask_op_t op, esp_avrc_rn_e
esp_err_t esp_avrc_tg_send_rn_rsp(esp_avrc_rn_event_ids_t event_id, esp_avrc_rn_rsp_t rsp,
esp_avrc_rn_param_t *param);
/**
*
* @brief Start the process to establish OBEX connection used in Cover Art Client. Once the operation done,
* ESP_AVRC_CT_COVER_ART_STATE_EVT will come, operation result can be found in event param. This API
* can be used only when AVRC Cover Art feature is enabled.
*
* @param[in] mtu: MTU used in lower level connection, should not smaller than ESP_AVRC_CA_MTU_MIN or larger than
* ESP_AVRC_CA_MTU_MAX, if value is not valid, will be reset to ESP_AVRC_CA_MTU_MAX. This can limit
* the max data length in cover_art_data event.
*
* @return
* - ESP_OK: success
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not enabled or AVRC CT is not initialized
* - ESP_ERR_NOT_SUPPORTED: if peer device does not support Cover Art function
*
*/
esp_err_t esp_avrc_ct_cover_art_connect(uint16_t mtu);
/**
*
* @brief Start the process to release the OBEX connection used in Cover Art Client.Once the operation done,
* ESP_AVRC_CT_COVER_ART_STATE_EVT will come, operation result can be found in event param. This API
* can be used only when AVRC Cover Art feature is enabled.
*
* @return
* - ESP_OK: success
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not enabled or AVRC CT is not initialized
* - ESP_ERR_NOT_SUPPORTED: if peer device does not support Cover Art function
*
*/
esp_err_t esp_avrc_ct_cover_art_disconnect(void);
/**
*
* @brief Start the process to get image properties from Cover Art server. This API can be used only when AVRC
* Cover Art feature is enabled.
*
* @param[in] image_handle: pointer to image handle with a length of ESP_AVRC_CA_IMAGE_HANDLE_LEN bytes, can be freed
* after this function return
*
* @return
* - ESP_OK: success
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not enabled or AVRC CT is not initialized
* - ESP_ERR_NOT_SUPPORTED: if peer device does not support Cover Art function
*
*/
esp_err_t esp_avrc_ct_cover_art_get_image_properties(uint8_t *image_handle);
/**
*
* @brief Start the process to get image from Cover Art server. This API can be used only when AVRC Cover Art
* feature is enabled.
*
* @param[in] image_handle: pointer to image handle with a length of ESP_AVRC_CA_IMAGE_HANDLE_LEN bytes, can be freed
* after this function return
*
* @param[in] image_descriptor: pointer to image descriptor, will be cache internally by bluetooth stack, can be freed
* once this api return
*
* @param[in] image_descriptor_len: the length of image descriptor
*
* @return
* - ESP_OK: success
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not enabled or AVRC CT is not initialized
* - ESP_ERR_NOT_SUPPORTED: if peer device does not support Cover Art function
*
*/
esp_err_t esp_avrc_ct_cover_art_get_image(uint8_t *image_handle, uint8_t *image_descriptor, uint16_t image_descriptor_len);
/**
*
* @brief Start the process to get linked thumbnail from Cover Art server. This API can be used only when AVRC
* Cover Art feature is enabled.
*
* @param[in] image_handle: pointer to image handle with a length of ESP_AVRC_CA_IMAGE_HANDLE_LEN bytes, can be freed
* after this function return
*
* @return
* - ESP_OK: success
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not enabled or AVRC CT is not initialized
* - ESP_ERR_NOT_SUPPORTED: if peer device does not support Cover Art function
*
*/
esp_err_t esp_avrc_ct_cover_art_get_linked_thumbnail(uint8_t *image_handle);
#ifdef __cplusplus
}
#endif

View File

@ -210,6 +210,28 @@ typedef enum {
ESP_BT_COD_MAJOR_DEV_UNCATEGORIZED = 31, /*!< Uncategorized: device not specified */
} esp_bt_cod_major_dev_t;
/// Minor device class field of Class of Device for Peripheral Major Class
typedef enum {
ESP_BT_COD_MINOR_PERIPHERAL_KEYBOARD = 0x10, /*!< Keyboard */
ESP_BT_COD_MINOR_PERIPHERAL_POINTING = 0x20, /*!< Pointing */
ESP_BT_COD_MINOR_PERIPHERAL_COMBO = 0x30, /*!< Combo
ESP_BT_COD_MINOR_PERIPHERAL_KEYBOARD, ESP_BT_COD_MINOR_PERIPHERAL_POINTING
and ESP_BT_COD_MINOR_PERIPHERAL_COMBO can be OR'd with one of the
following values to identify a multifunctional device. e.g.
ESP_BT_COD_MINOR_PERIPHERAL_KEYBOARD | ESP_BT_COD_MINOR_PERIPHERAL_GAMEPAD
ESP_BT_COD_MINOR_PERIPHERAL_POINTING | ESP_BT_COD_MINOR_PERIPHERAL_SENSING_DEVICE
*/
ESP_BT_COD_MINOR_PERIPHERAL_JOYSTICK = 0x01, /*!< Joystick */
ESP_BT_COD_MINOR_PERIPHERAL_GAMEPAD = 0x02, /*!< Gamepad */
ESP_BT_COD_MINOR_PERIPHERAL_REMOTE_CONTROL = 0x03, /*!< Remote Control */
ESP_BT_COD_MINOR_PERIPHERAL_SENSING_DEVICE = 0x04, /*!< Sensing Device */
ESP_BT_COD_MINOR_PERIPHERAL_DIGITIZING_TABLET = 0x05, /*!< Digitizing Tablet */
ESP_BT_COD_MINOR_PERIPHERAL_CARD_READER = 0x06, /*!< Card Reader */
ESP_BT_COD_MINOR_PERIPHERAL_DIGITAL_PAN = 0x07, /*!< Digital Pan */
ESP_BT_COD_MINOR_PERIPHERAL_HAND_SCANNER = 0x08, /*!< Hand Scanner */
ESP_BT_COD_MINOR_PERIPHERAL_HAND_GESTURAL_INPUT = 0x09, /*!< Hand Gestural Input */
} esp_bt_cod_minor_peripheral_t;
/// Bits of major device class field
#define ESP_BT_COD_MAJOR_DEV_BIT_MASK (0x1f00) /*!< Major device bit mask */
#define ESP_BT_COD_MAJOR_DEV_BIT_OFFSET (8) /*!< Major device bit offset */

View File

@ -242,6 +242,7 @@ typedef union {
*/
struct gatts_rsp_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t conn_id; /*!< Connection id */
uint16_t handle; /*!< Attribute handle which send response */
} rsp; /*!< Gatt server callback param of ESP_GATTS_RESPONSE_EVT */

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -14,123 +14,165 @@
extern "C" {
#endif
#define ESP_SDP_SERVER_NAME_MAX 32 /*!< Service name max length */
#define SDP_OPP_SUPPORTED_FORMATS_MAX_LENGTH 15 /*!< OPP supported format list maximum length */
#define ESP_SDP_SERVER_NAME_MAX 32 /*!< Service name max length */
#define SDP_OPP_SUPPORTED_FORMATS_MAX_LENGTH 15 /*!< OPP supported format list maximum length */
#define ESP_SDP_UUID_MAP_MAS 0x1132 /*!< Message Access Service UUID */
#define ESP_SDP_UUID_MAP_MNS 0x1133 /*!< Message Notification Service UUID */
#define ESP_SDP_UUID_PBAP_PSE 0x112F /*!< Phone Book Server Equipment UUID */
#define ESP_SDP_UUID_PBAP_PCE 0x112E /*!< Phone Book Client Equipment UUID */
#define ESP_SDP_UUID_OPP 0x1105 /*!< Object Push Profile UUID */
#define ESP_SDP_UUID_SAP 0x112D /*!< SIM Access Profile UUID */
#define ESP_SDP_UUID_DIP 0x1200 /*!< Device Identification Profile UUID */
#define ESP_SDP_BUILD_BT_UUID16(uuid16_val) \
(esp_bt_uuid_t) { .len = ESP_UUID_LEN_16, .uuid = {.uuid16 = (uint16_t)(uuid16_val),}, }
typedef enum {
ESP_SDP_SUCCESS = 0, /*!< Successful operation. */
ESP_SDP_FAILURE, /*!< Generic failure. */
ESP_SDP_NO_RESOURCE, /*!< No more resource */
ESP_SDP_NEED_INIT, /*!< SDP module shall init first */
ESP_SDP_NEED_DEINIT, /*!< SDP module shall deinit first */
ESP_SDP_NO_CREATE_RECORD, /*!< No record created */
ESP_SDP_SUCCESS = 0, /*!< Successful operation. */
ESP_SDP_FAILURE, /*!< Generic failure. */
ESP_SDP_NO_RESOURCE, /*!< No more resource */
ESP_SDP_NEED_INIT, /*!< SDP module shall init first */
ESP_SDP_NEED_DEINIT, /*!< SDP module shall deinit first */
ESP_SDP_NO_CREATE_RECORD, /*!< No record created */
} esp_sdp_status_t;
/**
* @brief SDP callback function events
*/
typedef enum {
ESP_SDP_INIT_EVT = 0, /*!< When SDP is initialized, the event comes */
ESP_SDP_DEINIT_EVT = 1, /*!< When SDP is deinitialized, the event comes */
ESP_SDP_SEARCH_COMP_EVT = 2, /*!< When SDP search complete, the event comes */
ESP_SDP_CREATE_RECORD_COMP_EVT = 3, /*!< When create SDP records complete, the event comes */
ESP_SDP_REMOVE_RECORD_COMP_EVT = 4, /*!< When remove a SDP record complete, the event comes */
ESP_SDP_INIT_EVT = 0, /*!< When SDP is initialized, the event comes */
ESP_SDP_DEINIT_EVT = 1, /*!< When SDP is de-initialized, the event comes */
ESP_SDP_SEARCH_COMP_EVT = 2, /*!< When SDP search complete, the event comes */
ESP_SDP_CREATE_RECORD_COMP_EVT = 3, /*!< When create SDP records complete, the event comes */
ESP_SDP_REMOVE_RECORD_COMP_EVT = 4, /*!< When remove a SDP record complete, the event comes */
} esp_sdp_cb_event_t;
/**
* @brief SDP record type
*/
typedef enum {
ESP_SDP_TYPE_RAW, /*!< Used to carry raw SDP search data for unknown UUIDs */
ESP_SDP_TYPE_MAP_MAS, /*!< Message Access Profile - Server */
ESP_SDP_TYPE_MAP_MNS, /*!< Message Access Profile - Client (Notification Server) */
ESP_SDP_TYPE_PBAP_PSE, /*!< Phone Book Profile - Server */
ESP_SDP_TYPE_PBAP_PCE, /*!< Phone Book Profile - Client */
ESP_SDP_TYPE_OPP_SERVER, /*!< Object Push Profile */
ESP_SDP_TYPE_SAP_SERVER /*!< SIM Access Profile */
ESP_SDP_TYPE_RAW, /*!< Used to carry raw SDP search data for unknown UUIDs */
ESP_SDP_TYPE_MAP_MAS, /*!< Message Access Profile - Server */
ESP_SDP_TYPE_MAP_MNS, /*!< Message Access Profile - Client (Notification Server) */
ESP_SDP_TYPE_PBAP_PSE, /*!< Phone Book Profile - Server */
ESP_SDP_TYPE_PBAP_PCE, /*!< Phone Book Profile - Client */
ESP_SDP_TYPE_OPP_SERVER, /*!< Object Push Profile */
ESP_SDP_TYPE_SAP_SERVER, /*!< SIM Access Profile */
ESP_SDP_TYPE_DIP_SERVER, /*!< Device Identification Profile */
} esp_bluetooth_sdp_types_t;
/**
* @brief Some signals need additional pointers, hence we introduce a
* generic way to handle these pointers.
* @brief SDP header structure
*/
typedef struct bluetooth_sdp_hdr_overlay {
esp_bluetooth_sdp_types_t type; /*!< SDP type */
esp_bt_uuid_t uuid; /*!< UUID type include uuid and uuid length */
uint32_t service_name_length; /*!< Service name length */
char *service_name; /*!< service name */
int32_t rfcomm_channel_number; /*!< rfcomm channel number, if not used set to -1*/
int32_t l2cap_psm; /*!< l2cap psm, if not used set to -1 */
int32_t profile_version; /*!< profile version */
// User pointers, only used for some signals - see esp_bluetooth_sdp_ops_record_t
int user1_ptr_len; /*!< see esp_bluetooth_sdp_ops_record_t */
uint8_t *user1_ptr; /*!< see esp_bluetooth_sdp_ops_record_t */
int user2_ptr_len; /*!< see esp_bluetooth_sdp_ops_record_t */
uint8_t *user2_ptr; /*!< see esp_bluetooth_sdp_ops_record_t */
esp_bluetooth_sdp_types_t type; /*!< SDP type */
esp_bt_uuid_t uuid; /*!< UUID type, include uuid and uuid length, only needed to be set for RAW record creation */
uint32_t service_name_length; /*!< Service name length */
char *service_name; /*!< Service name */
int32_t rfcomm_channel_number; /*!< RFCOMM channel number, if not used set to -1*/
int32_t l2cap_psm; /*!< L2CAP psm, if not used set to -1 */
int32_t profile_version; /*!< Profile version */
int user1_ptr_len; /*!< User data1 length, only used for searching RAW record */
uint8_t *user1_ptr; /*!< User data1 pointer to the raw SDP response data, only used for searching RAW record */
int user2_ptr_len __attribute__((deprecated)); /*!< User data2 length, only used for searching RAW record */
uint8_t *user2_ptr __attribute__((deprecated)); /*!< User data2 pointer, only used for searching RAW record */
} esp_bluetooth_sdp_hdr_overlay_t;
/**
* @brief Raw SDP record
*/
typedef struct bluetooth_sdp_raw_record {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
} esp_bluetooth_sdp_raw_record_t;
/**
* @brief Message Access Profile - Server parameters
*/
typedef struct bluetooth_sdp_mas_record {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
uint32_t mas_instance_id; /*!< MAS Instance ID */
uint32_t supported_features; /*!< Map supported features */
uint32_t supported_message_types; /*!< Supported message types */
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
uint32_t mas_instance_id; /*!< MAS Instance ID */
uint32_t supported_features; /*!< Map supported features */
uint32_t supported_message_types; /*!< Supported message types */
} esp_bluetooth_sdp_mas_record_t;
/**
* @brief Message Access Profile - Client (Notification Server) parameters
*/
typedef struct bluetooth_sdp_mns_record {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
uint32_t supported_features; /*!< Supported features */
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
uint32_t supported_features; /*!< Supported features */
} esp_bluetooth_sdp_mns_record_t;
/**
* @brief Phone Book Profile - Server parameters
*/
typedef struct bluetooth_sdp_pse_record {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
uint32_t supported_features; /*!< Pbap Supported Features */
uint32_t supported_repositories; /*!< Supported Repositories */
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
uint32_t supported_features; /*!< PBAP Supported Features */
uint32_t supported_repositories; /*!< Supported Repositories */
} esp_bluetooth_sdp_pse_record_t;
/**
* @brief Phone Book Profile - Client parameters
*/
typedef struct bluetooth_sdp_pce_record {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
} esp_bluetooth_sdp_pce_record_t;
/**
* @brief Object Push Profile parameters
*/
typedef struct bluetooth_sdp_ops_record {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
int supported_formats_list_len; /*!< Supported formats list length */
uint8_t supported_formats_list[SDP_OPP_SUPPORTED_FORMATS_MAX_LENGTH]; /*!< Supported formats list */
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
int supported_formats_list_len; /*!< Supported formats list length */
uint8_t supported_formats_list[SDP_OPP_SUPPORTED_FORMATS_MAX_LENGTH]; /*!< Supported formats list */
} esp_bluetooth_sdp_ops_record_t;
/**
* @brief SIM Access Profile parameters
*/
typedef struct bluetooth_sdp_sap_record {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
} esp_bluetooth_sdp_sap_record_t;
/**
* @brief Vendor ID source
*/
typedef enum {
ESP_SDP_VENDOR_ID_SRC_BT = 1, /*!< Bluetooth assigned vendor id source */
ESP_SDP_VENDOR_ID_SRC_USB = 2, /*!< USB assigned vendor id source */
} esp_sdp_vendor_id_source_t;
/**
* @brief Device Identification Profile parameters
*
* @note Only one primary Device Identification service record can be added in the SDP database. If primary
* Device Identification service is created multiple times, only the last one will take effect.
*/
typedef struct bluetooth_sdp_dip_record {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
uint16_t vendor; /*!< Vendor ID */
uint16_t vendor_id_source; /*!< Vendor ID source, 0x0001 for Bluetooth, 0x0002 for USB, other values reserved, see `esp_sdp_vendor_id_source_t` */
uint16_t product; /*!< Product ID */
uint16_t version; /*!< Release version in format 0xJJMN(JJ major number, M minor number, N sub-minor number) */
bool primary_record; /*!< Indicate if the record is primary, shall set to true if there is a only single device
record, others shall be set to false */
} esp_bluetooth_sdp_dip_record_t;
/**
* @brief SDP record parameters union
*/
typedef union {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
esp_bluetooth_sdp_mas_record_t mas; /*!< Message Access Profile - Server */
esp_bluetooth_sdp_mns_record_t mns; /*!< Message Access Profile - Client (Notification Server) */
esp_bluetooth_sdp_pse_record_t pse; /*!< Phone Book Profile - Server */
esp_bluetooth_sdp_pce_record_t pce; /*!< Phone Book Profile - Client */
esp_bluetooth_sdp_ops_record_t ops; /*!< Object Push Profile */
esp_bluetooth_sdp_sap_record_t sap; /*!< SIM Access Profile */
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
esp_bluetooth_sdp_raw_record_t raw; /*!< Raw SDP search data for unknown UUIDs */
esp_bluetooth_sdp_mas_record_t mas; /*!< Message Access Profile - Server */
esp_bluetooth_sdp_mns_record_t mns; /*!< Message Access Profile - Client (Notification Server) */
esp_bluetooth_sdp_pse_record_t pse; /*!< Phone Book Profile - Server */
esp_bluetooth_sdp_pce_record_t pce; /*!< Phone Book Profile - Client */
esp_bluetooth_sdp_ops_record_t ops; /*!< Object Push Profile */
esp_bluetooth_sdp_sap_record_t sap; /*!< SIM Access Profile */
esp_bluetooth_sdp_dip_record_t dip; /*!< Device Identification Profile */
} esp_bluetooth_sdp_record_t;
/**
@ -141,44 +183,43 @@ typedef union {
* @brief ESP_SDP_INIT_EVT
*/
struct sdp_init_evt_param {
esp_sdp_status_t status; /*!< status */
} init; /*!< SDP callback param of ESP_SDP_INIT_EVT */
esp_sdp_status_t status; /*!< Status */
} init; /*!< SDP callback param of ESP_SDP_INIT_EVT */
/**
* @brief ESP_SDP_DEINIT_EVT
*/
struct sdp_deinit_evt_param {
esp_sdp_status_t status; /*!< status */
} deinit; /*!< SDP callback param of ESP_SDP_DEINIT_EVT */
esp_sdp_status_t status; /*!< Status */
} deinit; /*!< SDP callback param of ESP_SDP_DEINIT_EVT */
/**
* @brief ESP_SDP_SEARCH_COMP_EVT
*/
struct sdp_search_evt_param {
esp_sdp_status_t status; /*!< status */
esp_bd_addr_t remote_addr; /*!< remote device address */
esp_bt_uuid_t sdp_uuid; /*!< service uuid */
int record_count; /*!< Number of SDP records */
esp_bluetooth_sdp_record_t *records;/*!< SDP records */
} search; /*!< SDP callback param of ESP_SDP_SEARCH_COMP_EVT */
esp_sdp_status_t status; /*!< Status */
esp_bd_addr_t remote_addr; /*!< Remote device address */
esp_bt_uuid_t sdp_uuid; /*!< Service uuid */
int record_count; /*!< Number of SDP records */
esp_bluetooth_sdp_record_t *records; /*!< SDP records */
} search; /*!< SDP callback param of ESP_SDP_SEARCH_COMP_EVT */
/**
* @brief ESP_SDP_CREATE_RECORD_COMP_EVT
*/
struct sdp_crate_record_evt_param {
esp_sdp_status_t status; /*!< status */
int record_handle; /*!< SDP record handle */
} create_record; /*!< SDP callback param of ESP_SDP_CREATE_RECORD_COMP_EVT */
struct sdp_create_record_evt_param {
esp_sdp_status_t status; /*!< Status */
int record_handle; /*!< SDP record handle */
} create_record; /*!< SDP callback param of ESP_SDP_CREATE_RECORD_COMP_EVT */
/**
* @brief ESP_SDP_REMOVE_RECORD_COMP_EVT
*/
struct sdp_remove_record_evt_param {
esp_sdp_status_t status; /*!< status */
} remove_record; /*!< SDP callback param of ESP_SDP_REMOVE_RECORD_COMP_EVT */
} esp_sdp_cb_param_t; /*!< SDP callback parameter union type */
esp_sdp_status_t status; /*!< Status */
} remove_record; /*!< SDP callback param of ESP_SDP_REMOVE_RECORD_COMP_EVT */
} esp_sdp_cb_param_t;
/**
* @brief SDP callback function type.

View File

@ -37,6 +37,10 @@
#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
#include "bta/bta_ar_api.h"
#endif
#if BTA_AV_CA_INCLUDED
#include "stack/goep_common.h"
#include "stack/goepc_api.h"
#endif
#define LOG_TAG "bt_bta_av"
// #include "osi/include/log.h"
@ -98,6 +102,10 @@ void bta_av_del_rc(tBTA_AV_RCB *p_rcb)
p_scb = NULL;
if (p_rcb->handle != BTA_AV_RC_HANDLE_NONE) {
#if BTA_AV_CA_INCLUDED
/* reset cover art state */
bta_av_ca_reset(p_rcb);
#endif
if (p_rcb->shdl) {
/* Validate array index*/
if ((p_rcb->shdl - 1) < BTA_AV_NUM_STRS) {
@ -127,9 +135,6 @@ void bta_av_del_rc(tBTA_AV_RCB *p_rcb)
}
/* else ACP && connected. do not clear the handle yet */
AVRC_Close(rc_handle);
if (rc_handle == bta_av_cb.rc_acp_handle) {
bta_av_cb.rc_acp_handle = BTA_AV_RC_HANDLE_NONE;
}
APPL_TRACE_EVENT("end del_rc handle: %d status=0x%x, rc_acp_handle:%d, lidx:%d",
p_rcb->handle, p_rcb->status, bta_av_cb.rc_acp_handle, p_rcb->lidx);
}
@ -302,7 +307,7 @@ UINT8 bta_av_rc_create(tBTA_AV_CB *p_cb, UINT8 role, UINT8 shdl, UINT8 lidx)
bda = p_scb->peer_addr;
status = BTA_AV_RC_ROLE_INT;
} else {
if ((p_rcb = bta_av_get_rcb_by_shdl(shdl)) != NULL ) {
if (shdl != 0 && ((p_rcb = bta_av_get_rcb_by_shdl(shdl)) != NULL)) {
APPL_TRACE_ERROR("bta_av_rc_create ACP handle exist for shdl:%d", shdl);
return p_rcb->handle;
}
@ -1143,7 +1148,7 @@ void bta_av_conn_chg(tBTA_AV_DATA *p_data)
p_data->conn_chg.peer_addr[5]);
if (p_lcb_rc->conn_msk && bdcmp(p_lcb_rc->addr, p_data->conn_chg.peer_addr) == 0) {
/* AVRCP is already connected.
* need to update the association betwen SCB and RCB */
* need to update the association between SCB and RCB */
p_lcb_rc->conn_msk = 0; /* indicate RC ONLY is not connected */
p_lcb_rc->lidx = 0;
p_scb->rc_handle = p_cb->rc_acp_handle;
@ -1484,6 +1489,51 @@ static void bta_av_acp_sig_timer_cback (TIMER_LIST_ENT *p_tle)
}
}
#if BTA_AV_CA_INCLUDED
/*******************************************************************************
**
** Function bta_av_extra_tg_cover_art_l2cap_psm
**
** Description Extra the AVRC Cover Art L2CAP PSM of peer device from the
** SDP record
**
** Returns void
**
*******************************************************************************/
static UINT16 bta_av_extra_tg_cover_art_l2cap_psm(void)
{
tBTA_AV_CB *p_cb = &bta_av_cb;
tSDP_DISC_REC *p_rec = NULL;
tSDP_DISC_ATTR *p_add_prot_desc, *p_prot_desc;
tSDP_PROTOCOL_ELEM elem_l2cap, elem_obex;
UINT16 l2cap_psm = 0;
while (TRUE) {
/* get next record; if none found, we're done */
if ((p_rec = SDP_FindServiceInDb(p_cb->p_disc_db, UUID_SERVCLASS_AV_REM_CTRL_TARGET, p_rec)) == NULL) {
break;
}
p_add_prot_desc = SDP_FindAttributeInRec(p_rec, ATTR_ID_ADDITION_PROTO_DESC_LISTS);
if ((p_add_prot_desc != NULL) && (SDP_DISC_ATTR_TYPE(p_add_prot_desc->attr_len_type) == DATA_ELE_SEQ_DESC_TYPE)) {
/* Walk through all protocol descriptor list */
for (p_prot_desc = p_add_prot_desc->attr_value.v.p_sub_attr; p_prot_desc; p_prot_desc = p_prot_desc->p_next_attr) {
if(SDP_FindProtocolListElem(p_prot_desc, UUID_PROTOCOL_L2CAP, &elem_l2cap)
&& SDP_FindProtocolListElem(p_prot_desc, UUID_PROTOCOL_OBEX, &elem_obex))
{
/* found */
l2cap_psm = elem_l2cap.params[0];
break;
}
}
}
}
return l2cap_psm;
}
#endif /* BTA_AV_CA_INCLUDED */
/*******************************************************************************
**
** Function bta_av_check_peer_rc_features
@ -1539,6 +1589,10 @@ tBTA_AV_FEAT bta_av_check_peer_rc_features (UINT16 service_uuid, UINT16 *rc_feat
if (categories & AVRC_SUPF_CT_BROWSE) {
peer_features |= (BTA_AV_FEAT_BROWSE);
}
if ((service_uuid == UUID_SERVCLASS_AV_REM_CTRL_TARGET) && (categories & AVRC_SUPF_TG_COVER_ART)) {
/* remote target support cover art */
peer_features |= BTA_AV_FEAT_COVER_ART;
}
}
}
}
@ -1573,6 +1627,9 @@ void bta_av_rc_disc_done(tBTA_AV_DATA *p_data)
tBTA_AV_FEAT peer_features; /* peer features mask */
UINT16 peer_ct_features; /* peer features mask as controller */
UINT16 peer_tg_features; /* peer features mask as target */
#if BTA_AV_CA_INCLUDED
UINT16 obex_l2cap_psm = 0; /* target obex l2cap psm */
#endif
UNUSED(p_data);
APPL_TRACE_DEBUG("bta_av_rc_disc_done disc:x%x", p_cb->disc);
@ -1600,7 +1657,11 @@ void bta_av_rc_disc_done(tBTA_AV_DATA *p_data)
/* check peer version and whether support CT and TG role */
peer_features = bta_av_check_peer_rc_features (UUID_SERVCLASS_AV_REMOTE_CONTROL, &peer_ct_features);
peer_features |= bta_av_check_peer_rc_features (UUID_SERVCLASS_AV_REM_CTRL_TARGET, &peer_tg_features);
#if BTA_AV_CA_INCLUDED
if (peer_features & BTA_AV_FEAT_COVER_ART) {
obex_l2cap_psm = bta_av_extra_tg_cover_art_l2cap_psm();
}
#endif
p_cb->disc = 0;
utl_freebuf((void **) &p_cb->p_disc_db);
@ -1618,6 +1679,9 @@ void bta_av_rc_disc_done(tBTA_AV_DATA *p_data)
p_cb->rcb[rc_handle].peer_features = peer_features;
p_cb->rcb[rc_handle].peer_ct_features = peer_ct_features;
p_cb->rcb[rc_handle].peer_tg_features = peer_tg_features;
#if BTA_AV_CA_INCLUDED
p_cb->rcb[rc_handle].cover_art_l2cap_psm = obex_l2cap_psm;
#endif
}
#if (BT_USE_TRACES == TRUE || BT_TRACE_APPL == TRUE)
else {
@ -1636,6 +1700,11 @@ void bta_av_rc_disc_done(tBTA_AV_DATA *p_data)
}
} else {
p_cb->rcb[rc_handle].peer_features = peer_features;
p_cb->rcb[rc_handle].peer_ct_features = peer_ct_features;
p_cb->rcb[rc_handle].peer_tg_features = peer_tg_features;
#if BTA_AV_CA_INCLUDED
p_cb->rcb[rc_handle].cover_art_l2cap_psm = obex_l2cap_psm;
#endif
rc_feat.rc_handle = rc_handle;
rc_feat.peer_features = peer_features;
rc_feat.peer_ct_features = peer_ct_features;
@ -1676,6 +1745,10 @@ void bta_av_rc_closed(tBTA_AV_DATA *p_data)
p_rcb->peer_features = 0;
p_rcb->peer_ct_features = 0;
p_rcb->peer_tg_features = 0;
#if BTA_AV_CA_INCLUDED
/* reset cover art state */
bta_av_ca_reset(p_rcb);
#endif
APPL_TRACE_DEBUG(" shdl:%d, lidx:%d", p_rcb->shdl, p_rcb->lidx);
if (p_rcb->shdl) {
if ((p_rcb->shdl - 1) < BTA_AV_NUM_STRS) {
@ -1711,7 +1784,8 @@ void bta_av_rc_closed(tBTA_AV_DATA *p_data)
bta_av_del_rc(p_rcb);
/* if the AVRCP is no longer listening, create the listening channel */
if (bta_av_cb.rc_acp_handle == BTA_AV_RC_HANDLE_NONE && bta_av_cb.features & BTA_AV_FEAT_RCTG) {
if (bta_av_cb.rc_acp_handle == p_msg->handle && bta_av_cb.features & BTA_AV_FEAT_RCTG) {
bta_av_cb.rc_acp_handle = BTA_AV_RC_HANDLE_NONE;
bta_av_rc_create(&bta_av_cb, AVCT_ACP, 0, BTA_AV_NUM_LINKS + 1);
}
}
@ -1748,6 +1822,7 @@ void bta_av_rc_disc(UINT8 disc)
tAVRC_SDP_DB_PARAMS db_params;
UINT16 attr_list[] = {ATTR_ID_SERVICE_CLASS_ID_LIST,
ATTR_ID_BT_PROFILE_DESC_LIST,
ATTR_ID_ADDITION_PROTO_DESC_LISTS,
ATTR_ID_SUPPORTED_FEATURES
};
UINT8 hdi;
@ -1785,7 +1860,7 @@ void bta_av_rc_disc(UINT8 disc)
if (p_cb->p_disc_db) {
/* set up parameters */
db_params.db_len = BTA_AV_DISC_BUF_SIZE;
db_params.num_attr = 3;
db_params.num_attr = 4;
db_params.p_db = p_cb->p_disc_db;
db_params.p_attrs = attr_list;

View File

@ -613,4 +613,77 @@ void BTA_AvMetaCmd(UINT8 rc_handle, UINT8 label, tBTA_AV_CMD cmd_code, BT_HDR *p
}
}
#if BTA_AV_CA_INCLUDED
/*******************************************************************************
**
** Function BTA_AvCaOpen
**
** Description Open a Cover Art OBEX connection to peer device. This function
** can only be used if peer device TG support Cover Art feature and
** AV is enabled with feature BTA_AV_FEAT_METADATA.
**
** Returns void
**
*******************************************************************************/
void BTA_AvCaOpen(UINT8 rc_handle, UINT16 mtu)
{
tBTA_AV_API_CA_OPEN *p_buf;
if ((p_buf = (tBTA_AV_API_CA_OPEN *) osi_malloc(sizeof(tBTA_AV_API_CA_OPEN))) != NULL) {
p_buf->hdr.event = BTA_AV_API_CA_OPEN_EVT;
p_buf->hdr.layer_specific = rc_handle;
p_buf->mtu = mtu;
bta_sys_sendmsg(p_buf);
}
}
/*******************************************************************************
**
** Function BTA_AvCaClose
**
** Description Close a Cover Art OBEX connection.
**
** Returns void
**
*******************************************************************************/
void BTA_AvCaClose(UINT8 rc_handle)
{
tBTA_AV_API_CA_CLOSE *p_buf;
if ((p_buf = (tBTA_AV_API_CA_CLOSE *) osi_malloc(sizeof(tBTA_AV_API_CA_CLOSE))) != NULL) {
p_buf->hdr.event = BTA_AV_API_CA_CLOSE_EVT;
p_buf->hdr.layer_specific = rc_handle;
bta_sys_sendmsg(p_buf);
}
}
/*******************************************************************************
**
** Function BTA_AvCaGet
**
** Description Start the process to get image properties, get image or get
** linked thumbnail. This function can only be used if Cover Art
** OBEX connection is established.
**
** Returns void
**
*******************************************************************************/
void BTA_AvCaGet(UINT8 rc_handle, tBTA_AV_GET_TYPE type, UINT8 *image_handle, UINT8 *image_descriptor, UINT16 image_descriptor_len)
{
tBTA_AV_API_CA_GET *p_buf;
if ((p_buf = (tBTA_AV_API_CA_GET *) osi_malloc(sizeof(tBTA_AV_API_CA_GET))) != NULL) {
p_buf->hdr.event = BTA_AV_API_CA_GET_EVT;
p_buf->hdr.layer_specific = rc_handle;
p_buf->type = type;
memcpy(p_buf->image_handle, image_handle, BTA_AV_CA_IMG_HDL_LEN);
p_buf->image_descriptor = image_descriptor;
p_buf->image_descriptor_len = image_descriptor_len;
bta_sys_sendmsg(p_buf);
}
}
#endif /* BTA_AV_CA_INCLUDED */
#endif /* BTA_AV_INCLUDED */

View File

@ -0,0 +1,495 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "common/bt_target.h"
#if BTA_AV_CA_INCLUDED
#include <string.h>
#include "bta/bta_av_api.h"
#include "bta_av_int.h"
#include "stack/avdt_api.h"
#include "bta/utl.h"
#include "stack/l2c_api.h"
#include "osi/allocator.h"
#include "osi/list.h"
#include "stack/goep_common.h"
#include "stack/goepc_api.h"
#include "stack/obex_api.h"
#include "common/bt_trace.h"
#define COVER_ART_HEADER_ID_IMG_HANDLE 0x30
#define COVER_ART_HEADER_ID_IMG_DESCRIPTOR 0x71
static const UINT8 cover_art_uuid[16] = {0x71, 0x63, 0xDD, 0x54, 0x4A, 0x7E, 0x11, 0xE2, 0xB4, 0x7C, 0x00, 0x50, 0xC2, 0x49, 0x00, 0x48};
static const char *cover_art_img_type_img = "x-bt/img-img";
static const char *cover_art_img_type_thm = "x-bt/img-thm";
static const char *cover_art_img_type_prop = "x-bt/img-properties";
#define COVER_ART_IMG_TYPE_IMG_LEN 13
#define COVER_ART_IMG_TYPE_THM_LEN 13
#define COVER_ART_IMG_TYPE_PROP_LEN 20
static BOOLEAN find_rcb_idx_by_goep_handle(UINT16 handle, UINT16 *out_idx)
{
for (UINT16 i = 0; i < BTA_AV_NUM_RCB; ++i) {
if (bta_av_cb.rcb[i].handle != BTA_AV_RC_HANDLE_NONE && bta_av_cb.rcb[i].cover_art_goep_hdl == handle) {
*out_idx = i;
return TRUE;
}
}
return FALSE;
}
static UINT8 get_rcb_idx(tBTA_AV_RCB *p_rcb)
{
return (p_rcb - &bta_av_cb.rcb[0]);
}
static void get_peer_bd_addr(tBTA_AV_RCB *p_rcb, BD_ADDR out_addr)
{
/* check if this rcb is related to a scb */
if (p_rcb->shdl && p_rcb->shdl <= BTA_AV_NUM_STRS) {
tBTA_AV_SCB *p_scb = bta_av_cb.p_scb[p_rcb->shdl - 1];
bdcpy(out_addr, p_scb->peer_addr);
}
/* else, try get peer addr from lcb */
else if (p_rcb->lidx && p_rcb->lidx <= BTA_AV_NUM_LINKS + 1)
{
bdcpy(out_addr, bta_av_cb.lcb[p_rcb->lidx-1].addr);
}
}
static void report_data_event(BT_HDR *pkt, UINT8 *p_data, UINT16 data_len, BOOLEAN final)
{
tBTA_AV_CA_DATA ca_data;
ca_data.status = BT_STATUS_SUCCESS;
ca_data.final = final;
ca_data.data_len = data_len;
ca_data.p_data = p_data;
ca_data.p_hdr = pkt;
(*bta_av_cb.p_cback)(BTA_AV_CA_DATA_EVT, (tBTA_AV *) &ca_data);
}
static void report_error_data_event(UINT16 status)
{
tBTA_AV_CA_DATA ca_data;
ca_data.status = status;
ca_data.final = TRUE;
ca_data.data_len = 0;
ca_data.p_data = NULL;
ca_data.p_hdr = NULL;
(*bta_av_cb.p_cback)(BTA_AV_CA_DATA_EVT, (tBTA_AV *) &ca_data);
}
static void build_and_send_connect_req(tBTA_AV_RCB *p_rcb)
{
tOBEX_PARSE_INFO info = {0};
info.opcode = OBEX_OPCODE_CONNECT;
info.obex_version_number = 0x15;
info.max_packet_length = p_rcb->cover_art_max_rx;
/* before OBEX connect response, we dont know cover_art_max_tx, use BT_SMALL_BUFFER_SIZE as tx buff size */
if (GOEPC_PrepareRequest(p_rcb->cover_art_goep_hdl, &info, BT_SMALL_BUFFER_SIZE) == GOEP_SUCCESS) {
GOEPC_RequestAddHeader(p_rcb->cover_art_goep_hdl, OBEX_HEADER_ID_TARGET, (UINT8 *)cover_art_uuid, 16);
GOEPC_SendRequest(p_rcb->cover_art_goep_hdl);
}
}
static void build_and_send_disconnect_req(tBTA_AV_RCB *p_rcb)
{
tOBEX_PARSE_INFO info = {0};
info.opcode = OBEX_OPCODE_DISCONNECT;
if (GOEPC_PrepareRequest(p_rcb->cover_art_goep_hdl, &info, BT_SMALL_BUFFER_SIZE) == GOEP_SUCCESS) {
GOEPC_RequestAddHeader(p_rcb->cover_art_goep_hdl, OBEX_HEADER_ID_CONNECTION_ID, (UINT8 *)(&p_rcb->cover_art_cid), 4);
GOEPC_SendRequest(p_rcb->cover_art_goep_hdl);
}
}
static void build_and_send_empty_get_req(tBTA_AV_RCB *p_rcb)
{
tOBEX_PARSE_INFO info = {0};
info.opcode = OBEX_OPCODE_GET_FINAL;
/* empty get request, use a small buff size */
UINT16 tx_buff_size = BT_SMALL_BUFFER_SIZE < p_rcb->cover_art_max_tx ? BT_SMALL_BUFFER_SIZE : p_rcb->cover_art_max_tx;
if (GOEPC_PrepareRequest(p_rcb->cover_art_goep_hdl, &info, tx_buff_size) == GOEP_SUCCESS) {
GOEPC_RequestAddHeader(p_rcb->cover_art_goep_hdl, OBEX_HEADER_ID_CONNECTION_ID, (UINT8 *)(&p_rcb->cover_art_cid), 4);
GOEPC_SendRequest(p_rcb->cover_art_goep_hdl);
}
}
static void close_goepc_and_disconnect(tBTA_AV_RCB *p_rcb)
{
if (p_rcb->cover_art_goep_hdl) {
GOEPC_Close(p_rcb->cover_art_goep_hdl);
}
p_rcb->cover_art_goep_hdl = 0;
p_rcb->cover_art_cid = 0;
p_rcb->cover_art_max_tx = 0;
p_rcb->cover_art_max_rx = 0;
tBTA_AV_DATA *p_data = (tBTA_AV_DATA *) osi_malloc(sizeof(tBTA_AV_DATA));
if (p_data == NULL) {
assert(0);
}
p_data->hdr.event = BTA_AV_CA_GOEP_DISCONNECT_EVT;
p_data->hdr.layer_specific = get_rcb_idx(p_rcb);
p_data->ca_disconnect.reason = BT_STATUS_FAIL;
bta_sys_sendmsg(p_data);
}
static void image_handle_to_utf16(const UINT8 *image_handle, UINT8 *buffer)
{
UINT8 pos = 0;
for (int i = 0 ; i < BTA_AV_CA_IMG_HDL_LEN ; i++){
buffer[pos++] = 0;
buffer[pos++] = image_handle[i];
}
buffer[pos++] = 0;
buffer[pos++] = 0;
}
void bta_av_ca_goep_event_handler(UINT16 handle, UINT8 event, tGOEPC_MSG *p_msg)
{
tBTA_AV_DATA *p_data = NULL;
UINT16 rcb_idx;
if (!find_rcb_idx_by_goep_handle(handle, &rcb_idx)) {
/* can not find a rcb, go error */
goto error;
}
if (event == GOEPC_RESPONSE_EVT || event == GOEPC_OPENED_EVT || event == GOEPC_CLOSED_EVT) {
p_data = (tBTA_AV_DATA *) osi_malloc(sizeof(tBTA_AV_DATA));
assert(p_data != NULL);
}
switch (event)
{
case GOEPC_OPENED_EVT:
p_data->hdr.layer_specific = rcb_idx;
p_data->hdr.event = BTA_AV_CA_GOEP_CONNECT_EVT;
p_data->ca_connect.max_rx = p_msg->opened.our_mtu;
break;
case GOEPC_CLOSED_EVT:
p_data->hdr.layer_specific = rcb_idx;
p_data->hdr.event = BTA_AV_CA_GOEP_DISCONNECT_EVT;
p_data->ca_disconnect.reason = BT_STATUS_FAIL;
break;
case GOEPC_RESPONSE_EVT:
p_data->hdr.layer_specific = rcb_idx;
p_data->ca_response.pkt = p_msg->response.pkt;
p_data->ca_response.opcode = p_msg->response.opcode;
p_data->ca_response.srm_en = p_msg->response.srm_en;
p_data->ca_response.srm_wait = p_msg->response.srm_wait;
if (p_msg->response.final) {
p_data->hdr.event = BTA_AV_CA_RESPONSE_FINAL_EVT;
}
else {
p_data->hdr.event = BTA_AV_CA_RESPONSE_EVT;
}
break;
case GOEPC_MTU_CHANGED_EVT:
case GOEPC_CONGEST_EVT:
case GOEPC_UNCONGEST_EVT:
/* ignore these event */
break;
default:
goto error;
break;
}
if (p_data) {
bta_sys_sendmsg(p_data);
}
return;
error:
/* can not find rcb, just free resource and disconnect */
if (p_data != NULL) {
osi_free(p_data);
}
if (event == GOEPC_RESPONSE_EVT && p_msg->response.pkt != NULL) {
osi_free(p_msg->response.pkt);
}
if (event != GOEPC_CLOSED_EVT) {
GOEPC_Close(handle);
}
}
void bta_av_ca_api_open(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data)
{
tOBEX_SVR_INFO svr = {0};
svr.tl = OBEX_OVER_L2CAP;
svr.l2cap.psm = p_rcb->cover_art_l2cap_psm;
svr.l2cap.pref_mtu = p_data->api_ca_open.mtu;
/* reuse the security mask store in bta_av_cb, when support multi connection, this may need change */
svr.l2cap.sec_mask = bta_av_cb.sec_mask;
p_rcb->cover_art_max_rx = p_data->api_ca_open.mtu;
get_peer_bd_addr(p_rcb, svr.l2cap.addr);
if (GOEPC_Open(&svr, bta_av_ca_goep_event_handler, &p_rcb->cover_art_goep_hdl) != GOEP_SUCCESS) {
/* open failed */
if ((p_data = (tBTA_AV_DATA *) osi_malloc(sizeof(tBTA_AV_DATA))) == NULL) {
assert(0);
}
p_data->hdr.event = BTA_AV_CA_GOEP_DISCONNECT_EVT;
p_data->hdr.layer_specific = get_rcb_idx(p_rcb);
p_data->ca_disconnect.reason = BT_STATUS_FAIL;
bta_sys_sendmsg(p_data);
}
}
void bta_av_ca_api_close(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data)
{
/* this is a normal disconnect, just build and send OBEX disconnect request */
build_and_send_disconnect_req(p_rcb);
}
void bta_av_ca_api_get(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data)
{
tOBEX_PARSE_INFO info = {0};
UINT8 image_handle_utf16[BTA_AV_CA_IMG_HDL_UTF16_LEN];
info.opcode = OBEX_OPCODE_GET_FINAL;
/* limit the tx buff size to BT_DEFAULT_BUFFER_SIZE */
UINT16 tx_buff_size = BT_DEFAULT_BUFFER_SIZE < p_rcb->cover_art_max_tx ? BT_DEFAULT_BUFFER_SIZE : p_rcb->cover_art_max_tx;
if (GOEPC_PrepareRequest(p_rcb->cover_art_goep_hdl, &info, tx_buff_size) != GOEP_SUCCESS) {
/* something error */
goto error;
}
GOEPC_RequestAddHeader(p_rcb->cover_art_goep_hdl, OBEX_HEADER_ID_CONNECTION_ID, (UINT8 *)(&p_rcb->cover_art_cid), 4);
switch (p_data->api_ca_get.type)
{
case BTA_AV_CA_GET_IMAGE_PROPERTIES:
GOEPC_RequestAddHeader(p_rcb->cover_art_goep_hdl, OBEX_HEADER_ID_TYPE, (const UINT8 *)cover_art_img_type_prop, COVER_ART_IMG_TYPE_PROP_LEN);
break;
case BTA_AV_CA_GET_IMAGE:
GOEPC_RequestAddHeader(p_rcb->cover_art_goep_hdl, OBEX_HEADER_ID_TYPE, (const UINT8 *)cover_art_img_type_img, COVER_ART_IMG_TYPE_IMG_LEN);
break;
case BTA_AV_CA_GET_LINKED_THUMBNAIL:
GOEPC_RequestAddHeader(p_rcb->cover_art_goep_hdl, OBEX_HEADER_ID_TYPE, (const UINT8 *)cover_art_img_type_thm, COVER_ART_IMG_TYPE_THM_LEN);
break;
default:
/* should not go here */
assert(0);
break;
}
image_handle_to_utf16(p_data->api_ca_get.image_handle, image_handle_utf16);
GOEPC_RequestAddHeader(p_rcb->cover_art_goep_hdl, COVER_ART_HEADER_ID_IMG_HANDLE, (UINT8 *)image_handle_utf16, BTA_AV_CA_IMG_HDL_UTF16_LEN);
if (p_data->api_ca_get.type == BTA_AV_CA_GET_IMAGE) {
GOEPC_RequestAddHeader(p_rcb->cover_art_goep_hdl, COVER_ART_HEADER_ID_IMG_DESCRIPTOR, (UINT8 *)p_data->api_ca_get.image_descriptor, p_data->api_ca_get.image_descriptor_len);
}
/* always request to enable srm */
GOEPC_RequestSetSRM(p_rcb->cover_art_goep_hdl, TRUE, FALSE);
if (GOEPC_SendRequest(p_rcb->cover_art_goep_hdl) != GOEP_SUCCESS) {
goto error;
}
return;
error:
close_goepc_and_disconnect(p_rcb);
}
void bta_av_ca_response(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data)
{
tOBEX_PARSE_INFO info;
OBEX_ParseResponse(p_data->ca_response.pkt, p_data->ca_response.opcode, &info);
/* we always use a final get */
if (p_data->ca_response.opcode == OBEX_OPCODE_GET_FINAL
&& (info.response_code == OBEX_RESPONSE_CODE_CONTINUE || info.response_code == (OBEX_RESPONSE_CODE_CONTINUE | OBEX_FINAL_BIT_MASK)))
{
UINT8 *header = NULL;
UINT8 *body_data = NULL;
UINT16 body_data_len = 0;
while((header = OBEX_GetNextHeader(p_data->ca_response.pkt, &info)) != NULL) {
switch (*header)
{
case OBEX_HEADER_ID_BODY:
/* actually,END_OF_BODY should not in this continue response */
case OBEX_HEADER_ID_END_OF_BODY:
if (body_data == NULL) {
/* first body header */
body_data = header + 3; /* skip opcode, length */
body_data_len = OBEX_GetHeaderLength(header) - 3;
}
else {
/* another body header found */
report_data_event(NULL, body_data, body_data_len, FALSE);
body_data = header + 3; /* skip opcode, length */
body_data_len = OBEX_GetHeaderLength(header) - 3;
}
break;
default:
break;
}
}
if (body_data != NULL) {
/* the only one or the last body data */
report_data_event(p_data->ca_response.pkt, body_data, body_data_len, FALSE);
}
else {
/* not any body data */
osi_free(p_data->ca_response.pkt);
}
/* if SRM not enable, we need to send a empty get request */
if (!p_data->ca_response.srm_en || p_data->ca_response.srm_wait) {
build_and_send_empty_get_req(p_rcb);
}
}
else {
osi_free(p_data->ca_response.pkt);
goto error;
}
return;
error:
close_goepc_and_disconnect(p_rcb);
}
void bta_av_ca_response_final(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data)
{
tOBEX_PARSE_INFO info;
OBEX_ParseResponse(p_data->ca_response.pkt, p_data->ca_response.opcode, &info);
UINT8 *header = NULL;
if (p_data->ca_response.opcode == OBEX_OPCODE_CONNECT) {
/* we expect a success response code with final bit set */
if (info.response_code == (OBEX_RESPONSE_CODE_OK | OBEX_FINAL_BIT_MASK)) {
if (info.max_packet_length < 255) {
p_rcb->cover_art_max_tx = 255;
}
else {
p_rcb->cover_art_max_tx = info.max_packet_length;
}
BOOLEAN cid_found = false;
while((header = OBEX_GetNextHeader(p_data->ca_response.pkt, &info)) != NULL) {
if (*header == OBEX_HEADER_ID_CONNECTION_ID) {
cid_found = true;
memcpy((UINT8 *)(&p_rcb->cover_art_cid), header + 1, 4);
break;
}
}
if (!cid_found) {
goto error;
}
tBTA_AV_CA_STATUS ca_status;
ca_status.connected = TRUE;
ca_status.reason = BT_STATUS_SUCCESS;
(*bta_av_cb.p_cback)(BTA_AV_CA_STATUS_EVT, (tBTA_AV *) &ca_status);
/* done, free response packet */
osi_free(p_data->ca_response.pkt);
}
else {
osi_free(p_data->ca_response.pkt);
goto error;
}
}
else if (p_data->ca_response.opcode == OBEX_OPCODE_GET_FINAL) {
UINT8 *body_data = NULL;
UINT16 body_data_len = 0;
/* check response code is success */
if (info.response_code == (OBEX_RESPONSE_CODE_OK | OBEX_FINAL_BIT_MASK)) {
while((header = OBEX_GetNextHeader(p_data->ca_response.pkt, &info)) != NULL) {
switch (*header)
{
/* actually, BODY should not in this final response */
case OBEX_HEADER_ID_BODY:
case OBEX_HEADER_ID_END_OF_BODY:
if (body_data == NULL) {
/* first body header */
body_data = header + 3; /* skip opcode, length */
body_data_len = OBEX_GetHeaderLength(header) - 3;
}
else {
/* another body header found */
report_data_event(NULL, body_data, body_data_len, FALSE);
body_data = header + 3; /* skip opcode, length */
body_data_len = OBEX_GetHeaderLength(header) - 3;
}
break;
default:
break;
}
}
if (body_data != NULL) {
/* the only one or the last body data, packet will be free by upper layer */
report_data_event(p_data->ca_response.pkt, body_data, body_data_len, TRUE);
}
else {
/* not any body data */
osi_free(p_data->ca_response.pkt);
}
}
else {
report_error_data_event(BT_STATUS_FAIL);
osi_free(p_data->ca_response.pkt);
}
}
else if (p_data->ca_response.opcode == OBEX_OPCODE_DISCONNECT) {
/* received disconnect response, close l2cap channel and reset cover art value */
bta_av_ca_force_disconnect(p_rcb, p_data);
osi_free(p_data->ca_response.pkt);
}
else {
osi_free(p_data->ca_response.pkt);
goto error;
}
return;
error:
close_goepc_and_disconnect(p_rcb);
}
void bta_av_ca_goep_connect(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data)
{
/* goep connection open, use a smaller value as max_rx */
if (p_rcb->cover_art_max_rx > p_data->ca_connect.max_rx) {
p_rcb->cover_art_max_rx = p_data->ca_connect.max_rx;
}
build_and_send_connect_req(p_rcb);
}
void bta_av_ca_goep_disconnect(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data)
{
p_rcb->cover_art_goep_hdl = 0;
p_rcb->cover_art_max_rx = 0;
p_rcb->cover_art_max_tx = 0;
p_rcb->cover_art_cid = 0;
tBTA_AV_CA_STATUS ca_status;
ca_status.connected = FALSE;
ca_status.reason = p_data->ca_disconnect.reason;
(*bta_av_cb.p_cback)(BTA_AV_CA_STATUS_EVT, (tBTA_AV *) &ca_status);
}
void bta_av_ca_force_disconnect(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data)
{
if (p_rcb->cover_art_goep_hdl) {
GOEPC_Close(p_rcb->cover_art_goep_hdl);
}
/* dont reset p_rcb->cover_art_l2cap_psm */
p_rcb->cover_art_goep_hdl = 0;
p_rcb->cover_art_cid = 0;
p_rcb->cover_art_max_tx = 0;
p_rcb->cover_art_max_rx = 0;
tBTA_AV_CA_STATUS ca_status;
ca_status.connected = FALSE;
/* force disconnect by upper, set reason to success */
ca_status.reason = BT_STATUS_SUCCESS;
(*bta_av_cb.p_cback)(BTA_AV_CA_STATUS_EVT, (tBTA_AV *) &ca_status);
}
void bta_av_ca_reset(tBTA_AV_RCB *p_rcb)
{
if (p_rcb->cover_art_goep_hdl) {
GOEPC_Close(p_rcb->cover_art_goep_hdl);
}
p_rcb->cover_art_l2cap_psm = 0;
p_rcb->cover_art_goep_hdl = 0;
p_rcb->cover_art_state = 0;
p_rcb->cover_art_cid = 0;
p_rcb->cover_art_max_tx = 0;
p_rcb->cover_art_max_rx = 0;
}
#endif /* BTA_AV_CA_INCLUDED */

View File

@ -0,0 +1,170 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "common/bt_target.h"
#if BTA_AV_CA_INCLUDED
#include <string.h>
#include "bta/bta_av_api.h"
#include "bta_av_int.h"
#include "stack/avdt_api.h"
#include "bta/utl.h"
#include "stack/l2c_api.h"
#include "osi/allocator.h"
#include "osi/list.h"
#include "common/bt_trace.h"
/* state machine states */
enum {
BTA_AV_CA_INIT_ST,
BTA_AV_CA_OPENING_ST,
BTA_AV_CA_CONNECTING_ST,
BTA_AV_CA_CONNECTED_ST,
BTA_AV_CA_GETTING_ST,
BTA_AV_CA_CLOSING_ST
};
/* state machine action enumeration list */
enum {
BTA_AV_API_CA_OPEN,
BTA_AV_API_CA_CLOSE,
BTA_AV_API_CA_GET,
BTA_AV_CA_RESPONSE,
BTA_AV_CA_RESPONSE_FINAL,
BTA_AV_CA_GOEP_CONNECT,
BTA_AV_CA_GOEP_DISCONNECT,
BTA_AV_CA_FORCE_DISCONNECT,
BTA_AV_CA_NUM_ACTIONS
};
#define BTA_AV_CA_IGNORE BTA_AV_CA_NUM_ACTIONS
/* type for action functions */
typedef void (*tBTA_AV_CA_ACTION)(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data);
/* action functions */
const tBTA_AV_CA_ACTION bta_av_ca_action[] = {
bta_av_ca_api_open,
bta_av_ca_api_close,
bta_av_ca_api_get,
bta_av_ca_response,
bta_av_ca_response_final,
bta_av_ca_goep_connect,
bta_av_ca_goep_disconnect,
bta_av_ca_force_disconnect,
NULL
};
/* state table information */
#define BTA_AV_CA_ACTION_COL 0 /* position of actions */
#define BTA_AV_CA_NEXT_STATE 1 /* position of next state */
#define BTA_AV_CA_NUM_COLS 2 /* number of columns in state tables */
/* state table for init state */
static const UINT8 bta_av_ca_st_init[][BTA_AV_CA_NUM_COLS] = {
/* Event Action 1 Next state */
/* API_CA_OPEN_EVT */ {BTA_AV_API_CA_OPEN, BTA_AV_CA_OPENING_ST },
/* API_CA_CLOSE_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_INIT_ST },
/* API_CA_GET_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_INIT_ST },
/* CA_RESPONSE_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_INIT_ST },
/* CA_RESPONSE_FINAL_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_INIT_ST },
/* CA_GOEP_CONNECT_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_INIT_ST },
/* CA_GOEP_DISCONNECT_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_INIT_ST },
};
/* state table for opening state */
static const UINT8 bta_av_ca_st_opening[][BTA_AV_CA_NUM_COLS] = {
/* Event Action 1 Next state */
/* API_CA_OPEN_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_OPENING_ST },
/* API_CA_CLOSE_EVT */ {BTA_AV_CA_FORCE_DISCONNECT, BTA_AV_CA_INIT_ST },
/* API_CA_GET_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_OPENING_ST },
/* CA_RESPONSE_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_OPENING_ST },
/* CA_RESPONSE_FINAL_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_OPENING_ST },
/* CA_GOEP_CONNECT_EVT */ {BTA_AV_CA_GOEP_CONNECT, BTA_AV_CA_CONNECTING_ST },
/* CA_GOEP_DISCONNECT_EVT */ {BTA_AV_CA_GOEP_DISCONNECT, BTA_AV_CA_INIT_ST },
};
/* state table for connecting state */
static const UINT8 bta_av_ca_st_connecting[][BTA_AV_CA_NUM_COLS] = {
/* Event Action 1 Next state */
/* API_CA_OPEN_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_CONNECTING_ST },
/* API_CA_CLOSE_EVT */ {BTA_AV_CA_FORCE_DISCONNECT, BTA_AV_CA_INIT_ST },
/* API_CA_GET_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_CONNECTING_ST },
/* CA_RESPONSE_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_CONNECTING_ST },
/* CA_RESPONSE_FINAL_EVT */ {BTA_AV_CA_RESPONSE_FINAL, BTA_AV_CA_CONNECTED_ST },
/* CA_GOEP_CONNECT_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_CONNECTING_ST },
/* CA_GOEP_DISCONNECT_EVT */ {BTA_AV_CA_GOEP_DISCONNECT, BTA_AV_CA_INIT_ST },
};
/* state table for connected state */
static const UINT8 bta_av_ca_st_connected[][BTA_AV_CA_NUM_COLS] = {
/* Event Action 1 Next state */
/* API_CA_OPEN_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_CONNECTED_ST },
/* API_CA_CLOSE_EVT */ {BTA_AV_API_CA_CLOSE, BTA_AV_CA_CLOSING_ST },
/* API_CA_GET_EVT */ {BTA_AV_API_CA_GET, BTA_AV_CA_GETTING_ST },
/* CA_RESPONSE_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_CONNECTED_ST },
/* CA_RESPONSE_FINAL_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_CONNECTED_ST },
/* CA_GOEP_CONNECT_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_CONNECTED_ST },
/* CA_GOEP_DISCONNECT_EVT */ {BTA_AV_CA_GOEP_DISCONNECT, BTA_AV_CA_INIT_ST },
};
/* state table for getting state */
static const UINT8 bta_av_ca_st_getting[][BTA_AV_CA_NUM_COLS] = {
/* Event Action 1 Next state */
/* API_CA_OPEN_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_GETTING_ST },
/* API_CA_CLOSE_EVT */ {BTA_AV_CA_FORCE_DISCONNECT, BTA_AV_CA_INIT_ST },
/* API_CA_GET_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_GETTING_ST },
/* CA_RESPONSE_EVT */ {BTA_AV_CA_RESPONSE, BTA_AV_CA_GETTING_ST },
/* CA_RESPONSE_FINAL_EVT */ {BTA_AV_CA_RESPONSE_FINAL, BTA_AV_CA_CONNECTED_ST },
/* CA_GOEP_CONNECT_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_GETTING_ST },
/* CA_GOEP_DISCONNECT_EVT */ {BTA_AV_CA_GOEP_DISCONNECT, BTA_AV_CA_INIT_ST },
};
/* state table for closing state */
static const UINT8 bta_av_ca_st_closing[][BTA_AV_CA_NUM_COLS] = {
/* Event Action 1 Next state */
/* API_CA_OPEN_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_CLOSING_ST },
/* API_CA_CLOSE_EVT */ {BTA_AV_CA_FORCE_DISCONNECT, BTA_AV_CA_INIT_ST },
/* API_CA_GET_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_CLOSING_ST },
/* CA_RESPONSE_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_CLOSING_ST },
/* CA_RESPONSE_FINAL_EVT */ {BTA_AV_CA_RESPONSE_FINAL, BTA_AV_CA_INIT_ST },
/* CA_GOEP_CONNECT_EVT */ {BTA_AV_CA_IGNORE, BTA_AV_CA_CLOSING_ST },
/* CA_GOEP_DISCONNECT_EVT */ {BTA_AV_CA_GOEP_DISCONNECT, BTA_AV_CA_INIT_ST },
};
/* type for state table */
typedef const UINT8 (*tBTA_AV_CA_ST_TBL)[BTA_AV_CA_NUM_COLS];
/* state table */
static const tBTA_AV_CA_ST_TBL bta_av_ca_st_tbl[] = {
bta_av_ca_st_init,
bta_av_ca_st_opening,
bta_av_ca_st_connecting,
bta_av_ca_st_connected,
bta_av_ca_st_getting,
bta_av_ca_st_closing
};
void bta_av_ca_sm_execute(tBTA_AV_RCB *p_rcb, UINT16 event, tBTA_AV_DATA *p_data)
{
tBTA_AV_CA_ST_TBL state_table;
UINT8 action;
/* look up the state table for the current state */
state_table = bta_av_ca_st_tbl[p_rcb->cover_art_state];
event -= BTA_AV_CA_FIRST_SM_EVT;
/* set next state */
p_rcb->cover_art_state = state_table[event][BTA_AV_CA_NEXT_STATE];
/* execute action functions */
if ((action = state_table[event][BTA_AV_CA_ACTION_COL]) != BTA_AV_CA_IGNORE) {
(*bta_av_ca_action[action])(p_rcb, p_data);
}
}
#endif /* BTA_AV_CA_INCLUDED */

View File

@ -461,7 +461,7 @@ static void bta_av_a2dp_report_cback(UINT8 handle, AVDT_REPORT_TYPE type,
**
** Function bta_av_api_sink_enable
**
** Description activate, deactive A2DP Sink,
** Description activate, deactivate A2DP Sink,
**
** Returns void
**
@ -593,7 +593,7 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data)
#endif
}
/* Set the Calss of Device (Audio & Capturing/Rendering service class bit) */
/* Set the Class of Device (Audio & Capturing/Rendering service class bit) */
if (p_data->api_reg.tsep == AVDT_TSEP_SRC) {
cod.service = BTM_COD_SERVICE_CAPTURING | BTM_COD_SERVICE_AUDIO;
cod.major = BTM_COD_MAJOR_AUDIO;
@ -1248,6 +1248,13 @@ BOOLEAN bta_av_hdl_event(BT_HDR *p_msg)
APPL_TRACE_VERBOSE("AV sm event=0x%x(%s)\n", event, bta_av_evt_code(event));
/* state machine events */
bta_av_sm_execute(&bta_av_cb, p_msg->event, (tBTA_AV_DATA *) p_msg);
#if BTA_AV_CA_INCLUDED
} else if (event >= BTA_AV_CA_FIRST_SM_EVT && event <= BTA_AV_CA_LAST_SM_EVT) {
if (p_msg->layer_specific < BTA_AV_NUM_RCB) {
tBTA_AV_RCB *p_rcb = &bta_av_cb.rcb[p_msg->layer_specific];
bta_av_ca_sm_execute(p_rcb, p_msg->event, (tBTA_AV_DATA *) p_msg);
}
#endif
} else {
APPL_TRACE_VERBOSE("handle=0x%x\n", p_msg->layer_specific);
tBTA_AV_SCB *p_scb = bta_av_hndl_to_scb(p_msg->layer_specific);

View File

@ -85,7 +85,16 @@ enum {
BTA_AV_ROLE_CHANGE_EVT,
BTA_AV_AVDT_DELAY_RPT_EVT,
BTA_AV_ACP_CONNECT_EVT,
#if BTA_AV_CA_INCLUDED
/* these events are handled by the Cover Art Client state machine */
BTA_AV_API_CA_OPEN_EVT,
BTA_AV_API_CA_CLOSE_EVT,
BTA_AV_API_CA_GET_EVT,
BTA_AV_CA_RESPONSE_EVT,
BTA_AV_CA_RESPONSE_FINAL_EVT,
BTA_AV_CA_GOEP_CONNECT_EVT,
BTA_AV_CA_GOEP_DISCONNECT_EVT,
#endif
/* these events are handled outside of the state machine */
BTA_AV_API_ENABLE_EVT,
BTA_AV_API_REGISTER_EVT,
@ -115,6 +124,12 @@ enum {
#define BTA_AV_FIRST_SM_EVT BTA_AV_API_DISABLE_EVT
#define BTA_AV_LAST_SM_EVT BTA_AV_AVRC_NONE_EVT
#if BTA_AV_CA_INCLUDED
/* events for AVRC Cover Art state machine */
#define BTA_AV_CA_FIRST_SM_EVT BTA_AV_API_CA_OPEN_EVT
#define BTA_AV_CA_LAST_SM_EVT BTA_AV_CA_GOEP_DISCONNECT_EVT
#endif
/* events for AV stream control block state machine */
#define BTA_AV_FIRST_SSM_EVT BTA_AV_API_OPEN_EVT
@ -348,6 +363,52 @@ typedef struct {
BT_HDR hdr;
} tBTA_AV_API_GET_DELAY_VALUE;
#if BTA_AV_CA_INCLUDED
/* data type for BTA_AV_API_CA_OPEN_EVT */
typedef struct {
BT_HDR hdr;
UINT16 mtu;
} tBTA_AV_API_CA_OPEN;
/* data type for BTA_AV_API_CA_CLOSE_EVT */
typedef struct {
BT_HDR hdr;
} tBTA_AV_API_CA_CLOSE;
/* data type for BTA_AV_API_CA_GET_EVT */
typedef struct {
BT_HDR hdr;
tBTA_AV_GET_TYPE type;
UINT8 image_handle[7];
/* Image descriptor used in get image function */
UINT16 image_descriptor_len;
UINT8 *image_descriptor;
} tBTA_AV_API_CA_GET;
/* data type for BTA_AV_CA_RESPONSE_EVT and BTA_AV_CA_RESPONSE_FINAL_EVT */
typedef struct {
BT_HDR hdr;
BT_HDR *pkt;
UINT8 opcode;
BOOLEAN srm_en;
BOOLEAN srm_wait;
} tBTA_AV_CA_RESPONSE;
/* data type for BTA_AV_CA_CONNECT_EVT */
typedef struct {
BT_HDR hdr;
UINT16 max_rx;
} tBTA_AV_CA_CONNECT;
/* data type for BTA_AV_CA_DISCONNECT_EVT */
typedef struct {
BT_HDR hdr;
UINT16 reason;
} tBTA_AV_CA_DISCONNECT;
#endif /* BTA_AV_CA_INCLUDED */
/* initiator/acceptor role for adaption */
#define BTA_AV_ROLE_AD_INT 0x00 /* initiator */
#define BTA_AV_ROLE_AD_ACP 0x01 /* acceptor */
@ -382,6 +443,14 @@ typedef union {
tBTA_AV_API_META_RSP api_meta_rsp;
tBTA_AV_API_SET_DELAY_VALUE api_set_delay_vlaue;
tBTA_AV_API_GET_DELAY_VALUE api_get_delay_value;
#if BTA_AV_CA_INCLUDED
tBTA_AV_API_CA_OPEN api_ca_open;
tBTA_AV_API_CA_CLOSE api_ca_close;
tBTA_AV_API_CA_GET api_ca_get;
tBTA_AV_CA_RESPONSE ca_response;
tBTA_AV_CA_CONNECT ca_connect;
tBTA_AV_CA_DISCONNECT ca_disconnect;
#endif
} tBTA_AV_DATA;
typedef void (tBTA_AV_VDP_DATA_ACT)(void *p_scb);
@ -405,8 +474,8 @@ typedef union {
#define BTA_AV_Q_TAG_START 0x02 /* before start sending media packets */
#define BTA_AV_Q_TAG_STREAM 0x03 /* during streaming */
#define BTA_AV_WAIT_ACP_CAPS_ON 0x01 /* retriving the peer capabilities */
#define BTA_AV_WAIT_ACP_CAPS_STARTED 0x02 /* started while retriving peer capabilities */
#define BTA_AV_WAIT_ACP_CAPS_ON 0x01 /* retrieving the peer capabilities */
#define BTA_AV_WAIT_ACP_CAPS_STARTED 0x02 /* started while retrieving peer capabilities */
#define BTA_AV_WAIT_ROLE_SW_RES_OPEN 0x04 /* waiting for role switch result after API_OPEN, before STR_OPENED */
#define BTA_AV_WAIT_ROLE_SW_RES_START 0x08 /* waiting for role switch result before streaming */
#define BTA_AV_WAIT_ROLE_SW_STARTED 0x10 /* started while waiting for role switch result */
@ -462,7 +531,7 @@ typedef struct {
BOOLEAN use_rc; /* TRUE if AVRCP is allowed */
BOOLEAN started; /* TRUE if stream started */
UINT8 co_started; /* non-zero, if stream started from call-out perspective */
BOOLEAN recfg_sup; /* TRUE if the first attempt to reconfigure the stream was successfull, else False if command fails */
BOOLEAN recfg_sup; /* TRUE if the first attempt to reconfigure the stream was successful, else False if command fails */
BOOLEAN suspend_sup; /* TRUE if Suspend stream is supported, else FALSE if suspend command fails */
BOOLEAN deregistring; /* TRUE if deregistering */
BOOLEAN sco_suspend; /* TRUE if SUSPEND is issued automatically for SCO */
@ -471,7 +540,7 @@ typedef struct {
UINT8 wait; /* set 0x1, when getting Caps as ACP, set 0x2, when started */
UINT8 q_tag; /* identify the associated q_info union member */
BOOLEAN no_rtp_hdr; /* TRUE if add no RTP header*/
UINT8 disc_rsn; /* disconenction reason */
UINT8 disc_rsn; /* disconnection reason */
UINT16 uuid_int; /*intended UUID of Initiator to connect to */
} tBTA_AV_SCB;
@ -481,6 +550,13 @@ typedef struct {
#define BTA_AV_RC_CONN_MASK 0x20
#define BTA_AV_CA_IMG_HDL_UTF16_LEN 16 /* Cover Art image handle in utf-16 format, fixed to 16 */
#define BTA_AV_CA_SRM_DISABLE 0x00
#define BTA_AV_CA_SRM_ENABLE_REQ 0x01
#define BTA_AV_CA_SRM_WAIT 0x02
#define BTA_AV_CA_SRM_ENABLE 0x03
/* type for AV RCP control block */
/* index to this control block is the rc handle */
typedef struct {
@ -491,6 +567,14 @@ typedef struct {
tBTA_AV_FEAT peer_features; /* peer features mask */
UINT16 peer_ct_features;
UINT16 peer_tg_features;
#if BTA_AV_CA_INCLUDED
UINT16 cover_art_l2cap_psm; /* OBEX over L2CAP PSM */
UINT16 cover_art_goep_hdl; /* Cover Art client GOEP connection handle */
UINT8 cover_art_state; /* Cover Art client state machine */
UINT32 cover_art_cid; /* Cover Art client connection id */
UINT16 cover_art_max_tx; /* max packet length peer device can receive */
UINT16 cover_art_max_rx; /* max packet length we can receive */
#endif
} tBTA_AV_RCB;
#define BTA_AV_NUM_RCB (BTA_AV_NUM_STRS + 2)
@ -705,6 +789,19 @@ extern void bta_av_do_disc_vdp (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data);
extern void bta_av_vdp_str_opened (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data);
extern void bta_av_reg_vdp (tAVDT_CS *p_cs, char *p_service_name, void *p_data);
#if BTA_AV_CA_INCLUDED
extern void bta_av_ca_api_open(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data);
extern void bta_av_ca_api_close(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data);
extern void bta_av_ca_api_get(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data);
extern void bta_av_ca_response(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data);
extern void bta_av_ca_response_final(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data);
extern void bta_av_ca_goep_connect(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data);
extern void bta_av_ca_goep_disconnect(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data);
extern void bta_av_ca_force_disconnect(tBTA_AV_RCB *p_rcb, tBTA_AV_DATA *p_data);
extern void bta_av_ca_sm_execute(tBTA_AV_RCB *p_rcb, UINT16 event, tBTA_AV_DATA *p_data);
extern void bta_av_ca_reset(tBTA_AV_RCB *p_rcb);
#endif
#endif ///BTA_AV_INCLUDED == TRUE
#endif /* BTA_AV_INT_H */

View File

@ -2385,7 +2385,12 @@ void bta_dm_queue_search (tBTA_DM_MSG *p_data)
osi_free(bta_dm_search_cb.p_search_queue);
}
bta_dm_search_cb.p_search_queue = (tBTA_DM_MSG *)osi_malloc(sizeof(tBTA_DM_API_SEARCH));
tBTA_DM_API_SEARCH *search_queue = osi_malloc(sizeof(tBTA_DM_API_SEARCH));
if (search_queue == NULL) {
APPL_TRACE_ERROR("%s: couldn't allocate memory", __func__);
return;
}
bta_dm_search_cb.p_search_queue = (tBTA_DM_MSG *) search_queue;
memcpy(bta_dm_search_cb.p_search_queue, p_data, sizeof(tBTA_DM_API_SEARCH));
}
@ -2406,7 +2411,12 @@ void bta_dm_queue_disc (tBTA_DM_MSG *p_data)
osi_free(bta_dm_search_cb.p_search_queue);
}
bta_dm_search_cb.p_search_queue = (tBTA_DM_MSG *)osi_malloc(sizeof(tBTA_DM_API_DISCOVER));
tBTA_DM_API_DISCOVER *search_queue = osi_malloc(sizeof(tBTA_DM_API_DISCOVER));
if (search_queue == NULL) {
APPL_TRACE_ERROR("%s: couldn't allocate memory", __func__);
return;
}
bta_dm_search_cb.p_search_queue = (tBTA_DM_MSG *)search_queue;
memcpy(bta_dm_search_cb.p_search_queue, p_data, sizeof(tBTA_DM_API_DISCOVER));
}
#endif ///SDP_INCLUDED == TRUE

View File

@ -29,6 +29,7 @@
#include "stack/btm_api.h"
#include "btm_int.h"
#include <string.h>
#include <assert.h>
#include "bta/utl.h"
#include "osi/allocator.h"
@ -1086,22 +1087,67 @@ UINT16 BTA_DmGetConnectionState( BD_ADDR bd_addr )
tBTA_STATUS BTA_DmSetLocalDiRecord( tBTA_DI_RECORD *p_device_info,
UINT32 *p_handle )
{
tBTA_STATUS status = BTA_FAILURE;
tBTA_STATUS status = BTA_FAILURE;
if (bta_dm_di_cb.di_num < BTA_DI_NUM_MAX) {
if (SDP_SetLocalDiRecord((tSDP_DI_RECORD *)p_device_info, p_handle) == SDP_SUCCESS) {
if (!p_device_info->primary_record) {
bta_dm_di_cb.di_handle[bta_dm_di_cb.di_num] = *p_handle;
bta_dm_di_cb.di_num ++;
for (uint8_t i = 1; i < BTA_DI_NUM_MAX; i++) {
if (!bta_dm_di_cb.di_handle[i]) {
bta_dm_di_cb.di_handle[i] = *p_handle;
break;
}
}
bta_dm_di_cb.di_num++;
} else if (!bta_dm_di_cb.di_handle[0]) {
bta_dm_di_cb.di_handle[0] = *p_handle;
bta_dm_di_cb.di_num++;
} else {
assert(bta_dm_di_cb.di_handle[0] == (*p_handle));
}
bta_sys_add_uuid(UUID_SERVCLASS_PNP_INFORMATION);
status = BTA_SUCCESS;
if (!bta_dm_di_cb.uuid_added) {
bta_sys_add_uuid(UUID_SERVCLASS_PNP_INFORMATION);
bta_dm_di_cb.uuid_added = TRUE;
}
status = BTA_SUCCESS;
}
}
return status;
}
/*******************************************************************************
**
** Function BTA_DmRemoveLocalDiRecord
**
** Description This function removes a DI record from the local SDP database.
**
** Returns BTA_SUCCESS if record is removed successfully, otherwise error code.
**
*******************************************************************************/
tBTA_STATUS BTA_DmRemoveLocalDiRecord(UINT32 handle)
{
tBTA_STATUS status = BTA_FAILURE;
for (uint8_t i = 0; i < BTA_DI_NUM_MAX; i++) {
if (bta_dm_di_cb.di_handle[i] == handle) {
if (SDP_DeleteRecord(handle)) {
bta_dm_di_cb.di_handle[i] = 0;
bta_dm_di_cb.di_num--;
status = BTA_SUCCESS;
break;
}
}
}
if (bta_dm_di_cb.di_num == 0 && bta_dm_di_cb.uuid_added) {
bta_sys_remove_uuid(UUID_SERVCLASS_PNP_INFORMATION);
}
return status;
}
#endif ///SDP_INCLUDED == TRUE
/*******************************************************************************
**

View File

@ -1590,6 +1590,7 @@ typedef struct {
#if (SDP_INCLUDED == TRUE)
tSDP_DISCOVERY_DB *p_di_db; /* pointer to the DI discovery database */
#endif ///SDP_INCLUDED == TRUE
BOOLEAN uuid_added;
UINT8 di_num; /* total local DI record number */
UINT32 di_handle[BTA_DI_NUM_MAX]; /* local DI record handle, the first one is primary record */
} tBTA_DM_DI_CB;

View File

@ -2190,6 +2190,17 @@ extern UINT16 BTA_DmGetConnectionState( BD_ADDR bd_addr );
*******************************************************************************/
extern tBTA_STATUS BTA_DmSetLocalDiRecord( tBTA_DI_RECORD *p_device_info,
UINT32 *p_handle );
/*******************************************************************************
**
** Function BTA_DmRemoveLocalDiRecord
**
** Description This function removes a DI record from the local SDP database.
**
** Returns BTA_SUCCESS if record is removed successfully, otherwise error code.
**
*******************************************************************************/
extern tBTA_STATUS BTA_DmRemoveLocalDiRecord(UINT32 handle);
#endif ///SDP_INCLUDED == TRUE
/*******************************************************************************
**

View File

@ -43,14 +43,14 @@
#define BTA_AV_FAIL_STREAM 3 /* stream connection failed */
#define BTA_AV_FAIL_RESOURCES 4 /* no resources */
#define BTA_AV_FAIL_ROLE 5 /* failed due to role management related issues */
#define BTA_AV_FAIL_GET_CAP 6 /* get capability failed due to no SEP availale on the peer */
#define BTA_AV_FAIL_GET_CAP 6 /* get capability failed due to no SEP available on the peer */
typedef UINT8 tBTA_AV_STATUS;
/* AV features masks */
#define BTA_AV_FEAT_RCTG 0x0001 /* remote control target */
#define BTA_AV_FEAT_RCCT 0x0002 /* remote control controller */
#define BTA_AV_FEAT_PROTECT 0x0004 /* streaming media contect protection */
#define BTA_AV_FEAT_PROTECT 0x0004 /* streaming media context protection */
#define BTA_AV_FEAT_VENDOR 0x0008 /* remote control vendor dependent commands */
#define BTA_AV_FEAT_REPORT 0x0020 /* use reporting service for VDP */
#define BTA_AV_FEAT_METADATA 0x0040 /* remote control Metadata Transfer command/response */
@ -60,6 +60,7 @@ typedef UINT8 tBTA_AV_STATUS;
#define BTA_AV_FEAT_ADV_CTRL 0x0200 /* remote control Advanced Control command/response */
#define BTA_AV_FEAT_DELAY_RPT 0x0400 /* allow delay reporting */
#define BTA_AV_FEAT_ACP_START 0x0800 /* start stream when 2nd SNK was accepted */
#define BTA_AV_FEAT_COVER_ART 0x1000 /* remote control target cover art */
/* Internal features */
#define BTA_AV_FEAT_NO_SCO_SSPD 0x8000 /* Do not suspend av streaming as to AG events(SCO or Call) */
@ -107,6 +108,7 @@ typedef UINT8 tBTA_AV_HNDL;
#define BTA_AV_MAX_VDP_MTU 1008
#endif
#define BTA_AV_CA_IMG_HDL_LEN 7 /* Cover Art image handle len, fixed to 7 */
/* codec type */
#define BTA_AV_CODEC_SBC A2D_MEDIA_CT_SBC /* SBC media codec type */
@ -224,6 +226,12 @@ typedef UINT8 tBTA_AV_CODE;
typedef UINT8 tBTA_AV_ERR;
/* type codes for BTA_AV_API_CA_GET */
#define BTA_AV_CA_GET_IMAGE_PROPERTIES 0x01
#define BTA_AV_CA_GET_IMAGE 0x02
#define BTA_AV_CA_GET_LINKED_THUMBNAIL 0x03
typedef UINT8 tBTA_AV_GET_TYPE;
/* AV callback events */
#define BTA_AV_ENABLE_EVT 0 /* AV enabled */
@ -253,8 +261,13 @@ typedef UINT8 tBTA_AV_ERR;
#define BTA_AV_SET_DELAY_VALUE_EVT 22 /* set delay reporting value */
#define BTA_AV_GET_DELAY_VALUE_EVT 23 /* get delay reporting value */
#define BTA_AV_SNK_PSC_CFG_EVT 24 /* Protocol service capabilities. */
/* still keep Cover Art event here if Cover Art feature not enabled */
#define BTA_AV_CA_STATUS_EVT 25 /* Cover Art Client status event */
#define BTA_AV_CA_DATA_EVT 26 /* Cover Art response body data */
/* Max BTA event */
#define BTA_AV_MAX_EVT 25
#define BTA_AV_MAX_EVT 27
/* function types for call-out functions */
@ -482,6 +495,25 @@ typedef struct {
} tBTA_AV_SNK_PSC_CFG;
#if BTA_AV_CA_INCLUDED
/* data associated with BTA_AV_CA_STATUS_EVT */
typedef struct {
BOOLEAN connected; /* whether Cover Art connection is connected */
UINT16 reason; /* connect failed or disconnect reason */
} tBTA_AV_CA_STATUS;
/* data associated with BTA_AV_CA_DATA_EVT */
typedef struct {
UINT16 status; /* OBEX response status */
BOOLEAN final; /* final data packet */
UINT16 data_len; /* data len */
UINT8 *p_data; /* point to the data in p_hdr */
BT_HDR *p_hdr; /* after data pass to application, free this packet */
} tBTA_AV_CA_DATA;
#endif
/* union of data associated with AV callback */
typedef union {
tBTA_AV_CHNL chnl;
@ -506,6 +538,10 @@ typedef union {
tBTA_AV_RC_FEAT rc_feat;
tBTA_AV_DELAY delay;
tBTA_AV_SNK_PSC_CFG psc;
#if BTA_AV_CA_INCLUDED
tBTA_AV_CA_STATUS ca_status;
tBTA_AV_CA_DATA ca_data;
#endif
} tBTA_AV;
/* union of data associated with AV Media callback */
@ -865,6 +901,47 @@ void BTA_AvMetaRsp(UINT8 rc_handle, UINT8 label, tBTA_AV_CODE rsp_code,
*******************************************************************************/
void BTA_AvMetaCmd(UINT8 rc_handle, UINT8 label, tBTA_AV_CMD cmd_code, BT_HDR *p_pkt);
#if BTA_AV_CA_INCLUDED
/*******************************************************************************
**
** Function BTA_AvCaOpen
**
** Description Open a Cover Art OBEX connection to peer device. This function
** can only be used if peer device TG support Cover Art feature and
** AV is enabled with feature BTA_AV_FEAT_METADATA.
**
** Returns void
**
*******************************************************************************/
void BTA_AvCaOpen(UINT8 rc_handle, UINT16 pref_packet_len);
/*******************************************************************************
**
** Function BTA_AvCaClose
**
** Description Close a Cover Art OBEX connection.
**
** Returns void
**
*******************************************************************************/
void BTA_AvCaClose(UINT8 rc_handle);
/*******************************************************************************
**
** Function BTA_AvCaGet
**
** Description Start the process to get image properties, get image or get
** linked thumbnail. This function can only be used if Cover Art
** OBEX connection is established.
**
** Returns void
**
*******************************************************************************/
void BTA_AvCaGet(UINT8 rc_handle, tBTA_AV_GET_TYPE type, UINT8 *image_handle, UINT8 *image_descriptor, UINT16 image_descriptor_len);
#endif /* BTA_AV_CA_INCLUDED */
#ifdef __cplusplus
}
#endif

View File

@ -41,7 +41,7 @@ typedef UINT8 tBTA_SDP_STATUS;
/* SDP I/F callback events */
/* events received by tBTA_SDP_DM_CBACK */
#define BTA_SDP_ENABLE_EVT 0 /* SDP service enabled */
#define BTA_SDP_DISENABLE_EVT 1 /* SDP service disenabled */
#define BTA_SDP_DISABLE_EVT 1 /* SDP service disenabled */
#define BTA_SDP_SEARCH_EVT 2 /* SDP search started */
#define BTA_SDP_SEARCH_COMP_EVT 3 /* SDP search complete */
#define BTA_SDP_CREATE_RECORD_USER_EVT 4 /* SDP create record complete */
@ -67,10 +67,17 @@ typedef struct {
int handle;
} tBTA_SDP_CREATE_RECORD_USER;
/* data associated with BTA_SDP_REMOVE_RECORD_USER_EVT */
typedef struct {
tBTA_SDP_STATUS status;
int handle;
} tBTA_SDP_REMOVE_RECORD_USER;
typedef union {
tBTA_SDP_STATUS status; /* BTA_SDP_SEARCH_EVT */
tBTA_SDP_SEARCH_COMP sdp_search_comp; /* BTA_SDP_SEARCH_COMP_EVT */
tBTA_SDP_CREATE_RECORD_USER sdp_create_record; /* BTA_SDP_CREATE_RECORD_USER_EVT */
tBTA_SDP_REMOVE_RECORD_USER sdp_remove_record; /* BTA_SDP_REMOVE_RECORD_USER_EVT */
} tBTA_SDP;
/* SDP DM Interface callback */
@ -78,9 +85,11 @@ typedef void (tBTA_SDP_DM_CBACK)(tBTA_SDP_EVT event, tBTA_SDP *p_data, void *use
/* MCE configuration structure */
typedef struct {
UINT16 sdp_db_size; /* The size of p_sdp_db */
UINT16 sdp_raw_size; /* The size of p_sdp_raw_data */
UINT16 sdp_db_size; /* The size of p_sdp_db */
#if (SDP_INCLUDED == TRUE)
tSDP_DISCOVERY_DB *p_sdp_db; /* The data buffer to keep SDP database */
UINT8 *p_sdp_raw_data; /* The data buffer to keep raw data */
tSDP_DISCOVERY_DB *p_sdp_db; /* The data buffer to keep SDP database */
#endif ///SDP_INCLUDED == TRUE
} tBTA_SDP_CFG;
@ -108,14 +117,28 @@ extern tBTA_SDP_STATUS BTA_SdpEnable(tBTA_SDP_DM_CBACK *p_cback);
**
** Function BTA_SdpDisable
**
** Description Disable the SDP search I/F service.
** Description This function is used to request a callback to perform disable
** operation. The registered callback will be called with event
** BTA_SDP_DISABLE_EVT.
**
** Returns BTA_SDP_SUCCESS, if the request is being processed.
** BTA_SDP_FAILURE, otherwise.
**
*******************************************************************************/
extern tBTA_SDP_STATUS BTA_SdpDisable(void);
/*******************************************************************************
**
** Function BTA_SdpCleanup
**
** Description Cleanup the SDP search I/F service.
** Free buffer for SDP configuration structure.
**
** Returns BTA_SDP_SUCCESS if successful.
** BTA_SDP_FAIL if internal failure.
**
*******************************************************************************/
extern tBTA_SDP_STATUS BTA_SdpDisable(void);
extern tBTA_SDP_STATUS BTA_SdpCleanup(void);
/*******************************************************************************
**

View File

@ -91,7 +91,8 @@ typedef UINT16 tBTA_SYS_HW_MODULE;
#define BTA_ID_GATTC 31 /* GATT Client */
#define BTA_ID_GATTS 32 /* GATT Client */
#define BTA_ID_SDP 33 /* SDP Client */
#define BTA_ID_BLUETOOTH_MAX 34 /* last BT profile */
#define BTA_ID_GOEPC 34 /* GOEP Client */
#define BTA_ID_BLUETOOTH_MAX 35 /* last BT profile */
/* GENERIC */
#define BTA_ID_PRM 38
@ -142,7 +143,7 @@ typedef void (tBTA_SYS_CONN_CBACK)(tBTA_SYS_CONN_STATUS status, UINT8 id, UINT8
typedef void (tBTA_SYS_SSR_CFG_CBACK)(UINT8 id, UINT8 app_id, UINT16 latency, UINT16 tout);
#if (BTA_EIR_CANNED_UUID_LIST != TRUE)
/* eir callback for adding/removeing UUID */
/* eir callback for adding/removing UUID */
typedef void (tBTA_SYS_EIR_CBACK)(tBT_UUID uuid, BOOLEAN adding);
#endif

View File

@ -49,10 +49,11 @@ typedef void (*tBTA_SDP_ACTION)(tBTA_SDP_MSG *p_data);
/* action function list */
const tBTA_SDP_ACTION bta_sdp_action[] = {
bta_sdp_enable, /* BTA_SDP_API_ENABLE_EVT */
bta_sdp_search, /* BTA_SDP_API_SEARCH_EVT */
bta_sdp_create_record, /* BTA_SDP_API_CREATE_RECORD_USER_EVT */
bta_sdp_remove_record, /* BTA_SDP_API_REMOVE_RECORD_USER_EVT */
bta_sdp_enable, /* BTA_SDP_API_ENABLE_EVT */
bta_sdp_search, /* BTA_SDP_API_SEARCH_EVT */
bta_sdp_create_record, /* BTA_SDP_API_CREATE_RECORD_USER_EVT */
bta_sdp_remove_record, /* BTA_SDP_API_REMOVE_RECORD_USER_EVT */
bta_sdp_disable, /* BTA_SDP_API_DISABLE_EVT */
};
/*******************************************************************************

View File

@ -140,6 +140,47 @@ static void bta_create_mns_sdp_record(bluetooth_sdp_record *record, tSDP_DISC_RE
}
}
static void bta_create_dip_sdp_record(bluetooth_sdp_record *record, tSDP_DISC_REC *p_rec)
{
tSDP_DISC_ATTR *p_attr;
UINT16 pversion = -1;
record->dip.hdr.type = SDP_TYPE_DIP_SERVER;
record->dip.hdr.service_name_length = 0;
record->dip.hdr.service_name = NULL;
record->dip.hdr.rfcomm_channel_number = 0;
record->dip.hdr.l2cap_psm = -1;
record->dip.hdr.profile_version = 0;
p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_VENDOR_ID);
if (p_attr) {
record->dip.vendor = p_attr->attr_value.v.u16;
}
p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_VENDOR_ID_SOURCE);
if (p_attr) {
record->dip.vendor_id_source = p_attr->attr_value.v.u16;
}
p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_PRODUCT_ID);
if (p_attr) {
record->dip.product = p_attr->attr_value.v.u16;
}
p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_PRODUCT_VERSION);
if (p_attr) {
record->dip.version = p_attr->attr_value.v.u16;
}
p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_PRIMARY_RECORD);
if (p_attr) {
record->dip.primary_record = (BOOLEAN)p_attr->attr_value.v.u8;
}
if (SDP_FindProfileVersionInRec(p_rec, UUID_SERVCLASS_PNP_INFORMATION, &pversion)) {
record->dip.hdr.profile_version = pversion;
}
}
static void bta_create_mas_sdp_record(bluetooth_sdp_record *record, tSDP_DISC_REC *p_rec)
{
tSDP_DISC_ATTR *p_attr;
@ -354,29 +395,29 @@ static void bta_create_raw_sdp_record(bluetooth_sdp_record *record, tSDP_DISC_RE
tSDP_DISC_ATTR *p_attr;
tSDP_PROTOCOL_ELEM pe;
record->hdr.type = SDP_TYPE_RAW;
record->hdr.service_name_length = 0;
record->hdr.service_name = NULL;
record->hdr.rfcomm_channel_number = -1;
record->hdr.l2cap_psm = -1;
record->hdr.profile_version = -1;
record->raw.hdr.type = SDP_TYPE_RAW;
record->raw.hdr.service_name_length = 0;
record->raw.hdr.service_name = NULL;
record->raw.hdr.rfcomm_channel_number = -1;
record->raw.hdr.l2cap_psm = -1;
record->raw.hdr.profile_version = -1;
/* Try to extract a service name */
if ((p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_SERVICE_NAME)) != NULL) {
record->pse.hdr.service_name_length = SDP_DISC_ATTR_LEN(p_attr->attr_len_type);
record->pse.hdr.service_name = (char *)p_attr->attr_value.v.array;
record->raw.hdr.service_name_length = SDP_DISC_ATTR_LEN(p_attr->attr_len_type);
record->raw.hdr.service_name = (char *)p_attr->attr_value.v.array;
}
if ((p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_GOEP_L2CAP_PSM)) != NULL) {
record->hdr.l2cap_psm = p_attr->attr_value.v.u16;
record->raw.hdr.l2cap_psm = p_attr->attr_value.v.u16;
}
/* Try to extract an RFCOMM channel */
if (SDP_FindProtocolListElemInRec(p_rec, UUID_PROTOCOL_RFCOMM, &pe)) {
record->pse.hdr.rfcomm_channel_number = pe.params[0];
record->raw.hdr.rfcomm_channel_number = pe.params[0];
}
record->hdr.user1_ptr_len = p_bta_sdp_cfg->p_sdp_db->raw_size;
record->hdr.user1_ptr = p_bta_sdp_cfg->p_sdp_db->raw_data;
record->raw.hdr.user1_ptr_len = p_bta_sdp_cfg->p_sdp_db->raw_used;
record->raw.hdr.user1_ptr = p_bta_sdp_cfg->p_sdp_db->raw_data;
}
@ -415,7 +456,10 @@ static void bta_sdp_search_cback(UINT16 result, void *user_data)
/* generate the matching record data pointer */
if (p_rec != NULL) {
status = BTA_SDP_SUCCESS;
if (IS_UUID(UUID_MAP_MAS, uuid->uu.uuid128)) {
if (uuid->uu.uuid16 == UUID_SERVCLASS_PNP_INFORMATION) {
APPL_TRACE_DEBUG("%s() - found DIP uuid\n", __func__);
bta_create_dip_sdp_record(&evt_data.records[count], p_rec);
} else if (IS_UUID(UUID_MAP_MAS, uuid->uu.uuid128)) {
APPL_TRACE_DEBUG("%s() - found MAP (MAS) uuid\n", __func__);
bta_create_mas_sdp_record(&evt_data.records[count], p_rec);
} else if (IS_UUID(UUID_MAP_MNS, uuid->uu.uuid128)) {
@ -526,6 +570,10 @@ void bta_sdp_search(tBTA_SDP_MSG *p_data)
SDP_InitDiscoveryDb (p_bta_sdp_cfg->p_sdp_db, p_bta_sdp_cfg->sdp_db_size, 1,
bta_sdp_search_uuid, 0, NULL);
/* tell SDP to keep the raw data */
p_bta_sdp_cfg->p_sdp_db->raw_size = p_bta_sdp_cfg->sdp_raw_size;
p_bta_sdp_cfg->p_sdp_db->raw_data = p_bta_sdp_cfg->p_sdp_raw_data;
if (!SDP_ServiceSearchAttributeRequest2(p_data->get_search.bd_addr, p_bta_sdp_cfg->p_sdp_db,
bta_sdp_search_cback, (void *)bta_sdp_search_uuid)) {
bta_sdp_cb.sdp_active = BTA_SDP_ACTIVE_NONE;
@ -558,7 +606,7 @@ void bta_sdp_create_record(tBTA_SDP_MSG *p_data)
APPL_TRACE_DEBUG("%s() event: %d\n", __func__, p_data->record.hdr.event);
tBTA_SDP_CREATE_RECORD_USER bta_sdp = {0};
bta_sdp.status = BTA_SDP_SUCCESS;
bta_sdp.handle = (int)p_data->record.user_data;
bta_sdp.handle = -1;
if (bta_sdp_cb.p_dm_cback) {
bta_sdp_cb.p_dm_cback(BTA_SDP_CREATE_RECORD_USER_EVT, (tBTA_SDP *)&bta_sdp, p_data->record.user_data);
}
@ -576,10 +624,30 @@ void bta_sdp_create_record(tBTA_SDP_MSG *p_data)
void bta_sdp_remove_record(tBTA_SDP_MSG *p_data)
{
APPL_TRACE_DEBUG("%s() event: %d\n", __func__, p_data->record.hdr.event);
tBTA_SDP_REMOVE_RECORD_USER bta_sdp;
bta_sdp.status = BTA_SDP_SUCCESS;
bta_sdp.handle = -1;
if (bta_sdp_cb.p_dm_cback) {
bta_sdp_cb.p_dm_cback(BTA_SDP_REMOVE_RECORD_USER_EVT, (tBTA_SDP *)&bta_sdp, p_data->record.user_data);
}
}
/*******************************************************************************
**
** Function bta_sdp_disable
**
** Description Removes an SDP record
**
** Returns void
**
*******************************************************************************/
void bta_sdp_disable(tBTA_SDP_MSG *p_data)
{
APPL_TRACE_DEBUG("%s()\n", __func__);
tBTA_SDP bta_sdp;
bta_sdp.status = BTA_SDP_SUCCESS;
if (bta_sdp_cb.p_dm_cback) {
bta_sdp_cb.p_dm_cback(BTA_SDP_REMOVE_RECORD_USER_EVT, &bta_sdp, p_data->record.user_data);
bta_sdp_cb.p_dm_cback(BTA_SDP_DISABLE_EVT, &bta_sdp, NULL);
}
}

View File

@ -65,7 +65,9 @@ tBTA_SDP_STATUS BTA_SdpEnable(tBTA_SDP_DM_CBACK *p_cback)
#if BTA_DYNAMIC_MEMORY == TRUE
/* Malloc buffer for SDP configuration structure */
p_bta_sdp_cfg->p_sdp_db = (tSDP_DISCOVERY_DB *)osi_malloc(p_bta_sdp_cfg->sdp_db_size);
if (p_bta_sdp_cfg->p_sdp_db == NULL) {
p_bta_sdp_cfg->p_sdp_raw_data = (UINT8 *)osi_malloc(p_bta_sdp_cfg->sdp_raw_size);
if (p_bta_sdp_cfg->p_sdp_db == NULL || p_bta_sdp_cfg->p_sdp_raw_data == NULL) {
BTA_SdpCleanup();
return BTA_SDP_FAILURE;
}
#endif
@ -101,15 +103,34 @@ tBTA_SDP_STATUS BTA_SdpEnable(tBTA_SDP_DM_CBACK *p_cback)
*******************************************************************************/
tBTA_SDP_STATUS BTA_SdpDisable(void)
{
BT_HDR *p_buf = NULL;
tBTA_SDP_STATUS status = BTA_SDP_SUCCESS;
if ((p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR))) != NULL) {
p_buf->event = BTA_SDP_API_DISABLE_EVT;
bta_sys_sendmsg(p_buf);
status = BTA_SDP_FAILURE;
}
return status;
}
tBTA_SDP_STATUS BTA_SdpCleanup(void)
{
bta_sys_deregister(BTA_ID_SDP);
#if BTA_DYNAMIC_MEMORY == TRUE
/* Free buffer for SDP configuration structure */
osi_free(p_bta_sdp_cfg->p_sdp_db);
p_bta_sdp_cfg->p_sdp_db = NULL;
if (p_bta_sdp_cfg->p_sdp_db) {
osi_free(p_bta_sdp_cfg->p_sdp_db);
p_bta_sdp_cfg->p_sdp_db = NULL;
}
if (p_bta_sdp_cfg->p_sdp_raw_data) {
osi_free(p_bta_sdp_cfg->p_sdp_raw_data);
p_bta_sdp_cfg->p_sdp_raw_data = NULL;
}
#endif
return (status);
return BTA_SDP_SUCCESS;
}
/*******************************************************************************

View File

@ -30,16 +30,24 @@
#define BTA_SDP_DB_SIZE 1500
#endif
#ifndef BTA_SDP_RAW_DATA_SIZE
#define BTA_SDP_RAW_DATA_SIZE 1024
#endif
#if BTA_DYNAMIC_MEMORY == FALSE
static UINT8 bta_sdp_raw_data[BTA_SDP_RAW_DATA_SIZE];
static UINT8 __attribute__ ((aligned(4))) bta_sdp_db_data[BTA_SDP_DB_SIZE];
#endif
/* SDP configuration structure */
tBTA_SDP_CFG bta_sdp_cfg = {
BTA_SDP_RAW_DATA_SIZE,
BTA_SDP_DB_SIZE,
#if BTA_DYNAMIC_MEMORY == FALSE
bta_sdp_raw_data,
(tSDP_DISCOVERY_DB *)bta_sdp_db_data /* The data buffer to keep SDP database */
#else
NULL,
NULL
#endif
};

View File

@ -42,6 +42,7 @@ enum {
BTA_SDP_API_SEARCH_EVT,
BTA_SDP_API_CREATE_RECORD_USER_EVT,
BTA_SDP_API_REMOVE_RECORD_USER_EVT,
BTA_SDP_API_DISABLE_EVT,
BTA_SDP_MAX_INT_EVT
};
@ -105,6 +106,7 @@ extern void bta_sdp_enable (tBTA_SDP_MSG *p_data);
extern void bta_sdp_search (tBTA_SDP_MSG *p_data);
extern void bta_sdp_create_record(tBTA_SDP_MSG *p_data);
extern void bta_sdp_remove_record(tBTA_SDP_MSG *p_data);
extern void bta_sdp_disable(tBTA_SDP_MSG *p_data);
#endif ///SDP_INCLUDED == TRUE

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -34,7 +34,7 @@
#if BTC_AV_INCLUDED
// global variable to inidcate avrc is initialized with a2dp
// global variable to indicate avrc is initialized with a2dp
bool g_av_with_rc;
// global variable to indicate a2dp is initialized
bool g_a2dp_on_init;
@ -127,6 +127,8 @@ static btc_av_cb_t *btc_av_cb_ptr = NULL;
case BTA_AV_META_MSG_EVT: \
case BTA_AV_RC_FEAT_EVT: \
case BTA_AV_REMOTE_RSP_EVT: \
case BTA_AV_CA_STATUS_EVT: \
case BTA_AV_CA_DATA_EVT: \
{ \
btc_rc_handler(e, d);\
}break; \
@ -382,6 +384,8 @@ static BOOLEAN btc_av_state_idle_handler(btc_sm_event_t event, void *p_data)
case BTA_AV_META_MSG_EVT:
case BTA_AV_RC_FEAT_EVT:
case BTA_AV_REMOTE_RSP_EVT:
case BTA_AV_CA_STATUS_EVT:
case BTA_AV_CA_DATA_EVT:
btc_rc_handler(event, (tBTA_AV *)p_data);
break;
@ -1355,7 +1359,7 @@ static void bte_av_media_callback(tBTA_AV_EVT event, tBTA_AV_MEDIA *p_data)
/* send a command to BT Media Task */
btc_a2dp_sink_reset_decoder((UINT8 *)p_data);
/* currently only supportes SBC */
/* currently only supports SBC */
a2d_status = A2D_ParsSbcInfo(&sbc_cie, (UINT8 *)p_data, FALSE);
if (a2d_status == A2D_SUCCESS) {
btc_msg_t msg;

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -40,7 +40,7 @@ static void btc_rc_upstreams_evt(UINT16 event, tAVRC_COMMAND *pavrc_cmd, UINT8 c
** Static variables
******************************************************************************/
/* flag indicating wheter TG/CT is initialized */
/* flag indicating whether TG/CT is initialized */
static uint32_t s_rc_ct_init;
static uint32_t s_rc_tg_init;
@ -157,6 +157,11 @@ bool btc_avrc_ct_rn_evt_supported(uint8_t event_id)
true : false;
}
bool btc_avrc_ct_check_cover_art_support(void)
{
return (btc_rc_cb.rc_features & BTA_AV_FEAT_COVER_ART);
}
bool btc_avrc_tg_init_p(void)
{
return (s_rc_tg_init == BTC_RC_TG_INIT_MAGIC);
@ -181,6 +186,52 @@ bool btc_avrc_ct_connected_p(void)
(btc_rc_cb.rc_features & BTA_AV_FEAT_RCTG);
}
void btc_avrc_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
{
btc_avrc_args_t *dst = (btc_avrc_args_t *)p_dest;
btc_avrc_args_t *src = (btc_avrc_args_t *)p_src;
size_t len;
switch (msg->act) {
#if BTC_AV_CA_INCLUDED
case BTC_AVRC_CT_API_COVER_ART_GET_IMAGE_EVT:
len = src->ca_get_img.image_descriptor_len;
dst->ca_get_img.image_descriptor = (uint8_t *)osi_malloc(len);
if (dst->ca_get_img.image_descriptor) {
memcpy(dst->ca_get_img.image_descriptor, src->ca_get_img.image_descriptor, len);
} else {
BTC_TRACE_ERROR("%s %d no mem\n", __FUNCTION__, msg->act);
}
break;
#endif
default:
BTC_TRACE_DEBUG("%s Unhandled deep copy %d\n", __FUNCTION__, msg->act);
UNUSED(dst);
UNUSED(src);
UNUSED(len);
break;
}
}
void btc_avrc_arg_deep_free(btc_msg_t *msg)
{
btc_avrc_args_t *arg = (btc_avrc_args_t *)msg->arg;
switch (msg->act) {
#if BTC_AV_CA_INCLUDED
case BTC_AVRC_CT_API_COVER_ART_GET_IMAGE_EVT:
if (arg->ca_get_img.image_descriptor) {
osi_free(arg->ca_get_img.image_descriptor);
}
break;
#endif
default:
BTC_TRACE_DEBUG("%s Unhandled deep free %d\n", __FUNCTION__, msg->act);
UNUSED(arg);
break;
}
}
void btc_avrc_tg_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
{
btc_avrc_tg_args_t *dst = (btc_avrc_tg_args_t *) p_dest;
@ -499,14 +550,28 @@ static void handle_rc_disconnect (tBTA_AV_RC_CLOSE *p_rc_close)
// clean up the state
btc_rc_cb.rc_handle = 0;
btc_rc_cb.rc_connected = FALSE;
#if BTC_AV_CA_INCLUDED
bool cover_art_connected = btc_rc_cb.rc_cover_art_connected;
btc_rc_cb.rc_cover_art_connected = FALSE;
#endif
btc_rc_cb.rc_features = 0;
btc_rc_cb.rc_ct_features = 0;
btc_rc_cb.rc_tg_features = 0;
memset(btc_rc_cb.rc_addr, 0, sizeof(BD_ADDR));
memset(btc_rc_cb.rc_ntf, 0, sizeof(btc_rc_cb.rc_ntf));
#if BTC_AV_CA_INCLUDED
/* report connection state */
if (cover_art_connected) {
/* if rc disconnect, cover art disconnect too */
esp_avrc_ct_cb_param_t param;
memset(&param, 0, sizeof(esp_avrc_ct_cb_param_t));
param.cover_art_state.state = ESP_AVRC_COVER_ART_DISCONNECTED;
param.cover_art_state.reason = BT_STATUS_FAIL;
btc_avrc_ct_cb_to_app(ESP_AVRC_CT_COVER_ART_STATE_EVT, &param);
}
#endif
if (rc_features & BTA_AV_FEAT_RCTG) {
esp_avrc_ct_cb_param_t param;
memset(&param, 0, sizeof(esp_avrc_ct_cb_param_t));
@ -751,7 +816,7 @@ static void btc_rc_upstreams_evt(UINT16 event, tAVRC_COMMAND *pavrc_cmd, UINT8 c
btc_rc_cb.rc_ntf[event_id - 1].registered = TRUE;
btc_rc_cb.rc_ntf[event_id - 1].label = label;
BTC_TRACE_EVENT("%s: New registerd notification: event_id:0x%x, label:0x%x",
BTC_TRACE_EVENT("%s: New registered notification: event_id:0x%x, label:0x%x",
__FUNCTION__, event_id, label);
// set up callback
@ -947,7 +1012,7 @@ void btc_rc_handler(tBTA_AV_EVT event, tBTA_AV *p_data)
memset(&param, 0, sizeof(esp_avrc_ct_cb_param_t));
param.conn_stat.connected = true;
memcpy(param.conn_stat.remote_bda, btc_rc_cb.rc_addr, sizeof(esp_bd_addr_t));
btc_avrc_tg_cb_to_app(ESP_AVRC_CT_CONNECTION_STATE_EVT, &param);
btc_avrc_tg_cb_to_app(ESP_AVRC_TG_CONNECTION_STATE_EVT, &param);
}
} while (0);
btc_rc_cb.rc_features = p_data->rc_feat.peer_features;
@ -967,6 +1032,36 @@ void btc_rc_handler(tBTA_AV_EVT event, tBTA_AV *p_data)
handle_rc_passthrough_cmd(&p_data->remote_cmd);
}
break;
#if BTC_AV_CA_INCLUDED
case BTA_AV_CA_STATUS_EVT: {
btc_rc_cb.rc_cover_art_connected = p_data->ca_status.connected;
esp_avrc_ct_cb_param_t param;
memset(&param, 0, sizeof(esp_avrc_ct_cb_param_t));
if (p_data->ca_status.connected) {
param.cover_art_state.state = ESP_AVRC_COVER_ART_CONNECTED;
}
else {
param.cover_art_state.state = ESP_AVRC_COVER_ART_DISCONNECTED;
}
param.cover_art_state.reason = p_data->ca_status.reason;
btc_avrc_ct_cb_to_app(ESP_AVRC_CT_COVER_ART_STATE_EVT, &param);
}
break;
case BTA_AV_CA_DATA_EVT: {
esp_avrc_ct_cb_param_t param;
memset(&param, 0, sizeof(esp_avrc_ct_cb_param_t));
param.cover_art_data.status = p_data->ca_data.status;
param.cover_art_data.final = p_data->ca_data.final;
param.cover_art_data.data_len = p_data->ca_data.data_len;
param.cover_art_data.p_data = p_data->ca_data.p_data;
btc_avrc_ct_cb_to_app(ESP_AVRC_CT_COVER_ART_DATA_EVT, &param);
/* free the data packet now */
if (p_data->ca_data.p_hdr != NULL) {
osi_free(p_data->ca_data.p_hdr);
}
}
break;
#endif /* BTC_AV_CA_INCLUDED */
default:
BTC_TRACE_DEBUG("Unhandled RC event : 0x%x", event);
}
@ -1041,7 +1136,7 @@ static void btc_avrc_ct_deinit(void)
BTC_TRACE_API("## %s ##", __FUNCTION__);
if (g_a2dp_on_deinit) {
BTC_TRACE_WARNING("A2DP already deinit, AVRC CT shuold deinit in advance of A2DP !!!");
BTC_TRACE_WARNING("A2DP already deinit, AVRC CT should deinit in advance of A2DP !!!");
}
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
@ -1255,7 +1350,7 @@ static bt_status_t btc_avrc_ct_send_passthrough_cmd(uint8_t tl, uint8_t key_code
BTA_AvRemoteCmd(btc_rc_cb.rc_handle, tl,
(tBTA_AV_RC)key_code, (tBTA_AV_STATE)key_state);
status = BT_STATUS_SUCCESS;
BTC_TRACE_API("%s: succesfully sent passthrough command to BTA", __FUNCTION__);
BTC_TRACE_API("%s: successfully sent passthrough command to BTA", __FUNCTION__);
} else {
status = BT_STATUS_FAIL;
BTC_TRACE_DEBUG("%s: feature not supported", __FUNCTION__);
@ -1267,6 +1362,64 @@ static bt_status_t btc_avrc_ct_send_passthrough_cmd(uint8_t tl, uint8_t key_code
return status;
}
#if BTC_AV_CA_INCLUDED
static void btc_avrc_ct_cover_art_connect(UINT16 mtu)
{
if (!btc_rc_cb.rc_cover_art_connected) {
BTA_AvCaOpen(btc_rc_cb.rc_handle, mtu);
}
else {
BTC_TRACE_WARNING("%s: cover art already connected", __FUNCTION__);
}
return;
}
static void btc_avrc_ct_cover_art_disconnect(void)
{
if (btc_rc_cb.rc_cover_art_connected) {
BTA_AvCaClose(btc_rc_cb.rc_handle);
}
else {
BTC_TRACE_WARNING("%s: cover art not connected", __FUNCTION__);
}
return;
}
static void btc_avrc_ct_cover_art_get_image_properties(UINT8 *image_handle)
{
if (btc_rc_cb.rc_cover_art_connected) {
BTA_AvCaGet(btc_rc_cb.rc_handle, BTA_AV_CA_GET_IMAGE_PROPERTIES, image_handle, NULL, 0);
}
else {
BTC_TRACE_WARNING("%s: cover art not connected", __FUNCTION__);
}
return;
}
static void btc_avrc_ct_cover_art_get_image(UINT8 *image_handle, UINT8 *image_descriptor, UINT16 image_descriptor_len)
{
if (btc_rc_cb.rc_cover_art_connected) {
BTA_AvCaGet(btc_rc_cb.rc_handle, BTA_AV_CA_GET_IMAGE, image_handle, image_descriptor, image_descriptor_len);
}
else {
BTC_TRACE_WARNING("%s: cover art not connected", __FUNCTION__);
}
return;
}
static void btc_avrc_ct_cover_art_get_linked_thumbnail(UINT8 *image_handle)
{
if (btc_rc_cb.rc_cover_art_connected) {
BTA_AvCaGet(btc_rc_cb.rc_handle, BTA_AV_CA_GET_LINKED_THUMBNAIL, image_handle, NULL, 0);
}
else {
BTC_TRACE_WARNING("%s: cover art not connected", __FUNCTION__);
}
return;
}
#endif /* BTC_AV_CA_INCLUDED */
/*******************************************************************************
**
@ -1298,7 +1451,7 @@ static void btc_avrc_tg_init(void)
}
if (g_a2dp_on_init) {
BTC_TRACE_WARNING("AVRC Taget is expected to be initialized in advance of A2DP !!!");
BTC_TRACE_WARNING("AVRC Target is expected to be initialized in advance of A2DP !!!");
}
}
@ -1320,7 +1473,7 @@ static void btc_avrc_tg_deinit(void)
BTC_TRACE_API("## %s ##", __FUNCTION__);
if (g_a2dp_on_deinit) {
BTC_TRACE_WARNING("A2DP already deinit, AVRC TG shuold deinit in advance of A2DP !!!");
BTC_TRACE_WARNING("A2DP already deinit, AVRC TG should deinit in advance of A2DP !!!");
}
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
@ -1418,6 +1571,28 @@ void btc_avrc_ct_call_handler(btc_msg_t *msg)
btc_avrc_ct_send_set_absolute_volume_cmd(arg->set_abs_vol_cmd.tl, arg->set_abs_vol_cmd.volume);
break;
}
#if BTC_AV_CA_INCLUDED
case BTC_AVRC_CT_API_COVER_ART_CONNECT_EVT: {
btc_avrc_ct_cover_art_connect(arg->ca_conn.mtu);
break;
}
case BTC_AVRC_CT_API_COVER_ART_DISCONNECT_EVT: {
btc_avrc_ct_cover_art_disconnect();
break;
}
case BTC_AVRC_CT_API_COVER_ART_GET_IMAGE_PROPERTIES_EVT: {
btc_avrc_ct_cover_art_get_image_properties(arg->ca_get_img_prop.image_handle);
break;
}
case BTC_AVRC_CT_API_COVER_ART_GET_IMAGE_EVT: {
btc_avrc_ct_cover_art_get_image(arg->ca_get_img.image_handle, arg->ca_get_img.image_descriptor, arg->ca_get_img.image_descriptor_len);
break;
}
case BTC_AVRC_CT_API_COVER_ART_GET_LINKED_THUMBNAIL_EVT: {
btc_avrc_ct_cover_art_get_linked_thumbnail(arg->ca_get_lk_thn.image_handle);
break;
}
#endif
default:
BTC_TRACE_WARNING("%s : unhandled event: %d\n", __FUNCTION__, msg->act);
}

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -469,7 +469,7 @@ static esp_gatt_status_t btc_gatts_check_valid_attr_tab(esp_gatts_attr_db_t *gat
if(gatts_attr_db[i+1].att_desc.uuid_length != ESP_UUID_LEN_16 &&
gatts_attr_db[i+1].att_desc.uuid_length != ESP_UUID_LEN_32 &&
gatts_attr_db[i+1].att_desc.uuid_length != ESP_UUID_LEN_128) {
BTC_TRACE_ERROR("%s, The Charateristic uuid length = %d is invalid", __func__,\
BTC_TRACE_ERROR("%s, The Characteristic uuid length = %d is invalid", __func__,\
gatts_attr_db[i+1].att_desc.uuid_length);
return ESP_GATT_INVALID_ATTR_LEN;
}
@ -481,7 +481,7 @@ static esp_gatt_status_t btc_gatts_check_valid_attr_tab(esp_gatts_attr_db_t *gat
uuid == ESP_GATT_UUID_CHAR_SRVR_CONFIG || uuid == ESP_GATT_UUID_CHAR_PRESENT_FORMAT ||
uuid == ESP_GATT_UUID_CHAR_AGG_FORMAT || uuid == ESP_GATT_UUID_CHAR_VALID_RANGE ||
uuid == ESP_GATT_UUID_EXT_RPT_REF_DESCR || uuid == ESP_GATT_UUID_RPT_REF_DESCR) {
BTC_TRACE_ERROR("%s, The charateristic value uuid = %d is invalid", __func__, uuid);
BTC_TRACE_ERROR("%s, The characteristic value uuid = %d is invalid", __func__, uuid);
return ESP_GATT_INVALID_PDU;
}
}
@ -694,6 +694,7 @@ void btc_gatts_call_handler(btc_msg_t *msg)
}
param.rsp.status = 0;
param.rsp.conn_id = BTC_GATT_GET_CONN_ID(arg->send_rsp.conn_id);
btc_gatts_cb_to_app(ESP_GATTS_RESPONSE_EVT, BTC_GATT_GET_GATT_IF(arg->send_rsp.conn_id), &param);
break;
}

View File

@ -34,55 +34,48 @@ typedef enum {
SDP_TYPE_PBAP_PSE, // Phone Book Profile - Server
SDP_TYPE_PBAP_PCE, // Phone Book Profile - Client
SDP_TYPE_OPP_SERVER, // Object Push Profile
SDP_TYPE_SAP_SERVER // SIM Access Profile
SDP_TYPE_SAP_SERVER, // SIM Access Profile
SDP_TYPE_DIP_SERVER, // Device Identification Profile
} bluetooth_sdp_types;
typedef struct _bluetooth_sdp_hdr {
bluetooth_sdp_types type;
esp_bt_uuid_t uuid;
uint32_t service_name_length;
char *service_name;
int32_t rfcomm_channel_number;
int32_t l2cap_psm;
int32_t profile_version;
} bluetooth_sdp_hdr;
/**
* Some signals need additional pointers, hence we introduce a
* generic way to handle these pointers.
*/
typedef struct _bluetooth_sdp_hdr_overlay {
bluetooth_sdp_types type;
esp_bt_uuid_t bt_uuid;
uint32_t service_name_length;
char *service_name;
int32_t rfcomm_channel_number;
int32_t l2cap_psm;
int32_t profile_version;
// User pointers, only used for some signals - see bluetooth_sdp_ops_record
int user1_ptr_len;
uint8_t *user1_ptr;
int user2_ptr_len;
uint8_t *user2_ptr;
esp_bt_uuid_t uuid;
uint32_t service_name_length;
char *service_name;
int32_t rfcomm_channel_number;
int32_t l2cap_psm;
int32_t profile_version;
int user1_ptr_len;
uint8_t *user1_ptr;
int user2_ptr_len; // not used
uint8_t *user2_ptr; // not used
} bluetooth_sdp_hdr_overlay;
typedef struct _bluetooth_sdp_raw_record {
bluetooth_sdp_hdr_overlay hdr;
} bluetooth_sdp_raw_record;
typedef struct _bluetooth_sdp_mas_record {
bluetooth_sdp_hdr_overlay hdr;
uint32_t mas_instance_id;
uint32_t supported_features;
uint32_t supported_message_types;
uint32_t mas_instance_id;
uint32_t supported_features;
uint32_t supported_message_types;
} bluetooth_sdp_mas_record;
typedef struct _bluetooth_sdp_mns_record {
bluetooth_sdp_hdr_overlay hdr;
uint32_t supported_features;
uint32_t supported_features;
} bluetooth_sdp_mns_record;
typedef struct _bluetooth_sdp_pse_record {
bluetooth_sdp_hdr_overlay hdr;
uint32_t supported_features;
uint32_t supported_repositories;
uint32_t supported_features;
uint32_t supported_repositories;
} bluetooth_sdp_pse_record;
typedef struct _bluetooth_sdp_pce_record {
@ -91,22 +84,33 @@ typedef struct _bluetooth_sdp_pce_record {
typedef struct _bluetooth_sdp_ops_record {
bluetooth_sdp_hdr_overlay hdr;
int supported_formats_list_len;
uint8_t supported_formats_list[SDP_OPP_SUPPORTED_FORMATS_MAX_LENGTH];
int supported_formats_list_len;
uint8_t supported_formats_list[SDP_OPP_SUPPORTED_FORMATS_MAX_LENGTH];
} bluetooth_sdp_ops_record;
typedef struct _bluetooth_sdp_sap_record {
bluetooth_sdp_hdr_overlay hdr;
} bluetooth_sdp_sap_record;
typedef struct _bluetooth_sdp_dip_record {
bluetooth_sdp_hdr_overlay hdr;
uint16_t vendor;
uint16_t vendor_id_source;
uint16_t product;
uint16_t version;
bool primary_record;
} bluetooth_sdp_dip_record;
typedef union {
bluetooth_sdp_hdr_overlay hdr;
bluetooth_sdp_mas_record mas;
bluetooth_sdp_mns_record mns;
bluetooth_sdp_pse_record pse;
bluetooth_sdp_pce_record pce;
bluetooth_sdp_ops_record ops;
bluetooth_sdp_sap_record sap;
bluetooth_sdp_hdr_overlay hdr;
bluetooth_sdp_raw_record raw;
bluetooth_sdp_mas_record mas;
bluetooth_sdp_mns_record mns;
bluetooth_sdp_pse_record pse;
bluetooth_sdp_pce_record pce;
bluetooth_sdp_ops_record ops;
bluetooth_sdp_sap_record sap;
bluetooth_sdp_dip_record dip;
} bluetooth_sdp_record;
#endif /* __BT_SDP_H__ */

View File

@ -39,7 +39,14 @@ typedef enum {
BTC_AVRC_STATUS_API_SND_GET_RN_CAPS_EVT,
BTC_AVRC_NOTIFY_API_SND_REG_NOTIFY_EVT,
BTC_AVRC_CTRL_API_SND_SET_PLAYER_SETTING_EVT,
BTC_AVRC_CTRL_API_SND_SET_ABSOLUTE_VOLUME_EVT
BTC_AVRC_CTRL_API_SND_SET_ABSOLUTE_VOLUME_EVT,
#if BTC_AV_CA_INCLUDED
BTC_AVRC_CT_API_COVER_ART_CONNECT_EVT,
BTC_AVRC_CT_API_COVER_ART_DISCONNECT_EVT,
BTC_AVRC_CT_API_COVER_ART_GET_IMAGE_PROPERTIES_EVT,
BTC_AVRC_CT_API_COVER_ART_GET_IMAGE_EVT,
BTC_AVRC_CT_API_COVER_ART_GET_LINKED_THUMBNAIL_EVT,
#endif
} btc_avrc_act_t;
typedef struct {
@ -77,6 +84,28 @@ typedef struct {
uint8_t volume;
} set_abs_vol_cmd_t;
#if BTC_AV_CA_INCLUDED
typedef struct {
uint16_t mtu;
} ca_conn_t;
typedef struct {
uint8_t image_handle[7];
} ca_get_img_prop_t;
typedef struct {
uint8_t image_handle[7];
uint16_t image_descriptor_len;
uint8_t *image_descriptor;
} ca_get_img_t;
typedef struct {
uint8_t image_handle[7];
} ca_get_lk_thn_t;
#endif /* BTC_AV_CA_INCLUDED */
/* btc_avrc_args_t */
typedef union {
pt_cmd_t pt_cmd;
@ -85,6 +114,12 @@ typedef union {
ps_cmd_t ps_cmd;
get_caps_cmd_t get_caps_cmd;
set_abs_vol_cmd_t set_abs_vol_cmd;
#if BTC_AV_CA_INCLUDED
ca_conn_t ca_conn;
ca_get_img_prop_t ca_get_img_prop;
ca_get_img_t ca_get_img;
ca_get_lk_thn_t ca_get_lk_thn;
#endif
} btc_avrc_args_t;
/* btc_avrc_tg_act_t */
@ -124,6 +159,9 @@ typedef struct {
typedef struct {
BOOLEAN rc_connected;
#if BTC_AV_CA_INCLUDED
BOOLEAN rc_cover_art_connected;
#endif
UINT8 rc_handle;
tBTA_AV_FEAT rc_features;
UINT16 rc_ct_features;
@ -162,6 +200,8 @@ BOOLEAN btc_rc_get_connected_peer(BD_ADDR peer_addr);
********************************************************************************/
void btc_avrc_ct_call_handler(btc_msg_t *msg);
void btc_avrc_tg_call_handler(btc_msg_t *msg);
void btc_avrc_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
void btc_avrc_arg_deep_free(btc_msg_t *msg);
void btc_avrc_tg_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
void btc_avrc_tg_arg_deep_free(btc_msg_t *msg);
@ -179,6 +219,7 @@ uint16_t btc_avrc_tg_get_rn_supported_evt(void);
bool btc_avrc_tg_check_rn_supported_evt(uint16_t evt_set);
bool btc_avrc_tg_rn_evt_supported(uint8_t event_id);
bool btc_avrc_ct_rn_evt_supported(uint8_t event_id);
bool btc_avrc_ct_check_cover_art_support(void);
#endif ///BTC_AV_INCLUDED == TRUE

Some files were not shown because too many files have changed in this diff Show More