Compare commits

...

511 Commits

Author SHA1 Message Date
Roland Dobai
38eeba213a change(version): Update version to 4.4.7 2024-02-27 09:07:40 +01:00
David Čermák
1db39dfea9 Merge branch 'bugfix/w5500_copy_len_v4.4' into 'release/v4.4'
fix(esp_eth): W5500 receive function to return copy_len (v4.4)

See merge request espressif/esp-idf!29022
2024-02-23 15:06:57 +08:00
Mahavir Jain
f327ddf6ad Merge branch 'bugfix/ota_anti_rollback_checks_2_v4.4' into 'release/v4.4'
feat(bootloader_support): Read secure_version under sha256 protection (v4.4)

See merge request espressif/esp-idf!29062
2024-02-21 11:45:51 +08:00
Mahavir Jain
40fe00a65c fix(bootloader_support): check the secure version only for app image
Secure version in the image header is only available for the application
image. However, for certain security workflows, bootloader verifies
itself (own image) and hence the secure version check during that must be
avoided.

Regression introduced in recent commit-id: 3305cb4d

Tested that both secure boot and flash-enc workflows work correctly
with the anti-rollback scenario.
2024-02-20 11:20:03 +02:00
Mahavir Jain
1cf1f4ef9a Merge branch 'fix/build_failure_when_hardware_gcm_is_disabled_v4.4' into 'release/v4.4'
fix(mbedtls/gcm): Fix build failure when config `MBEDTLS_HARDWARE_GCM` is disabled (v4.4)

See merge request espressif/esp-idf!29070
2024-02-20 12:10:11 +08:00
harshal.patil
7f20e696b6 fix(mbedtls/gcm): Avoid using GCM hardware when config MBEDTLS_HARDWARE_GCM is disabled 2024-02-16 11:55:41 +05:30
harshal.patil
3bffba71c0 fix(mbedtls/gcm): Fix build failure when config MBEDTLS_HARDWARE_GCM is disabled 2024-02-16 11:55:41 +05:30
Mahavir Jain
6d2153d703 fix(ota): additional checks for secure version in anti-rollback case
Some additional checks related to secure version of the application in
anti-rollback case have been added to avoid any attempts to boot lower
security version but valid application (e.g., passive partition image).

- Read secure_version under sha256 protection

- First check has been added in the bootloader to ensure correct secure
  version after application verification and loading stage. This check
  happens before setting up the flash cache mapping and handling over
  the final control to application. This check ensures that application
  was not swapped (e.g., to lower security version but valid image) just
  before the load stage in bootloader.

- Second check has been added in the application startup code to ensure
  that currently booting app has higher security version than the one
  programmed in the eFuse for anti-rollback scenario. This will ensure
  that only the legit application boots-up on the device for
  anti-rollback case.
2024-02-15 15:23:19 +02:00
Mahavir Jain
6897e4e0fa Merge branch 'feature/update_mbedtls_to_v_2.28.7' into 'release/v4.4'
feat(mbedtls): Update mbedtls to 2.28.7

See merge request espressif/esp-idf!28942
2024-02-13 23:54:03 +08:00
Ondrej Kosta
e2e03ced38 fix(esp_eth): W5500 receive function to return copy_len 2024-02-12 10:36:29 +01:00
nilesh.kale
6fa8029146 feat(mbedtls): Update mbedtls to 2.28.7
This MR updates MbedlTLS version from 2.28.5 to 2.28.7
2024-02-09 11:38:23 +05:30
Jiang Jiang Jian
b2146b8aa3 Merge branch 'bugfix/fix_dangling_pointer_in_remove_bond_list_section_v4.4' into 'release/v4.4'
fix(bt/bluedroid): fix dangling pointer issue when logging removed section (backport v4.4)

See merge request espressif/esp-idf!28964
2024-02-07 22:02:09 +08:00
Jiang Jiang Jian
27bc69a6df Merge branch 'bugfix/fix_coex_wifi_restart_issue_v4.4' into 'release/v4.4'
Bugfix/fix coex wifi restart issue v4.4

See merge request espressif/esp-idf!28935
2024-02-07 19:32:22 +08:00
gongyantao
de32c62e90 fix(bt/bluedroid): fix dangling pointer issue when logging remove section 2024-02-07 15:10:30 +08:00
Rahul Tank
02312e6a31 Merge branch 'bugfix/fix_out_of_order_messages_causing_dos_v4.4' into 'release/v4.4'
fix(nimble): Out of order messages during SMP causing DOS vulnerability (v4.4)

See merge request espressif/esp-idf!28940
2024-02-07 11:59:44 +08:00
Jiang Jiang Jian
49961221ed Merge branch 'bugfix/ble_mesh_deinit_reinit_v4.4' into 'release/v4.4'
feat: ble mesh: improve ble mesh deinit when nimble enable(backport v4.4)

See merge request espressif/esp-idf!28923
2024-02-07 11:06:26 +08:00
Jiang Jiang Jian
21b041fe75 Merge branch 'bugfix/ble_mesh_ble_advtype_v4.4' into 'release/v4.4'
ble_mesh: update ble mesh ble adv type(backport v4.4)

See merge request espressif/esp-idf!28914
2024-02-07 10:55:27 +08:00
Sumeet Singh
abd29905ae fix(nimble): Out of order messages during SMP causing DOS vulerability (v4.4) 2024-02-06 16:46:27 +05:30
liuning
37bf723057 fix(wifi): fix wifi stop cost too much time 2024-02-06 16:10:14 +08:00
liuning
a43e575bb0 fix(clk): clear all lpclk source at clk init 2024-02-06 16:07:40 +08:00
InfiniteYuan
674f322b87 feat: ble mesh: improve ble mesh deinit when nimble enable 2024-02-06 14:45:31 +08:00
InfiniteYuan
16a6523220 ble_mesh: update ble mesh ble adv type 2024-02-06 14:17:02 +08:00
Jiang Jiang Jian
a8e38106d7 Merge branch 'bugfix/fix_esp_wifi_scan_start_memory_leakage_issue_v4.4' into 'release/v4.4'
fix(wifi): fix esp_wifi_scan_start memory leakage issue(Backport v4.4)

See merge request espressif/esp-idf!28904
2024-02-06 11:56:23 +08:00
muhaidong
0bfa176435 fix(wifi): fix esp_wifi_scan_start memory leakage issue
Closes https://github.com/espressif/esp-idf/issues/10693
2024-02-05 19:33:47 +08:00
Jiang Jiang Jian
2d60e58888 Merge branch 'docs/usb_host_stack_config_v4.4' into 'release/v4.4'
USB host: host stack configiuration docs backport to v4.4

See merge request espressif/esp-idf!28775
2024-02-05 19:30:55 +08:00
Jiang Jiang Jian
247cb8b72f Merge branch 'bugfix/fix_key_revocation_v4.4' into 'release/v4.4'
fix(app_update): Fix reading secure boot digest from register

See merge request espressif/esp-idf!28830
2024-02-05 19:29:43 +08:00
Island
839719a287 Merge branch 'bugfix/fix_dtm_tx_count_v4.4' into 'release/v4.4'
Update bt lib for ESP32-C3 and ESP32-S3(30b57c45)(backport v4.4)

See merge request espressif/esp-idf!28874
2024-02-05 14:45:12 +08:00
Jiang Jiang Jian
8ef5dcee5d Merge branch 'feature/add_api_to_get_controller_status_on_esp32_v4.4' into 'release/v4.4'
feat(ble/controller): Add API to get BLE controller status on ESP32 (backport v4.4)

See merge request espressif/esp-idf!28877
2024-02-05 11:07:32 +08:00
Jiang Jiang Jian
5adad46929 Merge branch 'feat/support_get_bluedroid_status_v4.4' into 'release/v4.4'
Support get status of bluedroid host (backport v4.4)

See merge request espressif/esp-idf!28884
2024-02-05 11:06:12 +08:00
Jiang Jiang Jian
2b490aeb2d Merge branch 'bugfix/fix_xQueueSemaphoreTask_assert_when_deinit_host_v4.4' into 'release/v4.4'
Fixed xQueueSemaphoreTask assert when deinit host during scan (backport v4.4)

See merge request espressif/esp-idf!28886
2024-02-05 11:03:33 +08:00
zhiweijian
d9a9c0cc9d Fixed xQueueSemaphoreTask assert when deinit host during scan 2024-02-04 19:15:52 +08:00
Jiang Jiang Jian
c2c7f53b94 Merge branch 'ci/new-known_failure_cases_workflow(v4.4)' into 'release/v4.4'
ci: change known_failure_cases workflow(v4.4)

See merge request espressif/esp-idf!27968
2024-02-04 17:42:47 +08:00
chenjianhua
30dbf89909 feat(bt/bluedroid): Support get status of bluedroid host 2024-02-04 17:02:27 +08:00
chenjianhua
730537b50c fix(bt/example): Fixed UART HCI when flow control is off on ESP32C3 2024-02-04 16:55:58 +08:00
chenjianhua
4ddb8587d9 feat(bt/bluedroid): Make the max number of bond device to be configurable 2024-02-04 16:55:51 +08:00
zhiweijian
52f7624853 feat(ble/controller): Add API to get BLE controller status on ESP32 2024-02-04 15:13:55 +08:00
zhanghaipeng
6b57f04cc8 fix(ble/controller): Fixed tx count in direct test mode on ESP32-C3 and ESP32-S3
- Fixed tx count in direct test mode on ESP32-C3 and ESP32-S3
- fixed modem sleep enter failed sometimes
2024-02-04 14:26:33 +08:00
chenjianhua
875317f9eb fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(91980c2)
- Fixed scheduling when modem sleep wakeup delayed
- Fixed IRQ FIFO overflow when enter critical
- Fixed clock sync timeout for modem sleep
- Fixed directed adv with RPA when privacy disabled
- Fixed instant passed for connection update and PHY update
2024-02-04 14:26:15 +08:00
Rahul Tank
bae43759c8 Merge branch 'bugfix/nimble_host_clean_up_api_v4.4' into 'release/v4.4'
fix(nimble): Added API to get current stack operation status (v4.4)

See merge request espressif/esp-idf!28859
2024-02-03 19:08:42 +08:00
Rahul Tank
b6c46fa270 fix(nimble): Added API to get current stack operation status (v4.4) 2024-02-03 09:04:15 +05:30
Rahul Tank
0456f9746a Merge branch 'bugfix/add_adv_itvl_range_check_v4.4' into 'release/v4.4'
fix(nimble): Add adv interval min/max range check (v4.4)

See merge request espressif/esp-idf!28854
2024-02-03 01:56:01 +08:00
Harshit Malpani
650c64a840 fix(app_update): Fix reading secure boot digest from register
While reading the key from the register, the register are read by
8 bit access which results in reading wrong data. Reading from the
peripheral should be 32 bit aligned. The commit updates the code
to read the secure boot key from the register using 32 bit access.

Closes https://github.com/espressif/esp-idf/issues/12851
2024-02-02 16:23:49 +05:30
morris
acfc9130c0 Merge branch 'bugfix/fix_adc_oneshot_do_not_spilt_clk_v4.4' into 'release/v4.4'
fix(adc): fix ADC oneshot mod don't divide clk (v4.4)

See merge request espressif/esp-idf!26705
2024-02-02 17:58:57 +08:00
Michael (XIAO Xufeng)
5684098285 Merge branch 'bugfix/hpm_dc_default_disabled_v4.4' into 'release/v4.4'
spi_flash: fixed issue that enabling HPM-DC by default may cause app unable to restart (v4.4)

See merge request espressif/esp-idf!28159
2024-02-02 17:40:17 +08:00
Rahul Tank
8efc66495b fix(nimble): Add adv interval min/max range check (v4.4) 2024-02-02 11:40:33 +05:30
morris
2a6797d016 kconfig: support plain comment in the menu 2024-02-02 10:33:59 +08:00
Xiao Xufeng
87182c9c76 doc(spi_flash): hide unsupported optional features 2024-02-02 10:33:59 +08:00
Xiao Xufeng
7bfc2b0418 spi_flash: fixed issue that enabling HPM-DC by default may cause app unable to restart 2024-02-02 10:33:59 +08:00
Rahul Tank
2ded73b2f4 Merge branch 'bugfix/fix_sm_inject_io_return_val_v4.4' into 'release/v4.4'
fix(nimble): Added change to ensure that API execution returns success (v4.4)

See merge request espressif/esp-idf!28652
2024-02-01 14:39:53 +08:00
morris
23173d3d72 Merge branch 'bugfix/fix_wrong_dcache_0_size_issue_on_s2_v4.4' into 'release/v4.4'
fix(cache): fix wrong dcache size 0 configuration issue on s2 (v4.4)

See merge request espressif/esp-idf!28292
2024-02-01 13:02:54 +08:00
Roland Dobai
205173d241 Merge branch 'feature/python-reorder-imports-instead-isort_v4.4' into 'release/v4.4'
feat: Use python-reorder-imports instead of isort (v4.4)

See merge request espressif/esp-idf!28735
2024-01-31 19:38:20 +08:00
Darshan Dobariya
93ae438d59 fix(nimble): Added change to ensure that API execution returns success (v4.4) 2024-01-31 14:45:55 +05:30
Jan Beran
577a076bff feat: Use python-reorder-imports instead of isort 2024-01-31 09:13:42 +01:00
Rahul Tank
94853f775b Merge branch 'bugfix/add_minor_fixes_debug_v4.4' into 'release/v4.4'
fix(nimble): Add minor debug fixes (v4.4)

See merge request espressif/esp-idf!28535
2024-01-31 16:03:42 +08:00
Jiang Jiang Jian
61e7464645 Merge branch 'bugfix/no_wakeup_sleep_v4.4' into 'release/v4.4'
fix(ble): Fixed Bluetooth not waking up due to clock drift(v4.4)

See merge request espressif/esp-idf!28725
2024-01-31 14:02:32 +08:00
igor.udot
80b7b6caf1 ci: change known_failure_cases workflow 2024-01-31 12:17:48 +08:00
Jiang Jiang Jian
3afb4b5446 Merge branch 'feature/add_fall_back_dns_config_in_menuconfig_v4.4' into 'release/v4.4'
feat(lwip): add fall back dns config in menuconfig (v4.4)

See merge request espressif/esp-idf!28689
2024-01-31 10:39:50 +08:00
David Čermák
7e8f62cfb4 Merge branch 'bugfix/eth_ci_runners_v4.4' into 'release/v4.4'
Moved CI ETH runners to Brno v4.4

See merge request espressif/esp-idf!28604
2024-01-30 17:56:05 +08:00
xiongweichao
8e41d56dbe fix(ble): Fixed macro definition error for 136K clock drift 2024-01-30 16:06:34 +08:00
xiongweichao
2a7e9fc485 fix(ble): Fixed Bluetooth not waking up due to clock drift 2024-01-30 15:30:09 +08:00
Jiang Jiang Jian
fe0da0eef3 Merge branch 'bugfix/fix_ble_tx_2m_problem_causing_by_phy_wifi_enable_set_v4.4' into 'release/v4.4'
fix(esp_phy): Fixed BLE TX 2M problem causing by phy_wifi_enable_set() (backport v4.4)

See merge request espressif/esp-idf!28769
2024-01-30 14:42:36 +08:00
morris
8f53bdb834 Merge branch 'bugfix/fix_incorrect_regbase_name_of_i2s_v4.4' into 'release/v4.4'
fix(i2s): fixed incorrect reg base name on C3 (v4.4)

See merge request espressif/esp-idf!28633
2024-01-30 10:32:00 +08:00
mofeifei
6391316f30 docs: update cn trans usb_host.rst 2024-01-29 10:51:26 +01:00
Roman Leonov
d2a4247f8d feat(docs): added USB Host Stack Configuration description 2024-01-29 10:44:53 +01:00
zhiweijian
28ac68224d fix(esp_phy): Fixed BLE TX 2M problem causing by phy_wifi_enable_set()
1. Fixed BLE 2M phy TX problem causing by phy_wifi_enable_set() on ESP32-C3 and ESP32-S3
2. Fixed BLE and WIFI could not receive packets after entering light sleep for a long time on ESP32-C3 and ESP32-S3
2024-01-29 16:39:36 +08:00
Ondrej Kosta
b244b6e86b ci(esp_eth): enabled Ethernet IP101 runner back
Moved LAN8720 test to different runner
2024-01-29 08:26:28 +01:00
Jiang Jiang Jian
27ec26d2d3 Merge branch 'bugfix/fix_pmk_invalid_wpa_or_wpa2_connect_fail_issue_v4.4' into 'release/v4.4'
fix(wifi): fix pmk invalid lead same ssid wpa and wpa2 connect fail issue(Backport v4.4)

See merge request espressif/esp-idf!28670
2024-01-29 10:49:46 +08:00
Jiang Jiang Jian
7c8aabda7d Merge branch 'feature/supplicant_bss_extmem_v4.4' into 'release/v4.4'
WiFi: Add support to move supplicant BSS to external memory (v4.4)

See merge request espressif/esp-idf!28746
2024-01-29 10:35:05 +08:00
Kapil Gupta
944862de25 fix(wifi): Add support to move supplicant BSS to external memory 2024-01-27 11:13:09 +05:30
laokaiyao
6340b958fe fix(i2s): fixed incorrect reg base name on C3
Closes https://github.com/espressif/esp-idf/issues/12643
2024-01-26 18:45:19 +08:00
Wang Meng Yang
3f0f8f3ed6 Merge branch 'bugfix/spp_disc_connect_btqabr2023_156_v4.4' into 'release/v4.4'
fix(bt/bluedroid): Fixed SPP connection failure(v4.4)

See merge request espressif/esp-idf!28559
2024-01-26 11:49:12 +08:00
xiongweichao
449ab48101 fix(bt/bluedroid): Fixed SPP connection failure
The connection failure is caused by the BTU and application layer status being out of sync.
2024-01-25 19:55:00 +08:00
Island
b9124d3ab3 Merge branch 'bugfix/fix_some_ble_issue_v4.4' into 'release/v4.4'
Bugfix/fix some ble issue v4.4(backport v4.4)

See merge request espressif/esp-idf!28614
2024-01-25 12:00:11 +08:00
zhangyanjiao
75b4fb5a66 feat(lwip): add fall back dns config in menuconfig
Closes https://github.com/espressif/esp-idf/issues/12530
2024-01-25 11:21:28 +08:00
Jiang Jiang Jian
a589ecdca8 Merge branch 'bugfix/fix_systick_lost_in_esp32_dfs_v4.4' into 'release/v4.4'
fix(esp_pm): safely check ccompare validity in DFS update_ccompare (v4.4)

See merge request espressif/esp-idf!28564
2024-01-24 19:11:11 +08:00
muhaidong
dd0e27ad74 fix(wifi): fix pmk invalid lead same ssid wpa and wpa2 connect fail issue 2024-01-24 19:07:40 +08:00
Rahul Tank
2746916f21 fix(nimble): Add minor debug fixes 2024-01-24 18:32:38 +08:00
zhanghaipeng
6627b4edd7 feat(bt/bluedroid): Support ext adv aux option 2024-01-24 18:29:38 +08:00
zhanghaipeng
b13dfdceed fix(bt/bluedroid): Fix BLE malloc internal wrapper fail 2024-01-24 18:29:38 +08:00
Zeke Gustafson
3811384d6e feat(ble/bluedroid): Add getter for BLE GAP callback 2024-01-24 18:29:38 +08:00
Zeke Gustafson
ff14780dfd feat(ble/bluedroid): Add getter for BLE GATTS callback 2024-01-24 18:29:38 +08:00
zhanghaipeng
b4148534f6 feat(ble/bluedroid): Add getter for BLE GATTC calllback 2024-01-24 18:29:38 +08:00
zhanghaipeng
2d244b521d docs(ble/bluedroid): Optimize documentation for BLE duplicate scan 2024-01-24 18:29:38 +08:00
zhanghaipeng
b11b9dabb3 fix(ble/bluedroid): Fix dangling pointer issue in deletion of bonded devices 2024-01-24 18:29:38 +08:00
zhanghaipeng
eef6f5f392 fix(ble/bluedroid): Fix BLE background connection log level 2024-01-24 18:29:38 +08:00
Jiang Jiang Jian
a1c2e7161b Merge branch 'bugfix/fix_scan_request_ifs_error_v4.4' into 'release/v4.4'
Fixed BLE scan request ifs time error in coexistence scenarios(backport v4.4)

See merge request espressif/esp-idf!28577
2024-01-24 17:55:15 +08:00
liuning
cb0287f01c fix(esp_coex): Fixed potential BLE scan request ifs timer error bug 2024-01-24 11:27:12 +08:00
zhiweijian
6c5268da38 Fixed BLE scan request ifs timer error in coexistence scenarios 2024-01-24 11:27:12 +08:00
wuzhenghui
8847d25638 fix(esp_pm): safely check ccompare validity in DFS update_ccompare 2024-01-24 11:26:32 +08:00
Jiang Jiang Jian
e61e19b64e Merge branch 'ci/disable_ip101_tests' into 'release/v4.4'
ci: comment ip101 test case (v4.4)

See merge request espressif/esp-idf!28636
2024-01-24 11:25:42 +08:00
Fu Hanxi
d225370c31 ci: comment ip101 test case
otherwise assign test will fail
2024-01-23 08:13:17 +01:00
Island
9186e0e22d Merge branch 'bugfix/ble_check_adv_data_v4.4' into 'release/v4.4'
fix(bt/bluedroid): Fix ble adv data check to avoid memory overflow(backport v4.4)

See merge request espressif/esp-idf!28408
2024-01-22 10:42:37 +08:00
Island
753bed36c4 Merge branch 'bugfix/fix_ble_memory_leak_v4.4' into 'release/v4.4'
fix(ble/bluedroid): Fix ble memory leak when gattc config off(backport v4.4)

See merge request espressif/esp-idf!28498
2024-01-22 10:42:22 +08:00
Marius Vikhammer
fd06a6e74c Merge branch 'bugfix/linenoise_calculates_negative_prompt_len_v4.4' into 'release/v4.4'
fix(console): Fixed linenoise prompt length calculation (v4.4)

See merge request espressif/esp-idf!28529
2024-01-19 09:58:56 +08:00
Wang Meng Yang
53dd2baa6b Merge branch 'bugfix/fix_mac_bb_pd_iwdt_timeout_v4.4' into 'release/v4.4'
fix(ble): fixed interrupt timeout in MAC_BB_PD callback (v4.4)

See merge request espressif/esp-idf!28467
2024-01-18 17:57:31 +08:00
Rahul Tank
f765235123 Merge branch 'bugfix/address_resolution_v4.4' into 'release/v4.4'
fix(nimble): Added support for address resolution during inquiry (v4.4)

See merge request espressif/esp-idf!28522
2024-01-18 13:29:32 +08:00
Jiang Jiang Jian
9a9533d5a4 Merge branch 'bugfix/fix_crash_issue_when_mesh_deinit_v4.4' into 'release/v4.4'
fix(wifi): fix the crash and malloc fail issue (v4.4)

See merge request espressif/esp-idf!28540
2024-01-18 11:58:40 +08:00
Jiang Jiang Jian
0bce68089c Merge branch 'ci/temp_disable_jobs_v4.4' into 'release/v4.4'
ci: remove ip101 jobs and twai_std jobs (v4.4)

See merge request espressif/esp-idf!28380
2024-01-18 11:11:52 +08:00
Jiang Jiang Jian
2acfd88a47 Merge branch 'bugfix/change_default_value_for_ip_ttl_4.4' into 'release/v4.4'
Fix(lwip):bugfix for change default value for ip ttl 4.4

See merge request espressif/esp-idf!28398
2024-01-18 11:11:02 +08:00
Michael (XIAO Xufeng)
90f913734b Merge branch 'bugfix/recalib_bbpll_before_tuning_v4.4' into 'release/v4.4'
fix(bbpll): fix bbpll may not lock or not stable bug for stop early (ESP32C2/S3/C6/H2) (v4.4)

See merge request espressif/esp-idf!28287
2024-01-18 11:00:21 +08:00
zhangyanjiao
bcc7ea3137 fix(wifi): fix the crash and malloc fail issue
1. fix(wifi/mesh): fix the crash issue when mesh deinit
2. fix(wifi):fix when ap recv auth in sa query porcess will memset psq issue
2024-01-17 19:58:15 +08:00
Sudeep Mohanty
bc11b9183b fix(console): Fixed linenoise prompt length calculation
This commit fixes a potential issue where in the prompt length used
for the linenoise based console could be calculated as a negative
integer, leading to a console hang.

Closes https://github.com/espressif/esp-idf/issues/4924
2024-01-17 09:43:01 +01:00
Mahavir Jain
bb46e6529c Merge branch 'bugfix/update_jtag_disabling_api_v4.4' into 'release/v4.4'
fix(esp_hw_support): fix API esp_hmac_disable_jtag() to disable JTAG (v4.4)

See merge request espressif/esp-idf!28508
2024-01-17 16:09:20 +08:00
Darshan Dobariya
97934f52ea fix(nimble): Added support for address resolution during inquiry (v4.4) 2024-01-17 11:51:05 +05:30
nilesh.kale
3afa52bb88 fix(esp_hw_support): fix API esp_hmac_disable_jtag() to disable JTAG
After ets_hmac_disable(), invalidating JTAG register process is ineffective.
So, added call to enable hmac begore invalidating JTAG REG.
And similarly disabled it after invalidation.
2024-01-16 15:42:13 +05:30
Xiao Xufeng
9c6ccec971 fix(rtc): fixed bbpll not calibrated from bootloader issue 2024-01-16 18:09:48 +08:00
chaijie@espressif.com
8f581352e0 fix(bbpll): fix bbpll calibration may stop early bug (S3) 2024-01-16 18:08:36 +08:00
zhanghaipeng
8b66455e5c fix(ble/bluedroid): Fix ble memory leak when gattc config off 2024-01-16 15:45:41 +08:00
Roland Dobai
2a6cbd0d3d Merge branch 'fix/kconcheck_checks_v4.4' into 'release/v4.4'
fix(kconfcheck): Fixed false-positive indent errors and extended limits (backport v4.4)

See merge request espressif/esp-idf!28475
2024-01-16 00:34:05 +08:00
Jakub Kocka
474d150477 fix(kconfcheck): Fixed false-positive indent errors and extended limits 2024-01-15 13:02:21 +01:00
linruihao
b9cf89ac23 fix(ble): fixed interrupt timeout in MAC_BB_PD callback 2024-01-15 16:17:19 +08:00
Rahul Tank
8a97a02001 Merge branch 'bugfix/handle_task_lock_v4.4' into 'release/v4.4'
fix(nimble): Remove unwanted task lock check when HS_DEBUG is enabled (v4.4)

See merge request espressif/esp-idf!28420
2024-01-15 15:04:30 +08:00
morris
f6a76d8e09 Merge branch 'bugfix/i2s_tx_mono_issue_v4.4' into 'release/v4.4'
fix(i2s): fixed i2s incorrect tx mono slot (v4.4)

See merge request espressif/esp-idf!28450
2024-01-15 14:44:41 +08:00
laokaiyao
f0dc5aecf6 fix(i2s): fixed i2s incorrect tx mono slot (v4.4) 2024-01-15 10:53:50 +08:00
Mahavir Jain
256f03471e Merge branch 'ci/fix_test_http_server_file_serving' into 'release/v4.4'
ci: optimize test protocol_http_server_file_serving

See merge request espressif/esp-idf!28373
2024-01-12 11:48:51 +08:00
Island
56c4d34fca Merge branch 'feat/ble_mesh_miscellaneous_update_v4.4' into 'release/v4.4'
feat(ble_mesh): Miscellaneous updates for mesh kconfig, relay related(v4.4)

See merge request espressif/esp-idf!28035
2024-01-12 10:34:51 +08:00
Rahul Tank
5b644edfd4 fix(nimble): Remove unwanted task lock check when HS_DEBUG is enabled 2024-01-11 17:32:17 +05:30
zhanghaipeng
6d55e5e7bf fix(bt/bluedroid): Fix ble adv data check to avoid memory overflow 2024-01-11 16:36:01 +08:00
Xue yun fei
d54c947628 Fix(lwip):bugfix for change default value for ip ttl 2024-01-11 14:35:36 +08:00
Chen Yudong
fafab20b3f ci: optimize test protocol_http_server_file_serving 2024-01-10 19:48:35 +08:00
Fu Hanxi
19c9202768 ci: remove ip101 jobs and twai_std jobs 2024-01-10 10:34:56 +01:00
Mahavir Jain
2a1133c1cc Merge branch 'feat/update_cjson_v1_7_17_v4.4' into 'release/v4.4'
feat(cJSON): update submodule to v1.7.17 (v4.4)

See merge request espressif/esp-idf!28351
2024-01-10 11:55:31 +08:00
Jiang Jiang Jian
af2ce6de13 Merge branch 'bugfix/reset_connectionless_pm_status_v4.4' into 'release/v4.4'
fix(coex): fix esp32 ble scan interrupted by Wi-Fi, reset Wi-Fi connectionless pm status

See merge request espressif/esp-idf!28082
2024-01-10 11:31:28 +08:00
luoxu
edf80c574e feat(ble_mesh): Miscellaneous updates for mesh kconfig, relay related 2024-01-10 10:18:40 +08:00
Island
7af69b9ddb Merge branch 'bugfix/increase_btu_task_stack_size_v4.4' into 'release/v4.4'
fix(bt/bludroid): Increase BTU task stack size(backport v4.4)

See merge request espressif/esp-idf!28320
2024-01-09 15:25:18 +08:00
Harshit Malpani
cd7cef5ceb feat(cjson): update submodule to v1.7.17
Changelog: https://github.com/DaveGamble/cJSON/releases/tag/v1.7.17
2024-01-09 12:16:07 +05:30
Rahul Tank
efe283f16f Merge branch 'bugfix/reattempt_conn_feat_extended_v4.4' into 'release/v4.4'
fix(nimble): Support for reattempt connection in ext connect (v4.4)

See merge request espressif/esp-idf!28309
2024-01-08 20:44:00 +08:00
linruihao
73152761f6 fix(bt/bludroid): Increase BTU task stack size 2024-01-08 11:37:28 +08:00
Rahul Tank
517a2c5132 fix(nimble): Support for reattempt connection in ext connect 2024-01-05 16:45:58 +05:30
Island
ca7cc8e903 Merge branch 'bugfix/fix_ble_robost_cashing_v4.4' into 'release/v4.4'
fix(bt/bluedroid): Fix BLE robost cashing config(backport v4.4)

See merge request espressif/esp-idf!28198
2024-01-05 12:45:05 +08:00
Armando
61ac7f8a91 fix(cache): fix wrong dcache size 0 configuration issue on s2
Closes https://github.com/espressif/esp-idf/issues/12711
2024-01-05 10:41:56 +08:00
Roland Dobai
bb8dd9d35b Merge branch 'ci/pre_commit_sbom_validation_v4.4' into 'release/v4.4'
ci: add sbom validation using pre-commit's post-commit stage (v4.4)

See merge request espressif/esp-idf!28231
2024-01-03 18:37:52 +08:00
morris
88aae9e8d6 Merge branch 'refactor/uart_read_bytes_from_ringbuf_v4.4' into 'release/v4.4'
change(uart): improved the internal logic of uart_read_bytes (v4.4)

See merge request espressif/esp-idf!28223
2024-01-03 14:13:53 +08:00
morris
c272210e74 Merge branch 'contrib/github_pr_12559_v4.4' into 'release/v4.4'
fix(spi): Correct REG_SPI_BASE(i) macro for all targets (GitHub PR) (v4.4)

See merge request espressif/esp-idf!27717
2024-01-03 11:37:16 +08:00
Frantisek Hrbata
471c3263b5 ci: add sbom validation using pre-commit's post-commit stage
With 09ba070b7e ("fix: allow to use older pre-commit hook version")
and b93cc581a5 ("fix: set default pre-commit hook stages to pre-commit..")
we set the default pre-commit hook stage to commit/pre-commit, which avoids
running the pre-commit plugins/hooks multiple times for different stages.
Unfortunately this also affects "pre-commit run" used in CI and
now it runs only plugins which are by default using the
commit/pre-commit stage. Meaning the sbom validation, which uses
post-commit, is not run at all. This adds an explicit pre-commit command
for validate-sbom-manifest plugin, which needs to be started in
post-commit stage.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-01-02 16:30:50 +01:00
Song Ruo Jing
520fb6ab09 change(uart): improved the internal logic of uart_read_bytes
Ringbuffer usage becomes more efficient with the use of xRingbufferReceiveUpTo

Closes https://github.com/espressif/esp-idf/issues/12386
2024-01-02 20:17:28 +08:00
zhanghaipeng
0406d64dd2 fix(bt/bluedroid): Update ble gattc gatts coex example 2024-01-02 12:10:55 +08:00
zhanghaipeng
a2e2bfdbd4 fix(bt/bluedroid): Optimize ble remove all bonded devices function 2024-01-02 12:10:18 +08:00
zhanghaipeng
1ddeab56a9 fix(bt/bluedroid): Update ble ibeacon example document 2024-01-02 12:10:18 +08:00
Jiang Jiang Jian
8262c19a51 Merge branch 'bugfix/boot_flash_build_v4.4' into 'release/v4.4'
bugfix(spi_flash): Fix build error when octal flash is enabled (backport v4.4)

See merge request espressif/esp-idf!28091
2024-01-02 10:14:34 +08:00
Jiang Jiang Jian
ece1bf242e Merge branch 'bugfix/fix_ble_app_unregister_no_event_v4.4' into 'release/v4.4'
fix(bt/bluedroid): Fix ble app unregister no event(backport v4.4)

See merge request espressif/esp-idf!28173
2023-12-31 14:22:22 +08:00
zhanghaipeng
4404659605 fix(bt/bluedroid): Fix BLE robost cashing config 2023-12-30 20:16:28 +08:00
zhanghaipeng
8ddc31a001 fix(bt/bluedroid): Fix ble app unregister no event 2023-12-28 19:16:35 +08:00
Michael (XIAO Xufeng)
c1c69210de Merge branch 'bugfix/idf_ci_build_is_not_set_v4.4' into 'release/v4.4'
ci: Fix environment variable IDF_CI_BUILD is not set (v4.4)

See merge request espressif/esp-idf!27681
2023-12-28 18:50:21 +08:00
Jiang Jiang Jian
54c529a21b Merge branch 'bugfix/crash_in_btc_hf_init_v4.4' into 'release/v4.4'
fix(bt/bluedroid): Avoided crash of LoadProhibited during HFP AG deinitialization (v4.4)

See merge request espressif/esp-idf!28119
2023-12-27 19:40:44 +08:00
Jiang Jiang Jian
6d853f0525 Merge branch 'bugfix/fix_establish_two_sco_fail_v4.4' into 'release/v4.4'
fix(bt/controller): Fixed establish two sco connections failed (Backport v4.4)

See merge request espressif/esp-idf!28102
2023-12-27 19:40:23 +08:00
Jin Cheng
4cdd3bcc4e fix(bt/bluedroid): Disabled Sniff Subrating temporarily as it did not work well 2023-12-26 11:53:07 +08:00
Jin Cheng
48594fc6e7 fix(bt/bluedroid): Changed the default air mode to invalid value 2023-12-26 11:53:07 +08:00
Jin Cheng
7142dbafe3 fix(bt/bluedroid): Removed redundant operation of SCO clean up 2023-12-26 11:53:06 +08:00
Jin Cheng
3aecd14840 fix(bt/bluedroid): Corrected the definitions of HF Client callback events 2023-12-26 11:53:06 +08:00
Jin Cheng
9490f87838 fix(bt/bluedroid): Avoided crash of LoadProhibited during HFP AG deinitialization
Move the release of the control blocks from the start
of deinitialization to the profile disabled event.
2023-12-26 11:53:06 +08:00
Jin Cheng
72ab07a68d fix(bt/bluedroid): Added dynamic memory allocation for HFP control blocks 2023-12-26 11:53:06 +08:00
Cao Sen Miao
ebb65b27db bugfix(spi_flash): Fix build error when octal flash is enabled,
Closes https://github.com/espressif/esp-idf/issues/12850
2023-12-25 14:54:04 +08:00
linruihao
06f28ca17b fix(bt/controller): Fixed establish two sco connections failed 2023-12-25 10:50:30 +08:00
Michael (XIAO Xufeng)
f810eb7a39 ci: Fix environment variable IDF_CI_BUILD is not set 2023-12-23 18:47:36 +08:00
Jiang Jiang Jian
70d6d09d60 Merge branch 'bugfix/fix_ble_phy_tx_ifs_v4.4' into 'release/v4.4'
Bugfix/fix ble phy tx ifs v4.4(backport v4.4)

See merge request espressif/esp-idf!28064
2023-12-23 00:49:22 +08:00
Jiang Jiang Jian
40f42289a0 Merge branch 'fix/btc_config_lock_error_v4.4' into 'release/v4.4'
fix(bt/bluedroid): fixed btc_config_lock error (backport v4.4)

See merge request espressif/esp-idf!28072
2023-12-22 15:16:19 +08:00
wanlei
a0e8f75336 fix(spi): correct some signals and dummy bits docs 2023-12-22 15:08:45 +08:00
TD-er
41b8238cf3 fix(spi): Correct REG_SPI_BASE(i) macro for all targets
The existing formula can never match these registers.

Closes https://github.com/espressif/esp-idf/pull/12559
Closes https://github.com/espressif/esp-idf/pull/12562
2023-12-22 15:08:45 +08:00
zhanghaipeng
54ba0f88e9 fix(phy): Fix ble tx ifs time for ESP32 2023-12-22 14:35:17 +08:00
liuning
0662ac672e fix(coex): fix esp32 ble scan interrupted by Wi-Fi, reset Wi-Fi connectionless pm status 2023-12-22 13:29:58 +08:00
gongyantao
265b54a015 fix(bt/bluedroid): fixed btc_config_lock error 2023-12-22 11:31:18 +08:00
Jiang Jiang Jian
73da4fe25d Merge branch 'bugfix/dpp_deinit_memleak_v44' into 'release/v4.4'
Ensure beacon timeout gets trigerred for AP config change(v4.4)

See merge request espressif/esp-idf!27848
2023-12-21 13:49:25 +08:00
Jiang Jiang Jian
69bb72a5c1 Merge branch 'bugfix/fix_ble_recorrect_enable_bug_v4.4' into 'release/v4.4'
fix(ble/controller): Fixed BLE recorrect enable bug and fixed BLE bb isr enable by default (backport v4.4)

See merge request espressif/esp-idf!28043
2023-12-21 13:48:46 +08:00
morris
3fb1a627ac Merge branch 'fix/twai_tag_not_defined_in_configure_gpio_v4.4' into 'release/v4.4'
fix(twai): fix build error TWAI_TAG used but not defined (v4.4)

See merge request espressif/esp-idf!27833
2023-12-21 11:47:47 +08:00
Jiang Jiang Jian
05ab87ca27 Merge branch 'fix/freertos_scheduler_suspension_test_v4.4' into 'release/v4.4'
fix(freertos): Fixed a failing scheduler suspension unit test (v4.4)

See merge request espressif/esp-idf!28042
2023-12-21 10:58:56 +08:00
morris
53a1bb853c Merge branch 'bugfix/bod_intr_v4.4' into 'release/v4.4'
brownout: Disable the hardware BOD when BOD interrupt is enabled(backport v4.4)

See merge request espressif/esp-idf!27437
2023-12-21 10:35:09 +08:00
morris
8430331e6b Merge branch 'bugfix/fix_adc_continuous_do_not_rst_apb_clk_v4.4' into 'release/v4.4'
fix(adc): fix adc continuous get less results beacuse do not reset apb clk (v4.4)

See merge request espressif/esp-idf!27612
2023-12-21 10:32:48 +08:00
zhiweijian
493a161875 fix(ble/controller): Fixed BLE recorrect enable bug and fixed BLE bb isr enable by default 2023-12-20 21:51:52 +08:00
Island
11f9081a0e Merge branch 'backport/fix_ble_prepare_write_v4.4' into 'release/v4.4'
Backport/fix ble prepare write v4.4

See merge request espressif/esp-idf!27907
2023-12-20 21:46:07 +08:00
Sudeep Mohanty
0dc2f2410d fix(freertos): Fixed a failing scheduler suspension unit test
This test fixes the flaky unit test which suspends the scheduler and prompts
a pending context switch.
2023-12-20 14:44:42 +01:00
Roland Dobai
cdc3baac87 Merge branch 'fix/sbom_validation_post_commit_v4.4' into 'release/v4.4'
fix: do sbom manifest validation in post-commit (v4.4)

See merge request espressif/esp-idf!28013
2023-12-20 00:11:30 +08:00
Frantisek Hrbata
1ba5757fed fix: do sbom manifest validation in post-commit
Following commit c3afbebf23 ("fix: bump esp-idf-sbom to v0.13.0 in pre-commit"),
the validation of submodule hash now relies solely on the information recorded
in the git-tree. Previously, the hash verification used submodule's
working tree hash if available. Since the new submodule hash is recorded
in git-tree only after the commit is created, we need to move the check
into post-commit, otherwise the hash validation checks the old value.

For example:

1. in .gitmodules

	[submodule "components/json/cJSON"]
	   sbom-hash = cb8693b058ba302f4829ec6d03f609ac6f848546

2. update the cJSON

	$ git -C components/json/cJSON checkout b45f48e600671feade0b6bd65d1c69de7899f2be

3. update cJSON hash in .gitmodules

	[submodule "components/json/cJSON"]
	   sbom-hash = b45f48e600671feade0b6bd65d1c69de7899f2be

4. commit the changes

	$ git commit -a -s

Step 4. will fail, because the validation is currently started in pre-commit stage,
where the hash for cJSON recorded in git-tree is still
cb8693b058ba302f4829ec6d03f609ac6f848546. The new hash b45f48e600671feade0b6bd65d1c69de7899f2be
will be stored in git-tree after the new commit is created.

Note that this means we cannot prevent the commit creation, but only
notify user about the hash inconsistency. If he/she still decides to
push it, it will fail in pre-commit checks in CI.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-12-19 12:34:36 +01:00
zhanghaipeng
36169e6beb fix(bt/bluedroid): Fix prepare write for BLE example 2023-12-19 17:00:37 +08:00
Island
ad44330e8e Merge branch 'bugfix/ble_stack_disable_v4.4' into 'release/v4.4'
Bugfix/ble stack disable v4.4(backport v4.4)

See merge request espressif/esp-idf!27648
2023-12-19 12:02:50 +08:00
zhanghaipeng
3263b4e75f fix(bt/bluedroid): Fix ble adv and scan status when deinit bluedroid 2023-12-18 18:55:26 +08:00
zhanghaipeng
7364d276f7 fix(bt/bluedroid): Fix ble gattc deregister 2023-12-18 18:55:26 +08:00
wanlei
7f9636f6ea fix(twai): fix build error TWAI_TAG used but not defined
bug introduced from efef8401
closes https://github.com/espressif/esp-idf/issues/12760
2023-12-18 16:18:22 +08:00
Jiang Jiang Jian
979a56386d Merge branch 'optimize/When_psram_is_enable_the_number_of_ooseq_is_not_limited_4.4' into 'release/v4.4'
optimize(lwip):when psram is enable the number of ooseq is not limited 4.4

See merge request espressif/esp-idf!27946
2023-12-18 13:46:12 +08:00
zhanghaipeng
4c4e95cae9 fix(bt/bluedroid): Fix BLE prepare write 2023-12-18 11:29:35 +08:00
Jiang Jiang Jian
ef543e8e56 Merge branch 'bugfix/miss_rm_s3_ld_v4.4' into 'release/v4.4'
fix(WiFi): update esp32s3 rom ld(v4.4)

See merge request espressif/esp-idf!27958
2023-12-18 11:15:42 +08:00
morris
a362b87809 Merge branch 'fix/spi_lcd_example_fix_border_pixel_display_v4.4' into 'release/v4.4'
fix(spi_master): fixed lcd example block border pixel issue (v4.4)

See merge request espressif/esp-idf!27922
2023-12-18 11:10:47 +08:00
Mahavir Jain
f19f6e0561 Merge branch 'feature/update_nghttp2_lib_v4.4' into 'release/v4.4'
feat(nghttp2): Update nghttp2 lib to v1.58.0

See merge request espressif/esp-idf!27707
2023-12-17 16:39:02 +08:00
alanmaxwell
6007eb82fa fix(WiFi): update esp32s3 rom ld 2023-12-16 13:33:26 +08:00
jgujarathi
d82f42a464 fix(wpa_supplicant): Move concurrent wps and dpp check to before creating task
- Move the check for checking concurrent wps and dpp check to before creating
  task rather than after.
2023-12-15 18:46:17 +05:30
jgujarathi
b167df155f fix(wpa_supplicant): Fix a crash in esp_wifi_wps_disable
- Fixes a crash observed in esp_wifi_wps_disable when wps process
  is ongoing, caused due to concurrency issues in cancelling timers.
2023-12-15 18:46:17 +05:30
jgujarathi
8103512379 fix(wpa_supplicant): Restructuring DPP init method to ensure cleanup
- Restructuring DPP init function to ensure cleanup of variables in case of
  init failure
2023-12-15 18:46:15 +05:30
jgujarathi
45caba87f1 fix(wpa_supplicant): Fix location of clearing up dpp global variables
- Fix location of cleaing up dpp global variables to ensure that there are
  no concurrency issues.
2023-12-15 18:28:48 +05:30
jgujarathi
8f928f77e8 fix(wpa_supplicant): Fix a memory leak in dpp deinit path
- Ensures that the auth information of dpp gets freed when there is
  dpp gets deinited.
2023-12-15 18:28:48 +05:30
aditi_lonkar
aad82378bb fix(esp_wifi):Fix WDT when esp_supp_dpp_start_listen called multiple times 2023-12-15 18:28:45 +05:30
Aditya Patwardhan
b92c24a9ba Merge branch 'fix/aes_mpi_interrupt_allocation_workflow_v4.4' into 'release/v4.4'
fix(mbedtls): move interrupt allocation during initialization phase (v4.4)

See merge request espressif/esp-idf!27443
2023-12-15 17:12:42 +08:00
Xue yun fei
c392dad1dc optimize(lwip):when psram is enable the number of ooseq is not limited 2023-12-15 15:54:31 +08:00
Jiang Jiang Jian
3192aca478 Merge branch 'bugfix/mem_leak_fastpbkdf2_test' into 'release/v4.4'
fix(wpa_supplicant): Resolve memory leak for test case of fast pbkdf2

See merge request espressif/esp-idf!27889
2023-12-15 11:18:29 +08:00
Jiang Jiang Jian
0bb983f9d5 Merge branch 'bugfix/fix_issuse_in_scan_and_mesh_v4.4' into 'release/v4.4'
fix(wifi): fix issues in scan and wifi mesh (v4.4)

See merge request espressif/esp-idf!27861
2023-12-15 10:38:46 +08:00
Roland Dobai
dbb71c010f Merge branch 'fix/py12_req' into 'release/v4.4'
Fix(tools): Use a construct dependency compatible with Python 3.12

See merge request espressif/esp-idf!27925
2023-12-14 22:05:04 +08:00
Roland Dobai
91ca4a74aa Fix(tools): Use a construct dependency compatible with Python 3.12 2023-12-14 12:25:54 +01:00
wanlei
aa264cab8f fix(spi_master): fixed lcd example block border pixel issue 2023-12-14 17:18:10 +08:00
Rahul Tank
3f117c79d9 Merge branch 'bugfix/authcomplete_failure_v4.4' into 'release/v4.4'
fix(nimble): Fixed authcomplete failure caused by a mismatch in the c1 value (v4.4)

See merge request espressif/esp-idf!27637
2023-12-14 13:15:17 +08:00
Shreyas Sheth
aa8822bbf1 fix(wpa_supplicant): Resolve memory leak for unit test of fast pbkdf2 2023-12-13 16:12:00 +05:30
Roland Dobai
95873f4c33 Merge branch 'fix/bump_precommit_esp_idf_sbom_v4.4' into 'release/v4.4'
fix: bump esp-idf-sbom to v0.13.0 in pre-commit (v4.4)

See merge request espressif/esp-idf!27880
2023-12-13 17:03:24 +08:00
Jiang Jiang Jian
e47fe5df8e Merge branch 'fix/build_error_in_compiler_performance_mode_v4.4' into 'release/v4.4'
fix(bt/bluedroid): fixed build error when compiler in performace mode (backport v4.4)

See merge request espressif/esp-idf!27866
2023-12-13 15:01:46 +08:00
Frantisek Hrbata
ab3ed9ee44 fix: bump esp-idf-sbom to v0.13.0 in pre-commit
v0.13.0 contains fix for the submodule hash validation. Let's
bump its version in pre-commit, so the fix is used.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-12-13 07:31:37 +01:00
gongyantao
ba81334bf5 fix(bt/bluedroid): fixed build error when compiler in performace mode
Closes https://github.com/espressif/esp-idf/issues/12751
2023-12-12 19:04:49 +08:00
zhangyanjiao
1a0f4524da fix(wifi): fix issues in scan and wifi mesh
1. fix(wifi): fix the crash issue when clear scan ap list
3. fix wifi mode error when mesh start after station has connected to router
2023-12-12 17:21:04 +08:00
Ivan Grokhotkov
a2b4ddc113 Merge branch 'revert-3f015297' into 'release/v4.4'
Revert "Merge branch 'bugfix/nvs_read_out_of_bounds' into 'release/v4.4'"

See merge request espressif/esp-idf!27856
2023-12-12 15:26:25 +08:00
Jiang Jiang Jian
c452233a6e Merge branch 'fix/lwip_dns_fallback_ipv4only' into 'release/v4.4'
lwip: Fix DNS int with FALLBACK_DNS() in IPv4 only (v4.4)

See merge request espressif/esp-idf!27544
2023-12-12 14:38:48 +08:00
Martin Vychodil
0ae5b6c0b2 Revert "Merge branch 'bugfix/nvs_read_out_of_bounds' into 'release/v4.4'"
This reverts merge request !27852
2023-12-12 13:30:50 +08:00
Martin Vychodil
3f0152978d Merge branch 'bugfix/nvs_read_out_of_bounds' into 'release/v4.4'
fix(nvs): prevent out-of-bounds write on inconsistent blob length

See merge request espressif/esp-idf!27852
2023-12-12 12:56:30 +08:00
Jiang Jiang Jian
7a0a868603 Merge branch 'contrib/github_pr_12460_v4.4' into 'release/v4.4'
fixing OTA write up to SPI_FLASH_SEC_SIZE margins (GitHub PR) (v4.4)

See merge request espressif/esp-idf!27646
2023-12-12 10:05:22 +08:00
Jiang Jiang Jian
8812baf39f Merge branch 'fix/esp32s3_soc_drom_high_addr_v4.4' into 'release/v4.4'
fix(soc): esp32s3/Fix the DROM_HIGH_ADDR (v4.4)

See merge request espressif/esp-idf!27824
2023-12-12 10:04:57 +08:00
Ivan Grokhotkov
a24f51431d fix(nvs): prevent out of bounds write if blob data is inconsistent 2023-12-11 23:04:35 +08:00
Ivan Grokhotkov
e6db7ddf2a Merge branch 'feature/add_fatfs_sbom_v4.4' into 'release/v4.4'
feat(storage/fatfs): add sbom file manifest for FatFs (v4.4)

See merge request espressif/esp-idf!27482
2023-12-11 18:14:25 +08:00
Tomas Rohlinek
cff118820f feat(storage/fatfs): add sbom file manifest for FatFs (v4.4) 2023-12-11 18:14:25 +08:00
Mahavir Jain
09089c3fdf Merge branch 'fix/esp_ptr_check_sign_compare_v4.4' into 'release/v4.4'
fix(esp_hw_support): Fix different signed comparison in `esp_ptr_in_drom`

See merge request espressif/esp-idf!27817
2023-12-11 16:07:46 +08:00
Aditya Patwardhan
2e973e28dc fix(soc): esp32s3/Fix the DROM_DROM_HIGH limit
Previously the DROM_HIGH_ADDR for esp32s3 was 0x3D000000, which
    convers only 16 MB of address range. But esp32s3 supports 32 MB
    external memory. So this address should be 0x3E000000
2023-12-11 13:22:55 +05:30
Jiang Jiang Jian
69f63b2a16 Merge branch 'bugfix/install_key_issue_v4.4' into 'release/v4.4'
fix(wifi): Fix key install issue in PTK renew(v4.4)

See merge request espressif/esp-idf!27318
2023-12-11 15:24:41 +08:00
Jiang Jiang Jian
597a4d4926 Merge branch 'bugfix/fix_some_ble_bugs_v4.4' into 'release/v4.4'
Fixed some BLE bugs (backport v4.4)

See merge request espressif/esp-idf!27698
2023-12-11 15:07:54 +08:00
Laukik Hase
77a7eb217a fix(esp_hw_support): Fix different signed comparison in esp_ptr_in_drom
- Closes https://github.com/espressif/esp-idf/pull/12720
2023-12-11 10:21:27 +05:30
xueyunfei
083eb06028 Fix(lwip):bugfix for add config for tcp ooseq bufs 2023-12-08 19:13:11 +01:00
Jiang Jiang Jian
2026c783ed Merge branch 'feat/max_ver_c3_199_v4.4' into 'release/v4.4'
feat(soc): Increase max supported version of C3 to 1.99 (v4.4)

See merge request espressif/esp-idf!26825
2023-12-08 20:56:05 +08:00
chenjianhua
2f850519ef fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(65db61f)
- Fixed remove and clear white list
2023-12-08 19:42:16 +08:00
chenjianhua
4e518185c5 fix(bt): Update bt lib for ESP32(fa43201)
- Fixed assert for instant passed workaround
- Fixed scan evt timeout
- Fixed random address setting when scanning
2023-12-08 19:41:15 +08:00
shangke
8eec988290 fix(bt/controller): Fixed some HCI commands parameter 2023-12-08 19:41:15 +08:00
chenjianhua
72315ed011 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(b8f0db9)
- Fixed assert when llcp instant passed
2023-12-08 19:41:15 +08:00
chenjianhua
c908325d3d fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(70ab55f)
- Fixed assert for instant passed workaround
- Fixed add RPA to white list
- Fixed AES encryption for RPA resolution
2023-12-08 19:41:15 +08:00
chenjianhua
148ee05b87 fix(bt/bluedroid): Fixed add RPA to white list 2023-12-08 19:41:15 +08:00
Kapil Gupta
ad3891b94b fix(wifi): Fix key install issue in PTK renew 2023-12-08 15:23:36 +05:30
Roland Dobai
2c9fa2702e Merge branch 'feat/manifest_check_v4.4' into 'release/v4.4'
feat: use esp-idf-sbom pre-commit plugin (v4.4)

See merge request espressif/esp-idf!27755
2023-12-08 17:01:16 +08:00
Frantisek Hrbata
22637ff824 feat: use esp-idf-sbom pre-commit plugin
Currently sbom manifest is checked only in .gitmodules and
this check is done in pre-commit and also in CI. Meaning it's running
three times(pre-commit before push if user has it enabled, in CI
as there is the pre-commit run again and again with test in CI). Since
esp-idf-sbom contains a full manifest validation support and pre-commit
plugin for it, let's use it. This removes all the current sbom testing
and replaces it with a signle pre-commit plugin which validates all
manifests files(sbom.yml, idf_component.yml, .gitmodules and also
referenced manifests) in repository. Note that this checks all
manifests, not only ones which were modified. The check is reasonably
fast though, so it should not cause any problem. The reason for
validating all manifest files is that we want to make sure that the sbom
information in .gitmodules is updated too and that the hash
recorded in .gitmodules is up-to-date. Meaning submodule update
would not trigger this plugin, because no manifest was changed.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-12-07 14:53:18 +01:00
Darshan Dobariya
78f44f115d fix(nimble): Fixed authcomplete failure caused by a mismatch in the c1 value (v4.4) 2023-12-07 14:06:12 +05:30
Jiang Jiang Jian
ce2102eed4 Merge branch 'bugfix/timer_index_out_of_bound_v4.4' into 'release/v4.4'
Fix timer index out of bound issue (Backport v4.4)

See merge request espressif/esp-idf!27607
2023-12-07 11:55:21 +08:00
Michael (XIAO Xufeng)
bbd1bb2025 feat(soc): Increase max supported version of C3 to 1.99 2023-12-06 17:05:24 +08:00
Harshit Malpani
e6330d9cdc feat(nghttp2): Update nghttp2 lib to v1.58.0 2023-12-06 11:52:01 +05:30
Island
b57653b21c Merge branch 'bugfix/BLEQABR23-35_v4.4' into 'release/v4.4'
fix(ble_mesh): avoid ble_mesh packet collision by using random adv interval(v4.4)

See merge request espressif/esp-idf!27491
2023-12-06 11:06:57 +08:00
Jiang Jiang Jian
68915490b0 Merge branch 'fix/xtensa-register-corrupted-after-context-switch_v4.4' into 'release/v4.4'
fix(xtensa): fix registers curruption on context switch (v4.4)

See merge request espressif/esp-idf!26212
2023-12-06 10:47:55 +08:00
Jiang Jiang Jian
8e41f7b9d8 Merge branch 'feature/pbkdf2_fast_implementation_v4.4' into 'release/v4.4'
Feature/pbkdf2 fast implementation v4.4

See merge request espressif/esp-idf!25515
2023-12-06 10:45:57 +08:00
Shreyas Sheth
f157786e2d fix(ci): Increment number of runner for test UT_T1_1 for esp32s2 2023-12-06 00:09:11 +05:30
Shreyas Sheth
d6f65b1472 fix(wpa_supplicant): Remove deprecated mbedtls functions used in fast pbkdf2 and fix ci error 2023-12-05 23:59:58 +05:30
Shyamal Khachane
a1e8a7be4e fix(esp_wifi): Fix timer index out of bound issue causing execution of timer function to fail 2023-12-05 17:33:25 +05:30
Kapil Gupta
a1b3ef5cef fix(wpa_supplicant): implement sha1_finish for fastpbkdf2 2023-12-05 16:54:31 +05:30
Shreyas Sheth
e9f29de687 ci(wifi): Add test case for fast pbkdf2 verification 2023-12-05 16:54:31 +05:30
Kapil Gupta
3e4f49606b change(esp_wifi): Port fast_pbkdf2 implementation for mbedlts
Add changes to use fast_pbkdf2 as default for PMK calculations.
fast_pbkdf2 is significantly faster than current implementations
for esp chips.

Also removes unnecessary code for pbkdf-sha256 and pbkdf-sha512.
2023-12-05 16:54:31 +05:30
Kapil Gupta
e8fcdc3ebf change(esp_wifi): Copy fastpbkdf2 implementation
Copy pbkdf2 implementation from https://github.com/ctz/fastpbkdf2(3c56895)
2023-12-05 16:54:31 +05:30
harshal.patil
9e61344890 ci(mbedtls): added a test for the mbedtls_internal_shaX_process API 2023-12-05 16:54:31 +05:30
harshal.patil
edef8d5fae fix(mbedtls): Fix the port for the mbedtls_internal_shaX_process API
- Also added the fix to update intermediate SHA state in the mbedtls_shaX_update API
2023-12-05 16:54:31 +05:30
Jiang Jiang Jian
7147f84f64 Merge branch 'feat/support_esp32c3_v1.1_wifi_v4.4' into 'release/v4.4'
fix(wifi): backport some wifi bugfix(v4.4)

See merge request espressif/esp-idf!27584
2023-12-05 19:10:12 +08:00
Jiang Jiang Jian
26fb320beb Merge branch 'bugfix/alarm_args_double_free_v4.4' into 'release/v4.4'
Bugfix/alarm args double free v4.4

See merge request espressif/esp-idf!27540
2023-12-05 13:45:33 +08:00
Jiang Jiang Jian
2fa6dabbb1 Merge branch 'bugfix/remove_bond_v4.4' into 'release/v4.4'
fix(nimble): Handled IRK/LTK deletion based on key availability(v4.4)

See merge request espressif/esp-idf!26605
2023-12-05 11:57:55 +08:00
alanmaxwell
ca25bf834f feat(wifi): support esp32c3 v1.1 wifi 2023-12-05 11:42:16 +08:00
Jiang Jiang Jian
4c0245d9e7 Merge branch 'bufix/Backport_some_lwip_bugs_for_4.4_1204' into 'release/v4.4'
Bufix/backport some lwip bugs for 4.4 1204

See merge request espressif/esp-idf!27610
2023-12-05 11:13:06 +08:00
Jiang Jiang Jian
f886d0f1ba Merge branch 'bugfix/fix_wifi_init_reentrant_issue_v4.4' into 'release/v4.4'
Bugfix/fix wifi init reentrant issue v4.4

See merge request espressif/esp-idf!27628
2023-12-05 11:10:37 +08:00
Jiang Jiang Jian
50511114e1 Merge branch 'bugfix/pbc_overlap_in_wps_pin_method_v4.4' into 'release/v4.4'
wpa_supplicant: Fix for issue of wps-pbc overlap in wps-pin method(4.4)

See merge request espressif/esp-idf!25737
2023-12-05 10:39:27 +08:00
Jiang Jiang Jian
e62727886e Merge branch 'bugfix/backport_wifi_fix_1130_v4.4' into 'release/v4.4'
fix(wifi): backport some wifi bugfix(v4.4)

See merge request espressif/esp-idf!27507
2023-12-05 02:03:32 +08:00
kohait00
153f4b8f4f fix(app_update): avoid erasing an extra sector than the actual required size
OTA update used to fail if `firmware_size == partition_size`, because the code was trying to
erase one additional sector beyond the space reserved for the firmware partition.

This commit fixes the problem and OTA update can work if the firmware
size exactly matches the allocated partition size.

Closes https://github.com/espressif/esp-idf/pull/12460
2023-12-04 18:48:55 +05:30
aditi_lonkar
58f51147cf wpa_supplicant: Fix for issue of wps-pbc overlap in wps-pin method 2023-12-04 15:23:53 +05:30
Island
2be3fa2e27 Merge branch 'backport/fix_ble_menuconfig_v4.4' into 'release/v4.4'
Backport/fix ble menuconfig v4.4(backport v4.4)

See merge request espressif/esp-idf!27495
2023-12-04 16:30:21 +08:00
liuning
9be22d2d18 fix(wifi): fix wifi deinit s_wifi_modem_sleep_lock 2023-12-04 16:10:47 +08:00
liuning
260920a18a fix(wifi): fix wifi init reentrant issue 2023-12-04 16:10:47 +08:00
gaoxu
f2f2de1a66 fix(adc): fix adc continuous get less results beacuse do not reset apb clk(v4.4) 2023-12-04 15:02:18 +08:00
xueyunfei
1ac20fb4ac Fix(dhcps):fix dhcp subnet option api dos not work issue 2023-12-04 14:54:18 +08:00
xueyunfei
0a1282bd24 fix(dhcp server):fix set dhcp server poll fail issue 2023-12-04 14:22:35 +08:00
Jiang Jiang Jian
43dbb702c4 Merge branch 'fix/esp_netif_lock_v4.4' into 'release/v4.4'
fix(esp_netif): Lock netif list with TCPIP context (v4.4)

See merge request espressif/esp-idf!26714
2023-12-04 14:04:50 +08:00
Jiang Jiang Jian
4cc2340265 Merge branch 'bugfix/fix_onebyte_watchpoint_setting_v4.4' into 'release/v4.4'
fix(riscv): supports 1 byte and larger than 64byte range watchpoint setting (v4.4)

See merge request espressif/esp-idf!27517
2023-12-04 11:59:49 +08:00
Jiang Jiang Jian
e08f93de6d Merge branch 'fix/twai_crash_on_s3_gpio_19and20_v4.4' into 'release/v4.4'
fix(twai): example crash using usb-serial-jtag pins (v4.4)

See merge request espressif/esp-idf!26665
2023-12-04 11:39:18 +08:00
Abhinav Kudnar
254cf65464 fix(nimble): Handled IRK/LTK deletion based on key availability 2023-12-02 03:18:01 +05:30
harshal.patil
00919c3967 fix(mbedtls/aes): fix AES interrupt allocation for AES-GCM operations 2023-12-01 18:25:11 +05:30
harshal.patil
bffe5d2864 fix(mbedtls): move interrupt allocation during initialization phase 2023-12-01 18:25:10 +05:30
zhanghaipeng
09076b53eb fix(bt/bluedroid): Fix BLE SMP register log level 2023-12-01 16:58:00 +08:00
zhanghaipeng
4f57ec7c26 fix(bt/bluedroid): Fix bluedroid menuconfig 2023-12-01 16:57:44 +08:00
Island
23e7fa801b Merge branch 'fix/ble_mesh_example_relay_enable_v4.4' into 'release/v4.4'
fix(ble_mesh): Enable relay by default for the specific dev role (v4.4)

See merge request espressif/esp-idf!27510
2023-12-01 15:17:39 +08:00
alanmaxwell
629c3b4d9c fix(wifi): backport some wifi bugfix
1. fix ccmp pn became large issue
2. sta not pmf capable when requires should reject profile
3. fix softap set config issue
4. fix enable psram wapi dhcp fail issue
5. Fix multi antenna issue
6. Fix typo in wifi api docs
7. Optimize BB filter timer to pass some corner case
8. Change fragment threshold to 256
9. Support fragment for LR mode
10. Fix rx fragment fail in Open mode.
11. Drop fragmented AMPDUs
12. Fix ampdu duration issue
2023-12-01 14:02:07 +08:00
xueyunfei
e31f8581a2 feat(esp_wifi):static buf for management,control,qos null,null data rx packet 2023-12-01 14:02:07 +08:00
muhaidong
24e208eca1 fix(wifi): allow some special igtk keyindx to workaround faulty APs 2023-12-01 14:02:07 +08:00
muhaidong
8b473bee24 fix(wifi): update scan example for scan get ap records 2023-12-01 14:02:07 +08:00
Chen Jian Xing
ca78fb58bc Merge branch 'bugfix/authmode_log_192_bit_v4.4' into 'release/v4.4'
WPA3 enterprise 192 bit fix and config modification  (Backport v4.4)

See merge request espressif/esp-idf!27325
2023-12-01 13:57:58 +08:00
David Čermák
403d656698 Merge branch 'bugfix/emac_ex_buffer_v4.4' into 'release/v4.4'
esp_eth: receive buffer allocation optimization - v4.4

See merge request espressif/esp-idf!27274
2023-11-30 23:18:39 +08:00
David Cermak
ffddf278f5 lwip: Fix DNS int with FALLBACK_DNS() in IPv4 only
* Update submodule: git log --oneline 90c1e93e40bdfe6718b97e2d95aabc2f0f609ce8..1de11efadd0083469f26c8782be3d55073829767

Detailed description of the changes:
  - dns: fix init with only ipv4 enabled (espressif/esp-lwip@1de11efa)
  - optimize add TCP ooseq buf timeout configuration (espressif/esp-lwip@d3c89e93)
  - bugfix for optimize tcp connection (espressif/esp-lwip@d5093349)
2023-11-30 14:28:10 +01:00
Jin Cheng
bb22c4323d fix(bt/bluedroid): Set the alarm_arg to NULL after releasing to avoid double free in BTC layer 2023-11-30 20:06:21 +08:00
wuzhenghui
ef202b3ecd fix(riscv): supports 1 byte and larger than 64byte range watchpoint setting 2023-11-30 15:47:22 +08:00
Rahul Tank
79954fe559 Merge branch 'bugfix/ble_gap_unpair_oldest_peer_v4.4' into 'release/v4.4'
fix(nimble): Fixed incorrect handling of bonded devices (v4.4)

See merge request espressif/esp-idf!26945
2023-11-30 12:56:03 +08:00
Liu Linyan
dfc4b7b6b7 fix(ble_mesh): Enable relay by default for the specific dev role 2023-11-30 12:26:57 +08:00
zhanghaipeng
72e87fc035 docs(bt/bluedroid): Update ble example document 2023-11-30 10:34:42 +08:00
luoxu
af166180f2 bugfix(ble_mesh): Supplementary configuration options that should be enabled. 2023-11-29 19:44:55 +08:00
Liu Linyan
560e1f899d fix(ble_mesh): Support using random adv interval for mesh packets 2023-11-29 19:44:55 +08:00
Shyamal Khachane
7eef2771fe fix(esp_wifi): Fixed authmode in log and connected event for WPA3 enterprise 192 bit security 2023-11-29 09:04:57 +00:00
Michael (XIAO Xufeng)
a61fd4bf70 Merge branch 'bugfix/spi_master_fifo_use_dma_v4.4' into 'release/v4.4'
fix(spi): fixed undesired touching to DMA (v4.4)

See merge request espressif/esp-idf!26772
2023-11-29 11:12:53 +08:00
Cao Sen Miao
1fb6de14e6 brownout: Disable the hardware BOD when BOD interrupt is enabled 2023-11-28 17:01:19 +08:00
darshan
b34d4825d3 fix(nimble): Fixed incorrect handling of bonded devices (v4.4) 2023-11-28 10:29:38 +05:30
David Cermak
3329d64278 fix(esp_netif): Fix races in netif object locking 2023-11-27 08:21:35 +01:00
Jiang Jiang Jian
7e5f4df8e2 Merge branch 'feature/support_ble_esp32c3_eco7_v4.4' into 'release/v4.4'
Feature/support ble esp32c3 eco7 (backport v4.4)

See merge request espressif/esp-idf!27340
2023-11-24 11:44:01 +08:00
Jiang Jiang Jian
d3cf0d04ae Merge branch 'bugfix/add_par_check_in_ag_cind_res_v4.4' into 'release/v4.4'
Bugfix/add par check in ag cind res v4.4

See merge request espressif/esp-idf!27259
2023-11-24 10:20:12 +08:00
Jiang Jiang Jian
c0d6131e83 Merge branch 'bugfix/spp_deinit_crash_v4.4' into 'release/v4.4'
fix(bt/bluedroid): Fix the crash of invalid access to released resources (v4.4)

See merge request espressif/esp-idf!27253
2023-11-24 10:19:56 +08:00
Ondrej Kosta
891edc0f0d bugfix(esp_eth): improved error handling of _recv_buf
fixed W5500 flush_recv_frame function
2023-11-23 17:22:42 +01:00
Mahavir Jain
e1e191638a Merge branch 'bugfix/return_code_of_ota_finish_api_v4.4' into 'release/v4.4'
fix(esp_https_ota): fix return code of esp_https_ota_finish API (v4.4)

See merge request espressif/esp-idf!27337
2023-11-23 16:31:42 +08:00
zhiweijian
d11c83c9a0 feat: support ble esp32c3 eco7 2023-11-23 14:07:55 +08:00
Jiang Guang Ming
8eb33e1b36 feat(esp32c3): Update esp32c3 chip revision 2023-11-23 14:07:55 +08:00
Jiang Guang Ming
0e8f4c9b3d feat(esp32c3): Add rom ld with ROM tag esp32c3-eco7-20230720 2023-11-23 14:07:51 +08:00
Harshit Malpani
fa017871f2 fix(esp_https_ota): fix return code of esp_https_ota_finish API
Closes https://github.com/espressif/esp-idf/issues/12635
2023-11-22 17:15:19 +05:30
Jiang Jiang Jian
fe4eb82500 Merge branch 'bugfix/connect_issue_for_zero_rssi_v4.4' into 'release/v4.4'
fix(esp_wifi): Fix issue of station disconnecting immediately after scanning (Backport v4.4)

See merge request espressif/esp-idf!26746
2023-11-22 16:34:13 +08:00
Kapil Gupta
93b64fd6d6 Merge branch 'bugfix/dpp_config_memset_v4.4' into 'release/v4.4'
Wi-Fi: Fixed some DPP issues (v4.4)

See merge request espressif/esp-idf!27194
2023-11-22 11:33:11 +08:00
Kapil Gupta
9a1e54d485 fix(wpa_supplicant): memzero wifi config before sending config event 2023-11-21 11:36:59 +05:30
Kapil Gupta
d5e628229f fix(wifi): Disallow DPP and WPS concurrency 2023-11-21 11:36:38 +05:30
Sarvesh Bodakhe
de59abad0a fix(esp_wifi): Fix issue of station disconnecting immediately when AP RSSI is zero 2023-11-21 10:29:43 +05:30
Alexey Lapshin
2923fd5265 fix(xtensa): fix registers curruption on context switch
a6, a7 registers may be corrupted on multicore ESP chips while FreeRTOS
Kernel SMP context switch
2023-11-21 03:19:31 +00:00
Jiang Jiang Jian
5c2142eedb Merge branch 'bugfix/fix_psram_access_faild_after_pd_cpu_wakeup_v4.4' into 'release/v4.4'
fix(esp_pm): fix psram access failed after pd_cpu wakeup if uart driver driven console is used (backport v4.4)

See merge request espressif/esp-idf!27056
2023-11-21 10:57:03 +08:00
Jiang Jiang Jian
d6b9fab066 Merge branch 'bugfix/s3_irom_addr_v4.4' into 'release/v4.4'
soc: fix SOC_IROM_MASK_HIGH for esp32s3 (v4.4)

See merge request espressif/esp-idf!27138
2023-11-21 10:54:24 +08:00
Jiang Jiang Jian
bf5b36954a Merge branch 'bugfix/clear_ulp_wake_intr_in_wake_source_enable_v4.4' into 'release/v4.4'
fix(esp_hw_support): clear all type ULP wakeup intr status at ulp wakeup source enable (backport v4.4)

See merge request espressif/esp-idf!27190
2023-11-21 10:52:23 +08:00
Jiang Jiang Jian
0d08c81ae0 Merge branch 'bugfix/fix_lightsleep_current_leakage_on_usj_pad_v4.4' into 'release/v4.4'
fix(esp_hw_support): fix lightsleep current leakage on usb pad (backport v4.4)

See merge request espressif/esp-idf!27209
2023-11-21 10:51:40 +08:00
Jiang Jiang Jian
0f679c740f Merge branch 'bugfix/add_ht2040_ex_caps_v44' into 'release/v4.4'
Add HT20_40 capability in assoc requests(v4.4)

See merge request espressif/esp-idf!27247
2023-11-21 10:46:26 +08:00
Ondrej
409c7e5610 Improved emac rx task code to suppress Coverity false positive memory leak indication 2023-11-20 12:50:49 +01:00
Ondrej
9374a2d9ac esp_eth: receive buffer allocation optimization
Receive buffers are allocated with a size equal to actual received frame size
2023-11-20 12:32:03 +01:00
Jiang Jiang Jian
b3370564f8 Merge branch 'feat/dynamic_integration_pipeline_v4.4' into 'release/v4.4'
CI: dynamic integration pipeline v4.4

See merge request espressif/esp-idf!27013
2023-11-20 16:29:50 +08:00
morris
42904820c9 Merge branch 'bugfix/ledc_max_duty_cycle_v4.4' into 'release/v4.4'
fix(ledc): fix ledc driver 100% duty cycle configuration (backport v4.4)

See merge request espressif/esp-idf!27235
2023-11-20 15:27:45 +08:00
jgujarathi
cf828f1c8d fix(esp_wifi): Ensure beacon timeout gets trigerred for AP config change
- Ensure that beacon timeout gets trigerred for AP config changes when we are in
  powersave.
2023-11-20 11:10:02 +05:30
jgujarathi
86fe60ad5a fix(wpa_supplicant): Add HT20_40 capability in assoc requests
- Add the HT2040 capability indication in the extended caps IE of
  assoc requests.
2023-11-20 11:10:00 +05:30
Jin Cheng
5fc7faf47e fix(bt/bluedroid): corrected the API documents of profile HFP and A2DP 2023-11-20 12:06:13 +08:00
Jin Cheng
2a90241d7d fix(bt/bluedroid): Added some argument check in APIs of HFP AG 2023-11-20 12:03:30 +08:00
wuzhenghui
236883728d fix(esp_hw_support): fix lightsleep current leakage on usb-phy controlled pad 2023-11-20 11:25:28 +08:00
Island
27cf25e42c Merge branch 'bugfix/fix_some_ble_bugs_v4.4' into 'release/v4.4'
Fixed some BLE bugs (backport v4.4)

See merge request espressif/esp-idf!27197
2023-11-17 20:22:02 +08:00
wuzhenghui
7c68678ddc fix(esp_hw_support): clear all type ULP wakeup intr status at ulp wakeup source enable 2023-11-17 18:18:58 +08:00
Song Ruo Jing
fd3576eca6 fix(ledc): fix ledc driver 100% duty cycle configuration
Update ledc duty cycle value range in doxygen.
Fix duty configuration error at 100% duty cycle for ESP32.
Improve LEDC API doxygen.

Closes https://github.com/espressif/esp-idf/pull/11516
Closes https://github.com/espressif/esp-idf/issues/12593
Closes https://github.com/espressif/esp-idf/issues/12083
2023-11-17 15:24:17 +08:00
Jin Cheng
6b44b42904 fix(bt/bluedroid): Fix the crash of invalid access to released resources
It is caused by the delayed timer is alarmed after esp_spp_deinit.
2023-11-17 10:56:06 +08:00
Ivan Grokhotkov
bc2ea111fb fix(console): switch USB PHY to OTG when OTG is used for console
On ESP32-S3 with the default efuse settings, USB PHY is connected to
the USB_SERIAL_JTAG peripheral. If USB OTG peripheral is used for the
console, we need to additionally switch the PHY to USB OTG, otherwise
we won't get any output.

Closes https://github.com/espressif/esp-idf/issues/12437
2023-11-16 20:11:38 +08:00
chenjianhua
03040db7c1 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(2758518)
- Fixed power state setting when entering modem sleep
2023-11-16 17:02:27 +08:00
chenjianhua
0ae141c197 Update bt lib for ESP32-C3 and ESP32-S3(f817304)
- Support get the range of TX power level
- Support clear legacy adv using vendor hci
2023-11-16 17:02:13 +08:00
zhanghaipeng
7ba6903f4b fix(ble/controller): Fix bugs in setting adv data and scan response data 2023-11-16 17:01:55 +08:00
chenjianhua
9ba36e8c55 update esp32 bt-lib (6458728)
- Modify mesh proxy solic uuid to 0x18590303
- Support get the range of TX power level
- Support clear legacy adv using vendor hci
2023-11-16 17:01:14 +08:00
chenjianhua
716e78f3a6 feat(bt/bluedroid): support clear legacy advertising 2023-11-16 17:01:04 +08:00
aditi_lonkar
44b7e8ed10 fix(wpa_supplicant): Fix few dpp bugs
1) Fix crash in dpp Listen without bootstrap
  2) Fix crash on receiving dpp auth_req from hostapd with dpp akm
  3) Ensures that the mode is set to station before dpp init
  4) Ensures that dpp follows the path of init->bootstrap->listen
2023-11-16 12:42:18 +05:30
Ivan Grokhotkov
6bb6de5b35 fix(soc): update SOC_IROM_MASK_HIGH for esp32 for consistency 2023-11-14 14:30:04 +01:00
Ivan Grokhotkov
47c455c177 fix(soc): correct SOC_IROM_MASK_HIGH for esp32s3
Fixes corrupted backtraces on S3 when a function is in ROM.

Closes https://github.com/espressif/esp-idf/issues/11512
2023-11-14 14:30:04 +01:00
Roland Dobai
4ef8121157 Merge branch 'coredump-info-offset_v4.4' into 'release/v4.4'
Tools: coredump-info - fix non-default partition table offset issues (v4.4)

See merge request espressif/esp-idf!26925
2023-11-14 17:21:45 +08:00
Jiang Jiang Jian
25cd984ad9 Merge branch 'bugfix/fix_deinit_init_wifi_scan_fail_issue_v4.4' into 'release/v4.4'
Bugfix/fix deinit init wifi scan fail issue v4.4(Backport v4.4)

See merge request espressif/esp-idf!27049
2023-11-14 15:25:11 +08:00
Jiang Jiang Jian
5576a60b4f Merge branch 'bugfix/build_error_when_enable_ag_and_hf_v4.4' into 'release/v4.4'
fix(bt/bluedroid): Fix build error when both of the HFP roles are enabled (v4.4)

See merge request espressif/esp-idf!27079
2023-11-14 15:24:51 +08:00
Jiang Jiang Jian
4bc424258f Merge branch 'bugfix/check_mapping_target_conflict_v4.4' into 'release/v4.4'
fix(ldgen): check target conflict for entries with section aliases (v4.4)

See merge request espressif/esp-idf!26125
2023-11-14 14:56:10 +08:00
Chen Yudong
6df29acf39 ci: add label rules for integration test 2023-11-14 14:38:57 +08:00
Chen Yudong
60efb8a3ba ci: add qa-test-tag rules 2023-11-14 14:38:57 +08:00
Chen Yudong
3dc07f49f3 ci: dynamic integration test child pipeline 2023-11-14 14:38:51 +08:00
Roland Dobai
8ddb3d6812 Merge branch 'fix/ci_autocomplete_v4.4' into 'release/v4.4'
Tools, CI: Improve autocomplete tests (v4.4)

See merge request espressif/esp-idf!27039
2023-11-14 02:44:26 +08:00
wuzhenghui
93d44d1e08 fix(esp_pm): fix psram access faild after pd_cpu wakeup 2023-11-13 16:39:31 +08:00
Wang Mengyang
03bdeb46a5 fix(bt/bluedroid): Fix build error for HFP when enabling AG and HF_Client in case that CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is enabled 2023-11-10 20:12:04 +08:00
muhaidong
df801011bd change(hal): remove useless code from periph_ll_wifi_bt_module_enable_clk 2023-11-10 14:05:09 +08:00
muhaidong
e8c4156fc2 fix(wifi): fix deinit init wifi scan fail issue 2023-11-10 11:53:25 +08:00
Roland Dobai
2e4f63e62f ci(fix): Improve the stability of the autocomplete tests 2023-11-09 14:14:32 +01:00
Peter Dragun
9d4d612b56 fix(tools/coredump-info): pass non-default partition table offset to esp-coredump 2023-11-09 10:35:24 +01:00
Island
dea8532e2d Merge branch 'backport/fix_ble_scan_rsp_v4.4' into 'release/v4.4'
Backport/fix ble scan rsp v4.4(backport v4.4)

See merge request espressif/esp-idf!27004
2023-11-09 16:56:55 +08:00
Mahavir Jain
1bca827217 Merge branch 'fix/check_integrity_on_used_blocks_v4.4' into 'release/v4.4'
heap: fix integrity check on used blocks by the tlsf component (backport v4.4)

See merge request espressif/esp-idf!26565
2023-11-09 14:14:10 +08:00
wanlei
a4388a3321 fix(twai): twai example crash using usb-serial-jtag pins
Calling gpio_hal_iomux_func_sel() via gpio_config() may
disconnects/disables any influence from USJ when using USJ pins
2023-11-09 02:51:04 +00:00
Wang Meng Yang
6f38dfe22b Merge branch 'test/bqb_test_bt_classic_hfp_v4.4' into 'release/v4.4'
feat(bt/hfp): Add support for HFP BQB auto test(backport v4.4)

See merge request espressif/esp-idf!26989
2023-11-09 10:44:35 +08:00
morris
9b2661c91c Merge branch 'bugfix/fix_wrong_adc_attenuation_name_v4.4' into 'release/v4.4'
fix(adc): rename ADC_ATTEN_DB_11 to ADC_ATTEN_DB_12 (v4.4)

See merge request espressif/esp-idf!26969
2023-11-09 10:32:16 +08:00
zhanghaipeng
1edb6668ba fix(bt/bluedroid): Fix ble keysize check 2023-11-08 19:48:27 +08:00
zhanghaipeng
c90faf5d03 fix(bt/bluedroid): Fix ble adv report evt type 2023-11-08 19:48:18 +08:00
Xiao Xufeng
94a8591586 fix(spi): fixed undesired touching to DMA
Closes https://github.com/espressif/esp-idf/issues/12241
2023-11-08 10:12:03 +00:00
wanglai@espressif.com
1ee2c4db75 fix(bt/bluedroid): Fix the process of sending OK in ATD and COPS cmds 2023-11-08 17:10:26 +08:00
Guillaume Souchere
3b9450b59d fix(heap): Fixed integrity check on used blocks by the tlsf component
This commit updates the tlsf submodule to include the modification made in the component
aiming to perform integrity check on all blocks (not only the free ones).
Added test to test the fix in test_apps/heap_tests.

Fixes https://github.com/espressif/esp-idf/issues/12231
2023-11-08 04:18:21 +00:00
Armando
46e71e43ba fix(adc): rename ADC_ATTEN_DB_11 to ADC_ATTEN_DB_12
By design, it's 12 dB. There're errors among chips, so the actual
attenuation will be 11dB more or less
2023-11-08 03:44:43 +00:00
morris
2bab3b36bc Merge branch 'bugfix/fix_mem_map_issue_v4.4' into 'release/v4.4'
fix(mmap): fix esp32s3 mmap test wrong assertion (v4.4)

See merge request espressif/esp-idf!26964
2023-11-08 11:00:05 +08:00
wanglai@espressif.com
e5996b3e86 fix(bt/bluedroid): Revise the description for index in esp_hf_ag_clcc_response and correct the error return in btc_hf_indchange_notification
1: modify the description of param index in function
esp_hf_ag_clcc_response.
2: fix the error code return of function btc_hf_indchange_notification.
2023-11-07 20:07:26 +08:00
wanglai@espressif.com
60c5dbad59 feat(bt/bluedroid): Modify AT+CNUM response api and HFP AG example 2023-11-07 20:03:46 +08:00
Armando
9a428c4019 fix(mmap): fix esp32s3 mmap test wrong assertion 2023-11-07 10:35:29 +08:00
Jiang Jiang Jian
13b649ab95 Merge branch 'bugfix/update_phy_lib_same_to_master_v4.4' into 'release/v4.4'
fix(phy): update phy lib (v4.4)

See merge request espressif/esp-idf!26867
2023-11-07 10:29:48 +08:00
Michael (XIAO Xufeng)
7a83052809 Merge branch 'bugfix/ota_fail_on_octal_flash_v4.4' into 'release/v4.4'
fix(ota): Fixed OTA fail on octal flash with 32MB memory (backport v4.4)

See merge request espressif/esp-idf!26813
2023-11-06 00:29:02 +08:00
Wang Meng Yang
4c0bc4b7f5 Merge branch 'feature/include_hf_and_ag_in_single_build_v4.4' into 'release/v4.4'
Feature/include hf and ag in single build v4.4

See merge request espressif/esp-idf!26843
2023-11-03 14:09:30 +08:00
Wang Meng Yang
6475f7f119 Merge branch 'bugfix/fix_ble_bond_error_after_reboot_4.4' into 'release/v4.4'
fix(ble/bluedroid): fixed BLE bond error after reboot (backport v4.4)

See merge request espressif/esp-idf!26720
2023-11-03 10:27:36 +08:00
Island
ae5470910e Merge branch 'backport/fix_ble_bugs_v4.4' into 'release/v4.4'
Backport/fix ble bugs v4.4(backport v4.4)

See merge request espressif/esp-idf!26765
2023-11-03 09:12:54 +08:00
zhangyanjiao
4b2972c7c3 fix(phy): update phy lib to master
esp32: phy_version 4780,16b31a7,Sep 22 2023,20:42:16
esp32s2: phy_version 2401,2a6dc26,Sep 26 2023,11:22:15
esp32c3: phy_version 1130,b4e4b80,Sep  5 2023,11:09:30
esp32s3: phy_version 620,ec7ec30,Sep  5 2023,13:49:13
2023-11-02 15:32:53 +08:00
Jin Cheng
a70d469e49 feat(bt/bluedroid): Support to build HID Host and HID Device in single binary 2023-11-01 20:03:39 +08:00
Wang Mengyang
0cdc3284ce feat(bt/bluedroid): Support to build HFP Audio Gateway and Hands Free Unit in single binary 2023-11-01 20:03:23 +08:00
Ivan Grokhotkov
8b63bba2e8 Merge branch 'bugfix/fix_espcoredump_compilation_warning_v4.4' into 'release/v4.4'
fix(espcoredump): fixed compilation warning (v4.4)

See merge request espressif/esp-idf!26593
2023-11-01 18:57:12 +08:00
zhanghaipeng
87466a55bf fix(bt/bluedroid): Fix BLE remove bond list status 2023-11-01 17:22:04 +08:00
zhiweijian
335db4c5aa fix(ble/bluedroid): fixed BLE bond error after reboot 2023-11-01 17:22:04 +08:00
Cao Sen Miao
643b0abca2 fix(ota): Fixed OTA fail on octal flash with 32MB memory,
Closes https://github.com/espressif/esp-idf/issues/11903
2023-11-01 12:28:21 +08:00
Jiang Jiang Jian
d665b47ae1 Merge branch 'bugfix/fix_wifi_no_response_after_m_f_null_v4.4' into 'release/v4.4'
fix(wifi): fix wifi station no response after m f null

See merge request espressif/esp-idf!26719
2023-11-01 10:54:02 +08:00
David Čermák
d845742038 Merge branch 'feat/lwip_sbom_v4.4' into 'release/v4.4'
feat(lwip): Add sbom descripton file for Software BOM (v4.4)

See merge request espressif/esp-idf!26426
2023-11-01 01:29:03 +08:00
zhanghaipeng
980a15a9cd feat(bt/bluedroid): Display BLE permission check handle in error trace 2023-10-31 14:43:18 +08:00
zhanghaipeng
bca0de4fe5 fix(bt/bluedroid): Fix max BLE gattc notify number to improve compatibility 2023-10-31 14:43:08 +08:00
zhanghaipeng
c841f802cf feat(bt/bluedroid): Support BLE gattc notify registration number 2023-10-31 14:42:55 +08:00
zhanghaipeng
b7e3eb101d fix(bt/bluedroid): Fix key size check in BLE smp 2023-10-31 14:42:45 +08:00
zhanghaipeng
07ba91f926 fix(bt/bluedroid): Optimize compatibility with Android 10 and later devices 2023-10-31 14:42:33 +08:00
zhanghaipeng
2559757c30 feat(bt/bluedroid): Support hid device control point 2023-10-31 14:42:22 +08:00
zhanghaipeng
d6d14d0caa fix(bt/bluedroid): Optimize compatibility with IOS and MACOS devices 2023-10-31 14:41:52 +08:00
David Cermak
c9de8b1cef feat(lwip): Add sbom descripton file for Software BOM (v4.4)
* Update submodule: git log --oneline 0f2d472722aaa0cab6e8a72896699541e65bd45b..90c1e93e40bdfe6718b97e2d95aabc2f0f609ce8

Detailed description of the changes:
  - Add sbom descripton file for Software BOM (espressif/esp-lwip@90c1e93e4)
2023-10-31 06:49:00 +01:00
Michael (XIAO Xufeng)
64c3bf6e20 Merge branch 'bugfix/fix_mem_map_issue_v4.4' into 'release/v4.4'
flash_mmap: fix range issue (v4.4)

See merge request espressif/esp-idf!24558
2023-10-30 15:20:05 +08:00
liuning
62832d6901 fix(wifi): fix wifi station no response after m f null 2023-10-27 16:00:51 +08:00
Wang Meng Yang
b2a1097d4c Merge branch 'bugfix/backport_some_ble_bugs_20231020_v4.4' into 'release/v4.4'
Fixed some BLE bugs 20231020 (backport v4.4)

See merge request espressif/esp-idf!26607
2023-10-27 11:08:51 +08:00
gaoxu
a80fb72f77 fix(adc): fix adc oneshot mod do not split clk 2023-10-27 10:55:01 +08:00
Wang Meng Yang
5690b2fa0a Merge branch 'bugfix/unable_to_load_bonded_ble_devices_from_nvs_v4.4' into 'release/v4.4'
fix(bt/bluedroid): ble fails to load bonded device info after reboot(backport v4.4)

See merge request espressif/esp-idf!26471
2023-10-27 10:27:18 +08:00
gongyantao
439d6440ea fix(bt/bluedroid): update the newest active device in bluetooth
1: update the newest active device when an ACL link is established and
   the remote device info is not in bond list. This updates will not stored
   into NVRAM until a new device is paired.
2023-10-26 19:41:02 +08:00
Mahavir Jain
aee6e63337 Merge branch 'feature/gcm_operation_using_ctr_based_calculation_v4.4' into 'release/v4.4'
GCM operation optimisation (v4.4)

See merge request espressif/esp-idf!26523
2023-10-26 17:23:07 +08:00
Jiang Jiang Jian
f265656a37 Merge branch 'bugfix/spurious_beacon_timeout_v4.4' into 'release/v4.4'
Fixed some WiFi Issues (Backport v4.4)

See merge request espressif/esp-idf!26602
2023-10-26 14:24:57 +08:00
zhiweijian
8ff419aaf4 Update BLE lib on ESP32-C3 and ESP32-S3
- modify mesh proxy solic uuid to 0x18590303
- Fixed DTM payload length cannot be 0
- Added config to enable Hw recorrect eco
- report the number of packets sent on the TX end
2023-10-26 02:32:48 +00:00
zhiweijian
0a8340ddc2 feat: add config to disable ble hci uart flow control 2023-10-26 02:32:48 +00:00
zhiweijian
a8a9ee9c23 change: enable pll track by default on ESP32 2023-10-26 02:32:48 +00:00
zhiweijian
25a2ff985e Add mesh adv type for exception list 2023-10-26 02:32:48 +00:00
chenjianhua
6ce00445b8 Update bt lib for ESP32-C3 and ESP32-S3(c8aa206)
- Fixed extended adv address setting after adv restart
- Fixed scan channel index setting for extended scan
- Add API to set aux channel index for extended adv
2023-10-26 02:32:48 +00:00
chenjianhua
7952b1cbe9 Update bt lib for ESP32-C3 and ESP32-S3(29996e0)
- Fixed address resolution for directed adv with RPA when scanning
- Fixed resolvable private address renew after timeout
2023-10-26 02:32:48 +00:00
zhiweijian
cb80773b88 Add new mesh types for exception list on ESP32-C3 and ESP32-S3 2023-10-26 02:32:48 +00:00
zhiweijian
08e5cae591 Fixed bluedroid host build warning when log is disabled 2023-10-26 02:32:48 +00:00
LiPeng
72e67e3cf7 mbedtls: GCM implementation is replaced with CTR-based calculation
- GCM operation in mbedtls used ECB, which calculated only 16 bytes of data each time.
	- Therefore, when processing a large amount of data, it is necessary to frequently set hardware acceleration calculations,
	- which could not make good use of the AES DMA function to improve efficiency.
	- Hence, GCM implementation is replaced with CTR-based calculation which utilizes AES DMA to improve efficiency.
2023-10-25 18:02:47 +05:30
Jiang Jiang Jian
467225c795 Merge branch 'ci/fix_integration_test_download_bin_4.4' into 'release/v4.4'
ci(fix): integration test download test bin (4.4)

See merge request espressif/esp-idf!26647
2023-10-25 16:19:21 +08:00
Armando
69563f06c9 fix(memory): no enough memory for rodata 2023-10-25 08:02:02 +00:00
Armando
45877f3176 test(flash_mmap): test flash mmap pages 2023-10-25 08:02:02 +00:00
Armando
7911e997ff fix(flash_mmap): fixed limited free I/D pages on ESP32S3, C3 2023-10-25 08:02:02 +00:00
Jiang Jiang Jian
3f81b1a387 Merge branch 'bugfix/fix_cpu_switches_freq_bug_s2s3_to_v4.4' into 'release/v4.4'
EspS2/S3: fixed the bug of insufficient voltage when the CPU switches frequency(V4.4)

See merge request espressif/esp-idf!26282
2023-10-25 10:24:32 +08:00
Chen Yudong
d0a79c9cc9 ci(fix): integration test download test bin 2023-10-24 16:52:47 +08:00
morris
fa5c3bcd09 Merge branch 'docs/rmt_not_support_customized_isr_hander' into 'release/v4.4'
docs(rmt): correct the reason about not allowing customized ISR handler

See merge request espressif/esp-idf!26622
2023-10-23 17:28:51 +08:00
morris
101c6abf04 docs(rmt): correct the reason about not allowing customized ISR handler
Closes https://github.com/espressif/esp-idf/issues/11478
2023-10-23 14:18:45 +08:00
morris
5f257494c5 Merge branch 'contrib/github_pr_12179_v4.4' into 'release/v4.4'
fix(uart): Fix uart_ll_set_baudrate div-by-zero crash due to uint32_t overflow (backport v4.4)

See merge request espressif/esp-idf!26018
2023-10-20 22:19:34 +08:00
jgujarathi
9494b58b32 fix(esp_wifi): Fixes issues in PMKSA and AID assignment
- Fix missing PMKSA flush scenarios.

- Fix wrong AID assigned to station when multiple stations try to connect
  simultaneously with mixed order of auth-request and assoc-request frames.
2023-10-20 14:05:39 +05:30
Mahavir Jain
7a60a294c5 Merge branch 'feature/update_mbedtls_v2.28.5' into 'release/v4.4'
feat(mbedtls): update to release v2.28.5

See merge request espressif/esp-idf!26482
2023-10-20 14:53:00 +08:00
Rahul Tank
b080931067 fix(espcoredump): fixed compilation warning
Added conditional compilation for logging stack usage only when CONFIG_ESP_COREDUMP_LOGS is
enabled.

Closes: https://github.com/espressif/esp-idf/issues/12318
2023-10-20 11:26:23 +05:30
Anton Maklakov
01796f3386 Merge branch 'feature/update-openocd-to-v0.12.0-esp32-20230921_v4.4' into 'release/v4.4'
feat(tools): Update OpenOCD version to v0.12.0-esp32-20230921 (v4.4)

See merge request espressif/esp-idf!26551
2023-10-19 20:01:40 +08:00
Marius Vikhammer
9f48c5eaf5 Merge branch 'bugfix/wdt_deinit_timeout_v4.4' into 'release/v4.4'
fix(wdt): fixed potential WDT timeout when deinitializing task watchdog (v4.4)

See merge request espressif/esp-idf!25984
2023-10-19 13:39:52 +08:00
Jiang Jiang Jian
0b31c7ab79 Merge branch 'feat/imporve_iperf_performance_v4.4' into 'release/v4.4'
feat(wifi): optimize iperf performance (Backport V4.4)

See merge request espressif/esp-idf!26404
2023-10-19 10:31:40 +08:00
Jiang Jiang Jian
6087eb201f Merge branch 'docs/update_wifi_and_wpa_supplicant_documentation_v4.4' into 'release/v4.4'
docs(wifi): Update wifi and wifi security documentation and bugfixes

See merge request espressif/esp-idf!25831
2023-10-19 04:04:19 +08:00
Jiang Jiang Jian
006f0768e1 Merge branch 'bugfix/wps_wpa3_passphrase_v4.4' into 'release/v4.4'
WiFi: get passphrase in WPS if AP support SAE (v4.4)

See merge request espressif/esp-idf!25887
2023-10-18 20:40:08 +08:00
Alexey Gerenkov
4068ba14b2 feat(tools): Update OpenOCD version to v0.12.0-esp32-20230921 2023-10-18 10:59:52 +02:00
Marius Vikhammer
59f3da56bd Merge branch 'bugfix/fix_freertos_system_task_names_v4.4' into 'release/v4.4'
fix(freertos): Updated IDLE task names for each core to have the coreID as a suffix (v4.4)

See merge request espressif/esp-idf!26120
2023-10-18 16:10:25 +08:00
Marius Vikhammer
253660f812 Merge branch 'bugfix/pthread_cond_var_link_hook_v4.4' into 'release/v4.4'
bugfix(pthread): fixed pthread_condvar linker hook (v4.4)

See merge request espressif/esp-idf!26006
2023-10-18 15:55:28 +08:00
Marius Vikhammer
fe50a75d0f Merge branch 'contrib/github_pr_12258_v4.4' into 'release/v4.4'
fix(vfs): Fix event_write may not exit critical section (GitHub PR) (v4.4)

See merge request espressif/esp-idf!26049
2023-10-18 15:51:56 +08:00
Marius Vikhammer
edd4c861f2 Merge branch 'docs/fix_links_ble_mesh_index_v4.4' into 'release/v4.4'
docs: fix some links in ble-mesh-index.rst in v4.4

See merge request espressif/esp-idf!26473
2023-10-18 15:42:12 +08:00
Harshit Malpani
967cae5892 feat(mbedtls): Update to release v2.28.5 2023-10-17 15:09:36 +05:30
Shreyas Sheth
a319ccb552 fix(wifi): Fix crash occuring when station SAE group is not set to SECP256R1 2023-10-17 13:45:27 +05:30
Mahavir Jain
9c4cf20ee1 Merge branch 'fix_esp32s3_irq_names_v4.4' into 'release/v4.4'
fix(interrupts): reorder esp32s3 irq names to align with the respective irq numbers (v4.4)

See merge request espressif/esp-idf!26505
2023-10-17 12:19:19 +08:00
Island
2fa1213528 Merge branch 'backport_v4.4' into 'release/v4.4'
Fix some BLE bugs in bluedroid host(backport 4.4)

See merge request espressif/esp-idf!26167
2023-10-17 09:31:28 +08:00
Erhan Kurubas
c8b90970b4 fix(interrupts): reorder esp32s3 irq names to align with the respective irq numbers 2023-10-16 22:26:36 +02:00
zhanghaipeng
30f067faff fix(bt/bluedroid): Fix hid example stack overflow bugs when using esp32s3 2023-10-16 19:33:46 +08:00
zhanghaipeng
0b5aec08e0 fix(bt/bluedroid): Fix remove resolving list error for esp32 2023-10-16 19:33:35 +08:00
zhanghaipeng
038c935ed7 fix(bt/bluedroid): Fix bugs in ble service change characteristic 2023-10-16 19:33:24 +08:00
zhanghaipeng
5f3065d975 feat(bt/bluedroid): Support scan response data length zero in BLE 2023-10-16 19:33:13 +08:00
zhanghaipeng
79d7f33ff6 fix(bt/bluedroid): Optimize the description of Scan Duplicate in BLE 2023-10-16 19:33:03 +08:00
Shreyas Sheth
3d85e81be2 docs(wifi): Update wifi and wifi security documentation and bugfixes
1. Update documentation for WPA3 Enterprise and WPA3 Enterprise 192-bit
mode
2. Update documentation for WPA3 OWE and OWE transition mode
3. Update documentation related to SAE PK, SAE PWE and Transition Disable
4. Update documnetation for wifi connect API
5. Fix config paramter information for wifi scan start
6. Fix documentation related to scan threshold config setting
7. Replace ESP_ERR_WIFI_ARG error code as ESP_ERR_INVALID_ARG
8. Update documentation for 802.11R Fast transition
9. Fix sta connecting with wpa security in enterprise mode
2023-10-16 14:21:44 +05:30
morris
31ddcba269 Merge branch 'bugfix/usb_serial_jtag_write_return_val_v4.41' into 'release/v4.4'
bugfix(usb_serial_jtag): Fix usb_serial_jtag wrong return value, vfs lose data randomly (backport v4.4)

See merge request espressif/esp-idf!26440
2023-10-16 14:27:53 +08:00
Wang Meng Yang
d990842ca1 Merge branch 'bugfix/error_param_in_BTA_AG_WBS_EVT_v4.4' into 'release/v4.4'
Bugfix/error param in bta ag wbs evt (v4.4)

See merge request espressif/esp-idf!26430
2023-10-16 11:01:11 +08:00
Wang Meng Yang
f7054481ed Merge branch 'bugfix/config_tpoll_fail_v4.4' into 'release/v4.4'
Bugfix/config tpoll fail v4.4

See merge request espressif/esp-idf!26453
2023-10-16 10:59:38 +08:00
Linda
d735ca0483 docs: fix some links in ble-mesh-index.rst in v4.4 2023-10-16 10:54:03 +08:00
gongyantao
f5c113ed5c fix(bt/bluedroid): ble fails to load bonded device info after reboot
1: add a quantity check in bt when writing paired device info into nvs.
2: delete the exceeded device info from NVS when get bonded list during
bluedroid initialization.
3: unify the process of bt and ble to load bonded list during bluedroid
initialization.
2023-10-13 19:30:30 +08:00
baohongde
597d13f2d9 feat(bt/hci): Added Vendor-Specific HCI command to disable DM1 for ACL-U 2023-10-13 14:23:57 +08:00
baohongde
94a6e253e4 fix(bt/bluedroid): Triggering disconnect event of GAP correctly 2023-10-13 14:23:56 +08:00
baohongde
182c1f9c91 fix(bt/bluedroid): Fix issue of QoS configuration failure when t_poll is greater than 40 2023-10-13 14:23:56 +08:00
xuxiao
b25e486cd6 feat(wifi): optimize iperf performance (Backport V4.4) 2023-10-13 11:36:03 +08:00
Chip Weinberger
6e6ea289b7 feat(usb_serial_jtag): printing to console could sometimes skip bytes 2023-10-12 15:21:53 +08:00
Jin Cheng
b306d702c6 fix(bt/bluedroid): Fixed incorrect arrangement in type esp_hf_dial_type_t 2023-10-12 09:44:42 +08:00
Jin Cheng
a62b41064b change(bt/bluedroid): Added line information printing when error occurs CHECK_HF_IDX 2023-10-12 09:44:34 +08:00
Jin Cheng
9be4decab7 fix(bt/bluedroid): Fixed the issue of uninitialized parameters in event BTA_AG_WBS_EVT 2023-10-12 09:44:27 +08:00
David Čermák
987a77505b Merge branch 'bugfix/napt_updatesV4.4' into 'release/v4.4'
napt: restore to the initial state in deinit

See merge request espressif/esp-idf!26337
2023-10-11 22:03:44 +08:00
Island
1c498307cf Merge branch 'bugfix/deepfree_v44' into 'release/v4.4'
fix(ble_mesh): fix compilation failure on using scene model. (v4.4)

See merge request espressif/esp-idf!26369
2023-10-11 19:28:37 +08:00
Wu Meng Shi
c84896af7a fix(ble_mesh): fix compilation failure on using scene model. (v4.4) 2023-10-11 19:28:36 +08:00
Wang Meng Yang
c1d9e6197c Merge branch 'bugfix/hf_ag_report_event_with_null_bdaddr_v4.4' into 'release/v4.4'
Bugfix/fixed bugs of HFP in BlueDroid (v4.4)

See merge request espressif/esp-idf!25829
2023-10-11 19:14:59 +08:00
Kapil Gupta
61e344a057 fix(wifi): Get passphrase in WPS if AP support SAE
Also add changes to send NACK if WPS message received twice.
2023-10-10 09:28:06 +00:00
Wang Meng Yang
6c9e406d67 Merge branch 'bugfix/add_params_check_for_hci_v4.4' into 'release/v4.4'
Fixed some HCI commands parameter (backport v4.4)

See merge request espressif/esp-idf!26152
2023-10-10 14:12:29 +08:00
Island
8cb1f37e50 Merge branch 'bugfix/BLEQABR23-414_v44' into 'release/v4.4'
Fix PB-GATT adv is reported to the app layer too frequently (v4.4)

See merge request espressif/esp-idf!26346
2023-10-10 12:01:56 +08:00
Wu Meng Shi
271083be3d Fix PB-GATT adv is reported to the app layer too frequently (v4.4) 2023-10-10 12:01:56 +08:00
Mahavir Jain
cdd72ac1d4 Merge branch 'feat/add_support_to_add_auth_data_v4.4' into 'release/v4.4'
fix(esp_http_client): Call event_handler after header value is received (v4.4)

See merge request espressif/esp-idf!26323
2023-10-09 16:24:13 +08:00
shangke
8dde99b024 fix(bt/controller): Fixed some HCI commands parameter
1: add param check for HCI_Recevie_Synchronization_Train.
2: add param check for HCI_Set_Connectionless_Peripheral_Broadcast.
3: fix slave cannot take a secure authentication.
2023-10-09 02:28:44 +00:00
Jiang Jiang Jian
bcccf0c3d8 Merge branch 'bugfix/fix_hidd_send_rpt_without_connection_v4.4' into 'release/v4.4'
Change(bt/bluedroid): Optimize HIDD sending interrupt report behavior[backport 4.4]

See merge request espressif/esp-idf!25920
2023-10-08 13:51:30 +08:00
morris
f94d517723 Merge branch 'change/remove_s3_120_sdr_warning_v4.4' into 'release/v4.4'
change(mspi): remove s3 120mhz sdr warning (v4.4)

See merge request espressif/esp-idf!26256
2023-10-08 10:53:09 +08:00
Island
182303a93c Merge branch 'bugfix/fix_some_ble_bug_v4.4' into 'release/v4.4'
Fixed some BLE bugs (backport v4.4)

See merge request espressif/esp-idf!26131
2023-10-08 10:52:31 +08:00
liqigan
939f55dd80 change(bt/bluedroid): Optimize HIDD sending interrupt report behavior
HID device is allowed to trigger reconnection by sending an interrupt
report. When reconnection is in progress, no more interrupt report can
be sent until the procedure is accomplished.
2023-10-08 09:54:11 +08:00
Jiang Jiang Jian
f65d665e9b Merge branch 'change/optimize_sniff_request_v4.4' into 'release/v4.4'
Change(bt/bluedroid): Limit sniff request when pending mode change event[backport 4.4]

See merge request espressif/esp-idf!26055
2023-10-07 14:18:28 +08:00
Jiang Jiang Jian
9e0a101b12 Merge branch 'bugfix/suppress_compiler_warning_silent_reboot_is_enabled_v4.4' into 'release/v4.4'
fix(esp_system): suppress compiler warning if ESP_SYSTEM_PANIC_SILENT_REBOOT is enabled (backport v4.4)

See merge request espressif/esp-idf!26038
2023-10-07 14:17:59 +08:00
Jiang Jiang Jian
6e44a7f589 Merge branch 'bugfix/BLEQABR23-632v44' into 'release/v4.4'
fix(ble_mesh): avoid executing bt_mesh_host_init() more than once when using nimble (v4.4)

See merge request espressif/esp-idf!26243
2023-10-07 14:13:27 +08:00
Wu Meng Shi
0e0beeb591 fix(ble_mesh): avoid executing bt_mesh_host_init() more than once when using nimble (v4.4) 2023-10-07 14:13:27 +08:00
Jiang Jiang Jian
d52e0874c9 Merge branch 'bugfix/fix_hid_congestion_v4.4' into 'release/v4.4'
Fix(bt/bluedroid): Fix the issue for HID congestion checking[backport 4.4]

See merge request espressif/esp-idf!26233
2023-10-07 14:12:33 +08:00
Jiang Jiang Jian
c82223b60e Merge branch 'feat/add_internal_pull_up_or_pull_down_option_for_deepsleep_wakeup_prepare_v4.4' into 'release/v4.4'
feat(pm): add internal pull-up/downs option for gpio used for deepsleep wakeup (backport v4.4)

See merge request espressif/esp-idf!26043
2023-10-07 14:09:43 +08:00
Jiang Jiang Jian
3f492c218d Merge branch 'bugfix/fix_espnow_send_error_when_sta_connected_v4.4' into 'release/v4.4'
fix(Wi-Fi/Vendor): fix ESPNOW send error when station connected to AP and modem sleep is enabled (v4.4)

See merge request espressif/esp-idf!25788
2023-10-07 14:05:13 +08:00
Abhik Roy
ea3dd4c393 napt: restore to the initial state in deinit
This bug casue NAPT not work as normal after deinit then reinit
2023-10-06 20:13:20 +11:00
Roland Dobai
fcc43ef8ed Merge branch 'fix/click-port-compl_v4.4' into 'release/v4.4'
fix(tools): fix autocomplete for --port option (v4.4)

See merge request espressif/esp-idf!25876
2023-10-05 12:59:17 +08:00
Harshit Malpani
95ed121192 fix(esp_http_client): Call event_handler after header value is received 2023-10-05 10:24:31 +05:30
Mahavir Jain
fd07086a2a Merge branch 'bugfix/http_client_tcp_config_v4.4' into 'release/v4.4'
http_client: Set common tcp config to both TCP and SSL transport (v4.4)

See merge request espressif/esp-idf!26207
2023-10-04 21:22:05 +08:00
Rahul Tank
d9a6dbe3a6 Merge branch 'bugfix/post_reattempt_cnt_event_v4.4' into 'release/v4.4'
fix(nimble): Add event for reattempt connection count information (v4.4)

See merge request espressif/esp-idf!26114
2023-09-29 15:56:03 +08:00
Mahavir Jain
919819e682 Merge branch 'feature/freertos_add_sbom_file_v4.4' into 'release/v4.4'
feat(freertos): Added SBOM manifest file for SPDX file generation (v4.4)

See merge request espressif/esp-idf!25893
2023-09-29 13:18:04 +08:00
Mahavir Jain
5f7d4aac6b Merge branch 'update/micro-ecc_submodule_v4.4' into 'release/v4.4'
feat(bootloader): Update micro-ecc version to v1.1 (v4.4)

See merge request espressif/esp-idf!26141
2023-09-29 13:17:37 +08:00
Rahul Tank
69f6838b4b fix(nimble): Add event for reattempt connection count information 2023-09-29 10:08:08 +05:30
Rahul Tank
68df9125f6 Merge branch 'bugfix/memmory_cleanup_optimizatoin_v4.4' into 'release/v4.4'
fix(nimble): Fix for memory leak/optimization (v4.4)

See merge request espressif/esp-idf!25982
2023-09-29 12:34:46 +08:00
hongshuqing
fbdeff2108 s2s3 cpu sw freq 2023-09-28 10:53:34 +08:00
chenqingqing
6e47cc1059 fix(bt/bluedroid): Fix the judgment condition for packet transmission status statistics 2023-09-27 19:17:54 +08:00
Aditya Patwardhan
b550086d0e Merge branch 'update/version_4_4_6' into 'release/v4.4'
versions: Update version to 4.4.6

See merge request espressif/esp-idf!26089
2023-09-27 16:27:59 +08:00
Armando
cafc087cc5 change(mspi): remove s3 120mhz sdr warning 2023-09-27 15:03:07 +08:00
liqigan
bdf8dd3d10 fix(bt/bluedroid): Fix the issue for HID congestion checking 2023-09-26 14:29:06 +08:00
David Cermak
05cde47281 fix(http_client): Set common tcp config to both TCP and SSL transport
Foundation transport contained TCP properties for both TCP and SSL
transport, so it was enough to set the TCP connection properties
(keepalive, interface binding) to one transport only. After merging
5778a7c7 we have separate TCP properties for these transports and need
to set the same for both.
This commit also fixes unnecessary allocation of 1 more byte for if_name

Closes https://github.com/espressif/esp-protocols/issues/322
2023-09-26 06:29:36 +02:00
zhanghaipeng
0f66c73f67 fix(bt/bluedroid): Fix set periodic advertising data error 2023-09-23 20:18:42 +08:00
harshal.patil
7e14e7f5bd feat(bootloader): Update micro-ecc version to v1.1
This fix ensures that https://nvd.nist.gov/vuln/detail/CVE-2020-27209 is not
reported by the ESP-IDF SBOM tool. Please note that, this CVE was anyways not
applicable for ESP32 platform, as the bootloader (user of micro-ecc library)
do not perform signing on the device, its only verification that happens in
secure-boot-v1 case.
2023-09-22 10:50:16 +05:30
chenjianhua
b7e76d96fb bluedroid: fix ble ext adv rand addr setting for NRPA 2023-09-21 21:34:35 +08:00
chenjianhua
375be9e109 bluedroid: fix ble adv data construct for device name 2023-09-21 21:34:23 +08:00
chenjianhua
b68fb2be7c bluedroid: fix ble smp key distribution setting 2023-09-21 21:33:54 +08:00
You Wei
ea2f6455a0 fix(ldgen): duplicate entries in the generated .ld file 2023-09-21 19:41:32 +08:00
You Wei
f9077cb073 fix(ldgen): check target conflict for entries with section alias 2023-09-21 19:41:32 +08:00
Sudeep Mohanty
c30e238b16 fix(freertos): Updated IDLE task names for each core to have the coreID as a suffix
This commit updates the IDLE task names for each core by concatenating
the respective coreIDs to the names.

Closes https://github.com/espressif/esp-idf/issues/12204
2023-09-21 13:16:51 +02:00
liqigan
146c8f24a6 change(bt/bluedroid): Limit sniff request when pending mode change event 2023-09-19 20:11:53 +08:00
LiPeng
7ca602e86b fix(vfs): Fix event_write may not exit critical section
This commit fixes the event_write() function where the critical section
was unbalanced.

Merges https://github.com/espressif/esp-idf/pull/12258
2023-09-19 08:53:58 +02:00
Lou Tianhao
fa12d24f1c feat(pm): add internal pull-up/downs option for gpio used for deepsleep wakeup 2023-09-19 11:16:20 +08:00
wuzhenghui
0b02441fe7 fix(esp_system): suppress compiler warning if ESP_SYSTEM_PANIC_SILENT_REBOOT is enabled 2023-09-19 10:51:24 +08:00
Eduardo Lacerda Campos
a2682d4ffb fix(uart): Fix uart_ll_set_baudrate div-by-zero crash due to uint32_t overflow
Merges https://github.com/espressif/esp-idf/pull/12179
2023-09-18 16:22:01 +08:00
Jakob Hasse
c266f260fb fix(pthread): fixed pthread_condvar linker hook 2023-09-18 12:31:43 +08:00
Rahul Tank
bf78b03cdc fix(nimble): Fix for memory leak/optimization 2023-09-15 13:13:53 +05:30
Marius Vikhammer
e557ed94fb fix(wdt): fixed potential WDT timeout when deinitializing task watchdog
If task WDT deinit was called from core 1 it would cause an interrupt WDT timeout
2023-09-14 13:16:46 +08:00
Sudeep Mohanty
484c77bdc9 feat(freertos): Added SBOM manifest file for SPDX file generation
This commit adds the SBOM manifest file for the FreeRTOS-Kernel to aid
SPDX file generation.
2023-09-08 12:57:44 +02:00
Peter Dragun
b266352f2f fix(tools): fix autocomplete for --port option
Closes https://github.com/espressif/esp-idf/issues/7970
2023-09-08 09:30:42 +02:00
Wang Mengyang
edcb1b58b7 ci(bt/bluedroid): Add CI build test for HFP examples with voice over HCI enabled 2023-09-08 11:39:50 +08:00
chenqingqing
482532b7d7 feat(bt/api): Add new apis for hfp to get the numbers of packet status received and sent 2023-09-08 11:29:26 +08:00
Jin Cheng
21dfae06e4 fix(bt/bluedroid): Deleted the redundant 'memset' in btc_hf_cb_handler 2023-09-07 11:25:21 +08:00
Jin Cheng
8a6298c98e docs(bt/bluedroid): Changed the description of esp_hf_client_reject_call 2023-09-07 11:25:21 +08:00
Jin Cheng
13842a9e68 fix(bt/bluedroid): Fixed invalid access to freed semaphore 2023-09-07 11:25:21 +08:00
Jin Cheng
d1d736d471 fix(bt/bluedroid): Fixed wrong indexes of HF-AG indicators 2023-09-07 11:25:21 +08:00
Jin Cheng
87d4d95e59 fix(bt/bluedroid): Added peer Bluetooth device address into HF callback parameters 2023-09-07 11:25:19 +08:00
Jin Cheng
7723d1bada fix(bt/bluedroid): Changed log level from WARNING to DEBUG in bta_ag_sco_read_cback 2023-09-07 11:24:39 +08:00
Jin Cheng
d8e806de63 fix(bt/bluedroid): Fixed wrong code logic in 'AT+CIND?' of HFP 2023-09-07 11:24:39 +08:00
Jin Cheng
68e469d55f fix(bt/bluedroid): Fixed errors in parsing ATD command in HFP AG 2023-09-07 11:24:34 +08:00
Jin Cheng
7db846e809 fix(bt/bluedroid): Fixed NULL Bluetooth device address in HF-AG events was reported to application layer 2023-09-07 11:06:57 +08:00
zhangyanjiao
41c50a21ef fix(Wi-Fi/Vendor): fix ESPNOW send error when station connected to AP and modem sleep is enabled 2023-09-07 02:00:09 +00:00
484 changed files with 8793 additions and 4008 deletions

View File

@@ -12,7 +12,7 @@ stages:
workflow:
rules:
# Disable those non-protected push triggered pipelines
- if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_PIPELINE_SOURCE == "push"'
- if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_COMMIT_TAG !~ /^qa-test/ && $CI_PIPELINE_SOURCE == "push"'
when: never
# when running merged result pipelines, it would create a temp commit id. use $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA instead of $CI_COMMIT_SHA.
# Please use PIPELINE_COMMIT_SHA at all places that require a commit sha
@@ -62,12 +62,17 @@ variables:
CLANG_STATIC_ANALYSIS_IMAGE: "${CI_DOCKER_REGISTRY}/clang-static-analysis:v4.4-1-2"
SONARQUBE_SCANNER_IMAGE: "${CI_DOCKER_REGISTRY}/sonarqube-scanner:3"
# target test config file, used by assign test job
# target test config file, used by scan test and assign test job
CI_TARGET_TEST_CONFIG_FILE: "$CI_PROJECT_DIR/.gitlab/ci/target-test.yml"
# target test repo parameters
TEST_ENV_CONFIG_REPO: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/qa/ci-test-runner-configs.git"
# Set this variable to specify the file name for the known failure cases.
KNOWN_FAILURE_CASES_FILE_NAME: "4.4.txt"
IDF_CI_BUILD: 1
.setup_tools_unless_target_test: &setup_tools_unless_target_test |
if [[ -n "$IDF_DONT_USE_MIRRORS" ]]; then
export IDF_MIRROR_PREFIX_MAP=
@@ -140,6 +145,7 @@ include:
- '.gitlab/ci/pre_check.yml'
- '.gitlab/ci/build.yml'
- '.gitlab/ci/assign-test.yml'
- '.gitlab/ci/integration_test.yml'
- '.gitlab/ci/host-test.yml'
- '.gitlab/ci/target-test.yml'
- '.gitlab/ci/deploy.yml'

View File

@@ -48,7 +48,7 @@
- `example_test[_esp32/esp32s2/...]`
- `fuzzer_test`
- `host_test`
- `integration_test[_wifi/ble]`
- `integration_test`
- `iperf_stress_test`
- `macos`
- `macos_test`
@@ -136,10 +136,11 @@ check if there's a suitable `.if-<if-anchor-you-need>` anchor
1. if there is, create a rule following [`rules` Template Naming Rules](#rules-template-naming-rules).For detail information, please refer to [GitLab Documentation `rules-if`](https://docs.gitlab.com/ee/ci/yaml/README.html#rulesif). Here's an example.
```yaml
.rules:dev:
.rules:patterns:python-files:
rules:
- <<: *if-trigger
- <<: *if-protected
- <<: *if-dev-push
changes: *patterns-python-files
```
2. if there isn't

View File

@@ -103,69 +103,3 @@ assign_unit_test:
BUILD_DIR: ${CI_PROJECT_DIR}/tools/unit-test-app/builds
script:
- python tools/ci/python_packages/ttfw_idf/IDFAssignTest.py $TEST_TYPE $TEST_DIR -c $CI_TARGET_TEST_CONFIG_FILE -o $TEST_DIR/test_configs
assign_integration_test:
extends:
- .assign_test_template
- .rules:test:integration_test
- .before_script_minimal
image: ${CI_INTEGRATION_TEST_ENV_IMAGE}
needs:
- build_ssc_esp32
- build_ssc_esp32c3
artifacts:
paths:
- $TEST_DIR/test_configs
variables:
TEST_DIR: ${CI_PROJECT_DIR}/tools/ci/integration_test
BUILD_DIR: ${CI_PROJECT_DIR}/SSC/ssc_bin
INTEGRATION_TEST_CASE_PATH: "${CI_PROJECT_DIR}/auto_test_script/TestCaseFiles"
ASSIGN_TEST_CASE_SCRIPT: "${CI_PROJECT_DIR}/auto_test_script/bin/CIAssignTestCases.py"
PYTHONPATH: ${CI_PROJECT_DIR}/auto_test_script/packages
GIT_LFS_SKIP_SMUDGE: 1
script:
- add_gitlab_ssh_keys
# clone test script to assign tests
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} auto_test_script
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script
- cd auto_test_script
- ./tools/ci/setup_idfci.sh
# assign integration test cases
- python ${ASSIGN_TEST_CASE_SCRIPT} -t ${INTEGRATION_TEST_CASE_PATH} -c $CI_TARGET_TEST_CONFIG_FILE -b ${BUILD_DIR} -o $TEST_DIR/test_configs
update_test_cases:
extends: .rules:ref:master-schedule
stage: assign_test
image: $CI_DOCKER_REGISTRY/ubuntu-test-env
tags:
- deploy_test
needs:
- build_esp_idf_tests_cmake_esp32
- build_esp_idf_tests_cmake_esp32s2
- build_esp_idf_tests_cmake_esp32s3
- build_esp_idf_tests_cmake_esp32c3
artifacts:
when: always
paths:
- ${CI_PROJECT_DIR}/test-management/*.log
expire_in: 1 week
variables:
SUBMODULES_TO_FETCH: "components/esptool_py/esptool"
UNIT_TEST_DIR: "${CI_PROJECT_DIR}/components/idf_test/unit_test"
BOT_ACCOUNT_CONFIG_FILE: "${CI_PROJECT_DIR}/test-management/Config/Account.local.yml"
PYTHONPATH: ${CI_PROJECT_DIR}/auto_test_script/packages
PYTHON_VER: 3.7.7
script:
- export GIT_SHA=$(echo ${PIPELINE_COMMIT_SHA} | cut -c 1-8)
- retry_failed git clone $TEST_MANAGEMENT_REPO
- python $CHECKOUT_REF_SCRIPT test-management test-management
- cd test-management
- echo $BOT_JIRA_ACCOUNT > ${BOT_ACCOUNT_CONFIG_FILE}
# update unit test cases
- export UNIT_TEST_CASE_FILES=$(find $UNIT_TEST_DIR -maxdepth 1 -name "*.yml" | xargs)
- python ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT unity -d $UNIT_TEST_CASE_FILES -r $GIT_SHA
# update example test cases
- python ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT tiny_test_fw -d ${CI_PROJECT_DIR}/examples -r $GIT_SHA
- python ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT tiny_test_fw -d ${CI_PROJECT_DIR}/tools/test_apps -r $GIT_SHA
# organize test cases
- python OrganizeTestCases.py $JIRA_TEST_MANAGEMENT_PROJECT

View File

@@ -51,44 +51,6 @@ fast_template_app:
BUILD_COMMAND_ARGS: "-p"
#------------------------------------------------------------------------------
.build_ssc_template:
extends:
- .build_template
- .rules:build:integration_test
artifacts:
paths:
- SSC/ssc_bin
expire_in: 1 week
script:
- retry_failed git clone $SSC_REPOSITORY
- python $CHECKOUT_REF_SCRIPT SSC SSC
- cd SSC
- MAKEFLAGS= ./ci_build_ssc.sh $TARGET_NAME
build_ssc_esp32:
extends: .build_ssc_template
parallel: 3
variables:
TARGET_NAME: "ESP32"
build_ssc_esp32s2:
extends: .build_ssc_template
parallel: 2
variables:
TARGET_NAME: "ESP32S2"
build_ssc_esp32c3:
extends: .build_ssc_template
parallel: 3
variables:
TARGET_NAME: "ESP32C3"
build_ssc_esp32s3:
extends: .build_ssc_template
parallel: 3
variables:
TARGET_NAME: "ESP32S3"
.build_esp_idf_tests_cmake_template:
extends: .build_template
dependencies: # set dependencies to null to avoid missing artifacts issue

View File

@@ -65,15 +65,6 @@
- "build:{0}"
- build:target_test
build:integration_test:
labels:
- build
patterns:
- build_components
- build_system
included_in:
- build:target_test
####################
# Target Test Jobs #
####################
@@ -113,22 +104,6 @@ build:integration_test:
- "build:component_ut-{0}"
- build:target_test
"test:integration_test_{0}":
matrix:
- - wifi
- ble
labels:
- integration_test_{0}
- integration_test
- target_test
patterns:
- integration_test_{0}
# - maybe others
included_in:
- test:integration_test
- build:integration_test
- build:target_test
"test:host_test":
labels:
- host_test

View File

@@ -9,49 +9,15 @@ push_to_github:
extends:
- .deploy_job_template
- .before_script_minimal
- .rules:protected-no_label
dependencies: []
- .rules:push_to_github
needs:
- check_submodule_sync
script:
- add_github_ssh_keys
- git remote remove github &>/dev/null || true
- git remote add github git@github.com:espressif/esp-idf.git
- tools/ci/push_to_github.sh
deploy_test_result:
extends:
- .deploy_job_template
- .before_script_minimal
- .rules:ref:master-always
image: $CI_DOCKER_REGISTRY/bot-env
tags:
- deploy_test
artifacts:
when: always
paths:
- ${CI_PROJECT_DIR}/test-management/*.log
# save all test logs as artifacts, make it easier to track errors
- ${CI_PROJECT_DIR}/TEST_LOGS
expire_in: 1 mos
variables:
UNIT_TEST_CASE_FILE: "${CI_PROJECT_DIR}/components/idf_test/unit_test/TestCaseAll.yml"
BOT_ACCOUNT_CONFIG_FILE: "${CI_PROJECT_DIR}/test-management/Config/Account.local.yml"
TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
AUTO_TEST_SCRIPT_PATH: "${CI_PROJECT_DIR}/auto_test_script"
script:
- add_gitlab_ssh_keys
- export GIT_SHA=$(echo ${PIPELINE_COMMIT_SHA} | cut -c 1-8)
- export REV_COUNT=$(git rev-list --count ${PIPELINE_COMMIT_SHA} --)
- export SUMMARY="IDF CI test result for $GIT_SHA (r${REV_COUNT})"
# artifacts of job update_test_cases creates test-management folder
# we need to remove it so we can clone test-management folder again
- rm -rf test-management
- retry_failed git clone $TEST_MANAGEMENT_REPO
- python3 $CHECKOUT_REF_SCRIPT test-management test-management
- cd test-management
- echo $BOT_JIRA_ACCOUNT > ${BOT_ACCOUNT_CONFIG_FILE}
# update test results
- python3 ImportTestResult.py -r "$GIT_SHA (r${REV_COUNT})" -j $JIRA_TEST_MANAGEMENT_PROJECT -s "$SUMMARY" -l CI -p ${CI_PROJECT_DIR}/TEST_LOGS --pipeline_url ${CI_PIPELINE_URL}
check_submodule_sync:
extends:
- .deploy_job_template

View File

@@ -17,6 +17,9 @@
.if-protected-no_label: &if-protected-no_label
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) && $BOT_TRIGGER_WITH_LABEL == null'
.if-qa-test-tag: &if-qa-test-tag
if: '$CI_COMMIT_TAG =~ /^qa-test/'
.if-label-build_docs: &if-label-build_docs
if: '$BOT_LABEL_BUILD_DOCS || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*build_docs(?:,[^,\n\r]+)*$/i'
@@ -27,10 +30,12 @@
if: '$BOT_LABEL_DOCS_FULL || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*docs_full(?:,[^,\n\r]+)*$/i'
.if-dev-push: &if-dev-push
if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event")'
if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_COMMIT_TAG !~ /^qa-test/ && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event")'
.doc-rules:build:docs:
rules:
- <<: *if-qa-test-tag
when: never
- <<: *if-protected
- <<: *if-label-build_docs
- <<: *if-label-docs

View File

@@ -281,13 +281,6 @@ test_mkuf2:
- cd ${IDF_PATH}/tools/test_mkuf2
- ./test_mkuf2.py
test_sbom:
extends:
- .host_test_template
- .rules:patterns:sbom
script:
- python ${IDF_PATH}/tools/test_sbom/test_submodules.py
test_autocomplete:
extends: .host_test_template
image: $CI_DOCKER_REGISTRY/linux-shells:1

View File

@@ -0,0 +1,69 @@
# generate dynamic integration pipeline by `idf-integration-ci` project
.patterns-integration_test: &patterns-integration_test
# add all possible patterns to make sure `gen_integration_pipeline` can be triggered.
# fine-grained control will be done while generating the pipeline
# find `patterns` in `idf-integration-ci` project
- "components/**/*"
- "tools/**/*"
- ".gitlab-ci.yml"
- ".gitlab/ci/common.yml"
- ".gitlab/ci/integration_test.yml"
- ".gitmodules"
- "CMakeLists.txt"
- "install.sh"
- "export.sh"
- "Kconfig"
- "sdkconfig.rename"
# Simplify the rules
.integration_test_rules:
rules:
- if: '$CI_PIPELINE_SOURCE != "merge_request_event"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes: *patterns-integration_test
# support trigger by ci labels
- if: '$CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*target_test(?:,[^,\n\r]+)*$/i'
- if: '$CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*integration_test(?:,[^,\n\r]+)*$/i'
- if: '$CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*build(?:,[^,\n\r]+)*$/i'
gen_integration_pipeline:
extends:
- .before_script_minimal
- .integration_test_rules
image: ${CI_INTEGRATION_ASSIGN_ENV}
stage: assign_test
cache: []
tags:
- assign_test
variables:
SUBMODULES_TO_FETCH: "none"
GIT_LFS_SKIP_SMUDGE: 1
needs:
- job: fast_template_app
artifacts: false
optional: true
artifacts:
paths:
- idf-integration-ci/child_pipeline/
expire_in: 2 weeks
script:
- add_gitlab_ssh_keys
- retry_failed git clone ${CI_GEN_INTEGRATION_PIPELINE_REPO} idf-integration-ci
- python $CHECKOUT_REF_SCRIPT idf-integration-ci idf-integration-ci
- cd idf-integration-ci
- python tools/generate_child_pipeline.py -o child_pipeline/
child_integration_test_pipeline:
extends:
- .integration_test_rules
stage: assign_test
needs:
- gen_integration_pipeline
trigger:
include:
- artifact: idf-integration-ci/child_pipeline/pipeline.yml
job: gen_integration_pipeline
forward:
yaml_variables: false
strategy: depend

View File

@@ -24,13 +24,15 @@ check_pre_commit_master_release:
- .rules:protected
script:
- git diff-tree --no-commit-id --name-only -r $PIPELINE_COMMIT_SHA | xargs pre-commit run --files
- pre-commit run --hook-stage post-commit validate-sbom-manifest
check_pre_commit_MR:
extends:
- .check_pre_commit_template
- .rules:dev
- .rules:mr
script:
- python ${CI_PROJECT_DIR}/tools/ci/ci_get_mr_info.py files ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} | xargs pre-commit run --files
- pre-commit run --hook-stage post-commit validate-sbom-manifest
check_version:
# Don't run this for feature/bugfix branches, so that it is possible to modify

View File

@@ -48,9 +48,6 @@
- "tools/tools.json"
- "tools/ci/test_build_system*.sh"
.patterns-sbom: &patterns-sbom
- "tools/test_sbom/*"
.patterns-custom_test: &patterns-custom_test
- "tools/ci/python_packages/gitlab_api.py"
- "tools/ci/python_packages/tiny_test_fw/**/*"
@@ -88,20 +85,6 @@
- "components/**/test_apps/**/*"
.patterns-integration_test_ble: &patterns-integration_test_ble
- "tools/ci/python_packages/gitlab_api.py"
- "tools/ci/integration_test/**/*"
- "components/bt/controller/lib_esp32"
- "components/bt/controller/lib_esp32c3_family"
- "components/bt/host/nimble/nimble"
- "components/esp_phy/lib"
.patterns-integration_test_wifi: &patterns-integration_test_wifi
- "tools/ci/python_packages/gitlab_api.py"
- "tools/ci/integration_test/**/*"
- "components/esp_wifi/lib"
- "components/esp_phy/lib"
.patterns-host_test: &patterns-host_test
- ".gitlab/ci/host-test.yml"
@@ -191,13 +174,19 @@
if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/'
.if-protected: &if-protected
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/)'
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) || $CI_COMMIT_TAG =~ /^qa-test/'
.if-protected-no_label: &if-protected-no_label
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) && $BOT_TRIGGER_WITH_LABEL == null'
.if-qa-test-tag: &if-qa-test-tag
if: '$CI_COMMIT_TAG =~ /^qa-test/'
.if-dev-push: &if-dev-push
if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event")'
if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_COMMIT_TAG !~ /^qa-test/ && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event")'
.if-merge_request: &if-merge_request
if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
.if-schedule: &if-schedule
if: '$CI_PIPELINE_SOURCE == "schedule"'
@@ -215,10 +204,16 @@
rules:
- <<: *if-protected
.rules:protected-no_label:
.rules:push_to_github:
rules:
- <<: *if-qa-test-tag
when: never
- <<: *if-protected-no_label
.rules:mr:
rules:
- <<: *if-merge_request
.rules:dev:
rules:
- <<: *if-trigger
@@ -259,14 +254,6 @@
- <<: *if-dev-push
changes: *patterns-sonarqube-files
.rules:patterns:sbom:
rules:
- <<: *if-protected
- <<: *if-dev-push
changes: *patterns-sbom
- <<: *if-dev-push
changes: *patterns-submodule
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# DO NOT place comments or maintain any code from this line
#
@@ -336,15 +323,6 @@
.if-label-host_test: &if-label-host_test
if: '$BOT_LABEL_HOST_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*host_test(?:,[^,\n\r]+)*$/i'
.if-label-integration_test: &if-label-integration_test
if: '$BOT_LABEL_INTEGRATION_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*integration_test(?:,[^,\n\r]+)*$/i'
.if-label-integration_test_ble: &if-label-integration_test_ble
if: '$BOT_LABEL_INTEGRATION_TEST_BLE || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*integration_test_ble(?:,[^,\n\r]+)*$/i'
.if-label-integration_test_wifi: &if-label-integration_test_wifi
if: '$BOT_LABEL_INTEGRATION_TEST_WIFI || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*integration_test_wifi(?:,[^,\n\r]+)*$/i'
.if-label-iperf_stress_test: &if-label-iperf_stress_test
if: '$BOT_LABEL_IPERF_STRESS_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*iperf_stress_test(?:,[^,\n\r]+)*$/i'
@@ -647,23 +625,6 @@
- <<: *if-dev-push
changes: *patterns-example_test
.rules:build:integration_test:
rules:
- <<: *if-protected
- <<: *if-label-build
- <<: *if-label-integration_test
- <<: *if-label-integration_test_ble
- <<: *if-label-integration_test_wifi
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-integration_test_ble
- <<: *if-dev-push
changes: *patterns-integration_test_wifi
.rules:build:macos:
rules:
- <<: *if-protected
@@ -692,9 +653,6 @@
- <<: *if-label-example_test_esp32c3
- <<: *if-label-example_test_esp32s2
- <<: *if-label-example_test_esp32s3
- <<: *if-label-integration_test
- <<: *if-label-integration_test_ble
- <<: *if-label-integration_test_wifi
- <<: *if-label-iperf_stress_test
- <<: *if-label-target_test
- <<: *if-label-unit_test
@@ -715,10 +673,6 @@
changes: *patterns-custom_test
- <<: *if-dev-push
changes: *patterns-example_test
- <<: *if-dev-push
changes: *patterns-integration_test_ble
- <<: *if-dev-push
changes: *patterns-integration_test_wifi
- <<: *if-dev-push
changes: *patterns-unit_test
@@ -979,42 +933,6 @@
- <<: *if-dev-push
changes: *patterns-host_test
.rules:test:integration_test:
rules:
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-integration_test
- <<: *if-label-integration_test_ble
- <<: *if-label-integration_test_wifi
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-integration_test_ble
- <<: *if-dev-push
changes: *patterns-integration_test_wifi
.rules:test:integration_test_ble:
rules:
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-integration_test
- <<: *if-label-integration_test_ble
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-integration_test_ble
.rules:test:integration_test_wifi:
rules:
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-integration_test
- <<: *if-label-integration_test_wifi
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-integration_test_wifi
.rules:test:submodule:
rules:
- <<: *if-protected

View File

@@ -31,10 +31,11 @@
- retry_failed git clone $TEST_ENV_CONFIG_REPO
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs
# git clone the known failure cases repo, run test
- retry_failed git clone $KNOWN_FAILURE_CASES_REPO known_failure_cases
- pip install minio
- python tools/ci/get_known_failure_cases_file.py
# run test
- cd tools/ci/python_packages/tiny_test_fw/bin
- run_cmd python Runner.py $TEST_CASE_PATH -c $CONFIG_FILE -e $ENV_FILE --known_failure_cases_file $CI_PROJECT_DIR/known_failure_cases/known_failure_cases.txt
- run_cmd python Runner.py $TEST_CASE_PATH -c $CONFIG_FILE -e $ENV_FILE --known_failure_cases_file $CI_PROJECT_DIR/${KNOWN_FAILURE_CASES_FILE_NAME}
.example_test_template:
extends: .target_test_job_template
@@ -363,7 +364,6 @@ test_app_test_003:
test_app_test_004:
extends: .test_app_esp32s2_template
parallel: 2
tags:
- ESP32S2
- Example_GENERIC
@@ -407,17 +407,11 @@ test_app_test_flash_psram_f8r8:
- ESP32S3
- MSPI_F8R8
test_app_test_xip_psram_esp32s2:
extends: .test_app_esp32s2_template
test_app_test_flash_psram_esp32:
extends: .test_app_esp32_template
tags:
- ESP32S2
- Example_GENERIC
test_app_test_xip_psram_esp32s3:
extends: .test_app_esp32s3_template
tags:
- ESP32S3
- MSPI_F4R8
- ESP32
- psram
.component_ut_template:
extends: .target_test_job_template
@@ -434,10 +428,11 @@ test_app_test_xip_psram_esp32s3:
- retry_failed git clone $TEST_ENV_CONFIG_REPO
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs
# git clone the known failure cases repo, run test
- retry_failed git clone $KNOWN_FAILURE_CASES_REPO known_failure_cases
- pip install minio
- python tools/ci/get_known_failure_cases_file.py
# run test
- cd tools/ci/python_packages/tiny_test_fw/bin
- run_cmd python Runner.py $COMPONENT_UT_DIRS -c $CONFIG_FILE -e $ENV_FILE --known_failure_cases_file $CI_PROJECT_DIR/known_failure_cases/known_failure_cases.txt
- run_cmd python Runner.py $COMPONENT_UT_DIRS -c $CONFIG_FILE -e $ENV_FILE --known_failure_cases_file $CI_PROJECT_DIR/${KNOWN_FAILURE_CASES_FILE_NAME}
.component_ut_esp32_template:
extends:
@@ -522,7 +517,7 @@ UT_001:
UT_002:
extends: .unit_test_esp32_template
parallel: 15
parallel: 16
tags:
- ESP32_IDF
- UT_T1_1
@@ -708,7 +703,7 @@ UT_046:
UT_047:
extends: .unit_test_esp32s2_template
parallel: 7
parallel: 8
tags:
- ESP32S2_IDF
- UT_T1_1
@@ -727,7 +722,7 @@ UT_S2_SDSPI:
UT_C3:
extends: .unit_test_esp32c3_template
parallel: 35
parallel: 36
tags:
- ESP32C3_IDF
- UT_T1_1
@@ -791,284 +786,14 @@ UT_S3_FLASH:
component_ut_test_ip101:
extends: .component_ut_esp32_template
image: $CI_DOCKER_REGISTRY/ubuntu-test-env
tags:
- ESP32
- COMPONENT_UT_IP101
- eth_ip101
component_ut_test_lan8720:
extends: .component_ut_esp32_template
image: $CI_DOCKER_REGISTRY/ubuntu-test-env
tags:
- ESP32
- COMPONENT_UT_LAN8720
.integration_test_template:
extends:
- .target_test_job_template
- .rules:test:integration_test
- .before_script_minimal
image: ${CI_INTEGRATION_TEST_ENV_IMAGE}
needs: # the assign already needs all the build jobs
- assign_integration_test
variables:
LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32_IDF"
LOG_PATH: "${CI_PROJECT_DIR}/TEST_LOGS"
TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/auto_test_script/TestCaseFiles"
CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/tools/ci/integration_test/test_configs"
KNOWN_ISSUE_FILE: "${CI_PROJECT_DIR}/tools/ci/integration_test/KnownIssues"
CI_RUNNER_SCRIPT: "${CI_PROJECT_DIR}/auto_test_script/bin/CIRunner.py"
PREPARE_TEST_BIN_SCRIPT: "${CI_PROJECT_DIR}/tools/ci/integration_test/prepare_test_bins.py"
PYTHONPATH: "${CI_PROJECT_DIR}/auto_test_script/packages:${CI_PROJECT_DIR}/tools/ci/python_packages:${PYTHONPATH}"
INITIAL_CONDITION_RETRY_COUNT: "1"
GIT_LFS_SKIP_SMUDGE: 1
script:
- *define_config_file_name
# first test if config file exists, if not exist, exit 0
- test -e $CONFIG_FILE || exit 0
- add_gitlab_ssh_keys
# clone local test env configs
- retry_failed git clone $TEST_ENV_CONFIG_REPO
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs
# clone test bench
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} auto_test_script
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script
- cd auto_test_script
- ./tools/ci/setup_idfci.sh
# Merge known issues
- cat ${KNOWN_ISSUE_FILE} >> ${TEST_CASE_FILE_PATH}/KnownIssues
# run test
- python ${PREPARE_TEST_BIN_SCRIPT} $CONFIG_FILE
- python ${CI_RUNNER_SCRIPT} -l "$LOG_PATH/$JOB_FULL_NAME" -c $CONFIG_FILE -e $LOCAL_ENV_CONFIG_PATH -t $TEST_CASE_FILE_PATH
.integration_test_esp32c3_template:
extends:
- .integration_test_template
variables:
LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32C3_IDF"
nvs_compatible_test:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
artifacts:
when: always
paths:
- $LOG_PATH
- nvs_wifi.bin
expire_in: 1 mos
tags:
- ESP32_IDF
- NVS_Compatible
script:
- *define_config_file_name
# first test if config file exists, if not exist, exit 0
- test -e $CONFIG_FILE || exit 0
- add_gitlab_ssh_keys
# clone local test env configs
- retry_failed git clone $TEST_ENV_CONFIG_REPO
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs
# clone test bench
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} auto_test_script
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script
- cd auto_test_script
- ./tools/ci/setup_idfci.sh
# prepare nvs bins
- ./tools/prepare_nvs_bin.sh
# run test
- python ${PREPARE_TEST_BIN_SCRIPT} $CONFIG_FILE
- python ${CI_RUNNER_SCRIPT} -l "$LOG_PATH/$JOB_FULL_NAME" -c $CONFIG_FILE -e $LOCAL_ENV_CONFIG_PATH -t $TEST_CASE_FILE_PATH
IT_T1_Simple:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
parallel: 2
tags:
- ESP32_IDF
- SSC_T1_Simple
IT_T1_WAP:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T1_WAP
IT_T2_Simple:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
parallel: 9
tags:
- ESP32_IDF
- SSC_T2_Simple
IT_T5_BT_Simple:
extends:
- .integration_test_template
- .rules:test:integration_test_ble
parallel: 3
tags:
- ESP32_IDF
- SSC_T5_BT_Simple
IT_T2_BT_Simple:
extends:
- .integration_test_template
- .rules:test:integration_test_ble
parallel: 6
tags:
- ESP32_IDF
- SSC_T2_BT_Simple
IT_T1_BT_Dongle:
extends:
- .integration_test_template
- .rules:test:integration_test_ble
parallel: 2
tags:
- ESP32_IDF
- SSC_T1_BT_Dongle
IT_T1_AP:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T1_AP
IT_T1_AP_E:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
parallel: 5
tags:
- ESP32_IDF
- SSC_T1_AP_E
IT_T1_WNIC_AP:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T1_WNIC_AP
IT_T1_WNIC_AP_E:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T1_WNIC_AP_E
IT_T1_MESH1:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T1_MESH1
IT_T2_MESH1:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
parallel: 2
tags:
- ESP32_IDF
- SSC_T2_MESH1
IT_T3_MESH1:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T3_MESH1
IT_T6_MESH1:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T6_MESH1
IT_T12_MESH1:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T12_MESH1
IT_T50_MESH1:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
allow_failure: true
tags:
- ESP32_IDF
- SSC_T50_MESH1
IT_T1_MESH2:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T1_MESH2
IT_T2_WNIC:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T2_WNIC
IT_T2_AP:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T2_AP
IT_T3_Simple:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T3_Simple
IT_C3_T2_BT_Simple:
extends:
- .integration_test_esp32c3_template
- .rules:test:integration_test_ble
parallel: 9
tags:
- ESP32C3_IDF
- SSC_T2_BT_Simple
IT_C3_T5_BT_Simple:
extends:
- .integration_test_esp32c3_template
- .rules:test:integration_test_ble
parallel: 5
tags:
- ESP32C3_IDF
- SSC_T5_BT_Simple
IT_C3_T1_BT_Dongle:
extends:
- .integration_test_esp32c3_template
- .rules:test:integration_test_ble
image: gitlab.espressif.cn:5050/qa/dockerfiles/integration-test-env-dbg:1
parallel: 2
tags:
- ESP32C3_IDF
- SSC_T1_BT_Dongle
- eth_lan8720

8
.gitmodules vendored
View File

@@ -34,12 +34,12 @@
[submodule "components/bootloader/subproject/components/micro-ecc/micro-ecc"]
path = components/bootloader/subproject/components/micro-ecc/micro-ecc
url = ../../kmackay/micro-ecc.git
sbom-version = 1.0
sbom-version = 1.1
sbom-cpe = cpe:2.3:a:micro-ecc_project:micro-ecc:{}:*:*:*:*:*:*:*
sbom-supplier = Person: Ken MacKay
sbom-url = https://github.com/kmackay/micro-ecc
sbom-description = A small and fast ECDH and ECDSA implementation for 8-bit, 32-bit, and 64-bit processors
sbom-hash = d037ec89546fad14b5c4d5456c2e23a71e554966
sbom-hash = 24c60e243580c7868f4334a1ba3123481fe1aa48
[submodule "components/coap/libcoap"]
path = components/coap/libcoap
@@ -65,12 +65,12 @@
[submodule "components/json/cJSON"]
path = components/json/cJSON
url = ../../DaveGamble/cJSON.git
sbom-version = 1.7.15
sbom-version = 1.7.17
sbom-cpe = cpe:2.3:a:cjson_project:cjson:{}:*:*:*:*:*:*:*
sbom-supplier = Person: Dave Gamble
sbom-url = https://github.com/DaveGamble/cJSON
sbom-description = Ultralightweight JSON parser in ANSI C
sbom-hash = d348621ca93571343a56862df7de4ff3bc9b5667
sbom-hash = 87d8f0961a01bf09bef98ff89bae9fdec42181ee
[submodule "components/mbedtls/mbedtls"]
path = components/mbedtls/mbedtls

View File

@@ -1,6 +1,8 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_stages: [commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
@@ -34,11 +36,12 @@ repos:
hooks:
- id: flake8
args: ['--config=.flake8', '--tee', '--benchmark']
- repo: https://github.com/pycqa/isort
rev: 5.11.5 # python 3.7 compatible
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.12.0
hooks:
- id: isort
name: isort (python)
- id: reorder-python-imports
name: Reorder Python imports
args: [--py36-plus]
exclude: >
(?x)^(
.*_pb2.py
@@ -123,3 +126,8 @@ repos:
hooks:
- id: file-contents-sorter
files: 'tools\/ci\/(executable-list\.txt|mypy_ignore_list\.txt)'
- repo: https://github.com/espressif/esp-idf-sbom.git
rev: v0.13.0
hooks:
- id: validate-sbom-manifest
stages: [post-commit]

View File

@@ -13,6 +13,10 @@ mainmenu "Espressif IoT Development Framework Configuration"
bool
option env="IDF_ENV_FPGA"
config IDF_CI_BUILD
bool
default y if "$(IDF_CI_BUILD)" = "y" || "$(IDF_CI_BUILD)" = 1
config IDF_TARGET_ARCH_RISCV
bool
default "n"

View File

@@ -181,13 +181,18 @@ esp_err_t esp_ota_write(esp_ota_handle_t handle, const void *data, size_t size)
return ESP_ERR_INVALID_ARG;
}
if (size == 0) {
ESP_LOGD(TAG, "write data size is 0");
return ESP_OK;
}
// find ota handle in linked list
for (it = LIST_FIRST(&s_ota_ops_entries_head); it != NULL; it = LIST_NEXT(it, entries)) {
if (it->handle == handle) {
if (it->need_erase) {
// must erase the partition before writing to it
uint32_t first_sector = it->wrote_size / SPI_FLASH_SEC_SIZE;
uint32_t last_sector = (it->wrote_size + size) / SPI_FLASH_SEC_SIZE;
uint32_t first_sector = it->wrote_size / SPI_FLASH_SEC_SIZE; // first affected sector
uint32_t last_sector = (it->wrote_size + size - 1) / SPI_FLASH_SEC_SIZE; // last affected sector
ret = ESP_OK;
if ((it->wrote_size % SPI_FLASH_SEC_SIZE) == 0) {
@@ -919,8 +924,8 @@ esp_err_t esp_ota_revoke_secure_boot_public_key(esp_ota_secure_boot_public_key_i
if (trusted_keys.key_digests[i] != NULL) {
bool all_zeroes = true;
for (unsigned j = 0; j < ESP_SECURE_BOOT_DIGEST_LEN; j++) {
all_zeroes = all_zeroes && (*(uint8_t *)(trusted_keys.key_digests[i] + j) == 0);
for (unsigned j = 0; j < ESP_SECURE_BOOT_DIGEST_LEN; j+=4) {
all_zeroes = all_zeroes && (*(uint32_t *)(trusted_keys.key_digests[i] + j) == 0);
}
if (!all_zeroes) {
memcpy(trusted_digests.key_digests[trusted_digests.num_digests++], (uint8_t *)trusted_keys.key_digests[i], ESP_SECURE_BOOT_DIGEST_LEN);

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -103,7 +103,7 @@ esp_err_t esp_ota_begin(const esp_partition_t* partition, size_t image_size, esp
* @param size Size of data buffer in bytes.
*
* @return
* - ESP_OK: Data was written to flash successfully.
* - ESP_OK: Data was written to flash successfully, or size = 0
* - ESP_ERR_INVALID_ARG: handle is invalid.
* - ESP_ERR_OTA_VALIDATE_FAILED: First byte of image contains invalid app image magic byte.
* - ESP_ERR_FLASH_OP_TIMEOUT or ESP_ERR_FLASH_OP_FAIL: Flash write failed.

View File

@@ -62,34 +62,66 @@ menu "Bootloader config"
default 4 if BOOTLOADER_LOG_LEVEL_DEBUG
default 5 if BOOTLOADER_LOG_LEVEL_VERBOSE
config BOOTLOADER_SPI_CUSTOM_WP_PIN
bool "Use custom SPI Flash WP Pin when flash pins set in eFuse (read help)"
depends on IDF_TARGET_ESP32 && (ESPTOOLPY_FLASHMODE_QIO || ESPTOOLPY_FLASHMODE_QOUT)
default y if BOOTLOADER_SPI_WP_PIN != 7 # backwards compatibility, can remove in IDF 5
default n
help
This setting is only used if the SPI flash pins have been overridden by setting the eFuses
SPI_PAD_CONFIG_xxx, and the SPI flash mode is QIO or QOUT.
menu "Serial Flash Configurations"
config BOOTLOADER_SPI_CUSTOM_WP_PIN
bool "Use custom SPI Flash WP Pin when flash pins set in eFuse (read help)"
depends on IDF_TARGET_ESP32 && (ESPTOOLPY_FLASHMODE_QIO || ESPTOOLPY_FLASHMODE_QOUT)
default y if BOOTLOADER_SPI_WP_PIN != 7 # backwards compatibility, can remove in IDF 5
default n
help
This setting is only used if the SPI flash pins have been overridden by setting the eFuses
SPI_PAD_CONFIG_xxx, and the SPI flash mode is QIO or QOUT.
When this is the case, the eFuse config only defines 3 of the 4 Quad I/O data pins. The WP pin (aka
ESP32 pin "SD_DATA_3" or SPI flash pin "IO2") is not specified in eFuse. The same pin is also used
for external SPIRAM if it is enabled.
When this is the case, the eFuse config only defines 3 of the 4 Quad I/O data pins. The WP pin (aka
ESP32 pin "SD_DATA_3" or SPI flash pin "IO2") is not specified in eFuse. The same pin is also used
for external SPIRAM if it is enabled.
If this config item is set to N (default), the correct WP pin will be automatically used for any
Espressif chip or module with integrated flash. If a custom setting is needed, set this config item to
Y and specify the GPIO number connected to the WP.
If this config item is set to N (default), the correct WP pin will be automatically used for any
Espressif chip or module with integrated flash. If a custom setting is needed, set this config item to
Y and specify the GPIO number connected to the WP.
config BOOTLOADER_SPI_WP_PIN
int "Custom SPI Flash WP Pin"
range 0 33
default 7
depends on IDF_TARGET_ESP32 && (ESPTOOLPY_FLASHMODE_QIO || ESPTOOLPY_FLASHMODE_QOUT)
#depends on BOOTLOADER_SPI_CUSTOM_WP_PIN # backwards compatibility, can uncomment in IDF 5
help
The option "Use custom SPI Flash WP Pin" must be set or this value is ignored
config BOOTLOADER_SPI_WP_PIN
int "Custom SPI Flash WP Pin"
range 0 33
default 7
depends on IDF_TARGET_ESP32 && (ESPTOOLPY_FLASHMODE_QIO || ESPTOOLPY_FLASHMODE_QOUT)
#depends on BOOTLOADER_SPI_CUSTOM_WP_PIN # backwards compatibility, can uncomment in IDF 5
help
The option "Use custom SPI Flash WP Pin" must be set or this value is ignored
If burning a customized set of SPI flash pins in eFuse and using QIO or QOUT mode for flash, set this
value to the GPIO number of the SPI flash WP pin.
If burning a customized set of SPI flash pins in eFuse and using QIO or QOUT mode for flash, set this
value to the GPIO number of the SPI flash WP pin.
config BOOTLOADER_FLASH_DC_AWARE
bool "Allow app adjust Dummy Cycle bits in SPI Flash for higher frequency (READ HELP FIRST)"
help
This will force 2nd bootloader to be loaded by DOUT mode, and will restore Dummy Cycle setting by
resetting the Flash
config BOOTLOADER_FLASH_XMC_SUPPORT
bool "Enable the support for flash chips of XMC (READ DOCS FIRST)"
default y
help
Perform the startup flow recommended by XMC. Please consult XMC for the details of this flow.
XMC chips will be forbidden to be used, when this option is disabled.
DON'T DISABLE THIS UNLESS YOU KNOW WHAT YOU ARE DOING.
comment "Features below require specific hardware (READ DOCS FIRST!)"
config BOOTLOADER_FLASH_32BIT_ADDR
bool
default y if ESPTOOLPY_FLASHSIZE_32MB || ESPTOOLPY_FLASHSIZE_64MB || ESPTOOLPY_FLASHSIZE_128MB
default n
help
This is a helper config for 32bits address flash. Invisible for users.
config BOOTLOADER_CACHE_32BIT_ADDR_OCTAL_FLASH
bool
default y if ESPTOOLPY_OCT_FLASH && BOOTLOADER_FLASH_32BIT_ADDR
default n
endmenu
choice BOOTLOADER_VDDSDIO_BOOST
bool "VDDSDIO LDO voltage"
@@ -393,14 +425,6 @@ menu "Bootloader config"
in this area of memory, you can increase it. It must be a multiple of 4 bytes.
This area (rtc_retain_mem_t) is reserved and has access from the bootloader and an application.
config BOOTLOADER_FLASH_XMC_SUPPORT
bool "Enable the support for flash chips of XMC (READ HELP FIRST)"
default y
help
Perform the startup flow recommended by XMC. Please consult XMC for the details of this flow.
XMC chips will be forbidden to be used, when this option is disabled.
DON'T DISABLE THIS UNLESS YOU KNOW WHAT YOU ARE DOING.
endmenu # Bootloader

View File

@@ -23,3 +23,5 @@ CONFIG_FLASH_ENCRYPTION_UART_BOOTLOADER_ALLOW_CACHE CONFIG_SECURE_FLASH_
# Secure Boot Scheme
CONFIG_SECURE_BOOT_ENABLED CONFIG_SECURE_BOOT_V1_ENABLED
CONFIG_SPI_FLASH_OCTAL_32BIT_ADDR_ENABLE CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_OCTAL_FLASH

View File

@@ -9,6 +9,17 @@
#include <esp_spi_flash.h> /* including in bootloader for error values */
#include "sdkconfig.h"
#include "soc/soc_caps.h"
#if CONFIG_IDF_TARGET_ESP32
#include "esp32/rom/spi_flash.h"
#elif CONFIG_IDF_TARGET_ESP32S2
#include "esp32s2/rom/spi_flash.h"
#elif CONFIG_IDF_TARGET_ESP32S3
#include "esp32s3/rom/spi_flash.h"
#elif CONFIG_IDF_TARGET_ESP32C3
#include "esp32c3/rom/spi_flash.h"
#elif CONFIG_IDF_TARGET_ESP32H2
#include "esp32h2/rom/spi_flash.h"
#endif
#include "bootloader_flash_override.h"
#ifdef __cplusplus
@@ -48,6 +59,12 @@ esp_err_t bootloader_flash_xmc_startup(void);
*/
esp_err_t IRAM_ATTR __attribute__((weak)) bootloader_flash_unlock(void);
/**
* @brief Get the spi flash working mode.
*
* @return The mode of flash working mode, see `esp_rom_spiflash_read_mode_t`
*/
esp_rom_spiflash_read_mode_t bootloader_flash_get_spi_mode(void);
#ifdef __cplusplus
}

View File

@@ -96,6 +96,18 @@ extern const bootloader_qio_info_t __attribute__((weak)) bootloader_flash_qe_sup
*/
esp_err_t IRAM_ATTR __attribute__((weak)) bootloader_flash_unlock(void);
#if CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_OCTAL_FLASH
/**
* @brief Enable 32bits address flash(larger than 16MB) can map to cache.
*
* @param flash_mode SPI flash working mode.
*
* @note This can be overridden because it's attribute weak.
*/
void __attribute__((weak)) bootloader_flash_32bits_address_map_enable(esp_rom_spiflash_read_mode_t flash_mode);
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -130,4 +130,5 @@ typedef struct {
/** @cond */
_Static_assert(sizeof(esp_app_desc_t) == 256, "esp_app_desc_t should be 256 bytes");
_Static_assert(offsetof(esp_app_desc_t, secure_version) == 4, "secure_version field must be at 4 offset");
/** @endcond */

View File

@@ -33,6 +33,7 @@ typedef struct {
uint32_t segment_data[ESP_IMAGE_MAX_SEGMENTS]; /* Data offsets for each segment */
uint32_t image_len; /* Length of image on flash, in bytes */
uint8_t image_digest[32]; /* appended SHA-256 digest */
uint32_t secure_version; /* secure version for anti-rollback, it is covered by sha256 (set if CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK=y) */
} esp_image_metadata_t;
typedef enum {

View File

@@ -35,6 +35,8 @@
#define CMD_RDSFDP 0x5A /* Read the SFDP of the flash */
#define CMD_WRAP 0x77 /* Set burst with wrap command */
#define CMD_RESUME 0x7A /* Resume command to clear flash suspend bit */
#define CMD_FASTRD_4B 0x0C
#define CMD_SLOWRD_4B 0x13
/* Provide a Flash API for bootloader_support code,

View File

@@ -26,6 +26,9 @@
#include "esp32h2/rom/ets_sys.h"
#include "esp32h2/rom/uart.h"
#endif
#if SOC_USB_SERIAL_JTAG_SUPPORTED
#include "hal/usb_phy_ll.h"
#endif
#include "esp_rom_gpio.h"
#include "esp_rom_uart.h"
#include "esp_rom_sys.h"
@@ -104,6 +107,10 @@ void bootloader_console_init(void)
esp_rom_uart_usb_acm_init(s_usb_cdc_buf, sizeof(s_usb_cdc_buf));
esp_rom_uart_set_as_console(ESP_ROM_UART_USB);
esp_rom_install_channel_putc(1, bootloader_console_write_char_usb);
#if SOC_USB_SERIAL_JTAG_SUPPORTED
usb_phy_ll_usb_wrap_pad_enable(&USB_WRAP, true);
usb_phy_ll_int_otg_enable(&USB_WRAP);
#endif
}
#endif //CONFIG_ESP_CONSOLE_USB_CDC

View File

@@ -145,6 +145,11 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
#include "esp32h2/rom/cache.h"
#include "soc/cache_memory.h"
#endif
#if CONFIG_IDF_TARGET_ESP32S3
#include "esp32s3/rom/opi_flash.h"
#endif
static const char *TAG = "bootloader_flash";
#if CONFIG_IDF_TARGET_ESP32
@@ -482,6 +487,34 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
return spi_to_esp_err(rc);
}
#if CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_OCTAL_FLASH
void bootloader_flash_32bits_address_map_enable(esp_rom_spiflash_read_mode_t flash_mode)
{
esp_rom_opiflash_spi0rd_t cache_rd = {};
switch (flash_mode) {
case ESP_ROM_SPIFLASH_FASTRD_MODE:
cache_rd.addr_bit_len = 32;
cache_rd.dummy_bit_len = 8;
cache_rd.cmd = CMD_FASTRD_4B;
cache_rd.cmd_bit_len = 8;
break;
case ESP_ROM_SPIFLASH_SLOWRD_MODE:
cache_rd.addr_bit_len = 32;
cache_rd.dummy_bit_len = 0;
cache_rd.cmd = CMD_SLOWRD_4B;
cache_rd.cmd_bit_len = 8;
break;
default:
assert(false);
break;
}
uint32_t autoload = Cache_Suspend_DCache();
esp_rom_opiflash_cache_mode_config(flash_mode, &cache_rd);
Cache_Resume_DCache(autoload);
}
#endif
#endif // BOOTLOADER_BUILD
@@ -816,3 +849,40 @@ esp_err_t IRAM_ATTR bootloader_flash_xmc_startup(void)
}
#endif //XMC_SUPPORT
esp_rom_spiflash_read_mode_t bootloader_flash_get_spi_mode(void)
{
esp_rom_spiflash_read_mode_t spi_mode = ESP_ROM_SPIFLASH_FASTRD_MODE;
#if CONFIG_IDF_TARGET_ESP32
uint32_t spi_ctrl = REG_READ(SPI_CTRL_REG(0));
if (spi_ctrl & SPI_FREAD_QIO) {
spi_mode = ESP_ROM_SPIFLASH_QIO_MODE;
} else if (spi_ctrl & SPI_FREAD_QUAD) {
spi_mode = ESP_ROM_SPIFLASH_QOUT_MODE;
} else if (spi_ctrl & SPI_FREAD_DIO) {
spi_mode = ESP_ROM_SPIFLASH_DIO_MODE;
} else if (spi_ctrl & SPI_FREAD_DUAL) {
spi_mode = ESP_ROM_SPIFLASH_DOUT_MODE;
} else if (spi_ctrl & SPI_FASTRD_MODE) {
spi_mode = ESP_ROM_SPIFLASH_FASTRD_MODE;
} else {
spi_mode = ESP_ROM_SPIFLASH_SLOWRD_MODE;
}
#else
uint32_t spi_ctrl = REG_READ(SPI_MEM_CTRL_REG(0));
if (spi_ctrl & SPI_MEM_FREAD_QIO) {
spi_mode = ESP_ROM_SPIFLASH_QIO_MODE;
} else if (spi_ctrl & SPI_MEM_FREAD_QUAD) {
spi_mode = ESP_ROM_SPIFLASH_QOUT_MODE;
} else if (spi_ctrl & SPI_MEM_FREAD_DIO) {
spi_mode = ESP_ROM_SPIFLASH_DIO_MODE;
} else if (spi_ctrl & SPI_MEM_FREAD_DUAL) {
spi_mode = ESP_ROM_SPIFLASH_DOUT_MODE;
} else if (spi_ctrl & SPI_MEM_FASTRD_MODE) {
spi_mode = ESP_ROM_SPIFLASH_FASTRD_MODE;
} else {
spi_mode = ESP_ROM_SPIFLASH_SLOWRD_MODE;
}
#endif
return spi_mode;
}

View File

@@ -218,7 +218,7 @@ static esp_err_t bootloader_init_spi_flash(void)
}
#endif
#if CONFIG_SPI_FLASH_HPM_ENABLE
#if CONFIG_BOOTLOADER_FLASH_DC_AWARE
// Reset flash, clear volatile bits DC[0:1]. Make it work under default mode to boot.
bootloader_spi_flash_reset();
#endif
@@ -228,7 +228,9 @@ static esp_err_t bootloader_init_spi_flash(void)
#if CONFIG_ESPTOOLPY_FLASHMODE_QIO || CONFIG_ESPTOOLPY_FLASHMODE_QOUT
bootloader_enable_qio_mode();
#endif
#if CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_OCTAL_FLASH
bootloader_flash_32bits_address_map_enable(bootloader_flash_get_spi_mode());
#endif
print_flash_info(&bootloader_image_hdr);
update_flash_config(&bootloader_image_hdr);
//ensure the flash is write-protected

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
*/
@@ -17,6 +17,7 @@
#include <bootloader_sha.h>
#include "bootloader_util.h"
#include "bootloader_common.h"
#include "esp_efuse.h"
#include "esp_rom_sys.h"
#include "soc/soc_memory_types.h"
#if CONFIG_IDF_TARGET_ESP32
@@ -76,10 +77,10 @@ static bool should_map(uint32_t load_addr);
static esp_err_t process_segments(esp_image_metadata_t *data, bool silent, bool do_load, bootloader_sha256_handle_t sha_handle, uint32_t *checksum);
/* Load or verify a segment */
static esp_err_t process_segment(int index, uint32_t flash_addr, esp_image_segment_header_t *header, bool silent, bool do_load, bootloader_sha256_handle_t sha_handle, uint32_t *checksum);
static esp_err_t process_segment(int index, uint32_t flash_addr, esp_image_segment_header_t *header, bool silent, bool do_load, bootloader_sha256_handle_t sha_handle, uint32_t *checksum, esp_image_metadata_t *metadata);
/* split segment and verify if data_len is too long */
static esp_err_t process_segment_data(intptr_t load_addr, uint32_t data_addr, uint32_t data_len, bool do_load, bootloader_sha256_handle_t sha_handle, uint32_t *checksum);
static esp_err_t process_segment_data(int segment, intptr_t load_addr, uint32_t data_addr, uint32_t data_len, bool do_load, bootloader_sha256_handle_t sha_handle, uint32_t *checksum, esp_image_metadata_t *metadata);
/* Verify the main image header */
static esp_err_t verify_image_header(uint32_t src_addr, const esp_image_header_t *image, bool silent);
@@ -222,6 +223,21 @@ static esp_err_t image_load(esp_image_load_mode_t mode, const esp_partition_pos_
}
}
}
#if CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK
/* For anti-rollback case, reconfirm security version of the application to prevent FI attacks */
bool sec_ver = false;
if (do_load) {
sec_ver = esp_efuse_check_secure_version(data->secure_version);
if (!sec_ver) {
err = ESP_FAIL;
goto err;
}
}
/* Ensure that the security version check passes for image loading scenario */
ESP_FAULT_ASSERT(!do_load || sec_ver == true);
#endif // CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK
#endif // BOOTLOADER_BUILD
// Success!
@@ -488,8 +504,8 @@ static esp_err_t process_segments(esp_image_metadata_t *data, bool silent, bool
uint32_t next_addr = start_segments;
for (int i = 0; i < data->image.segment_count; i++) {
esp_image_segment_header_t *header = &data->segments[i];
ESP_LOGV(TAG, "loading segment header %d at offset 0x%x", i, next_addr);
CHECK_ERR(process_segment(i, next_addr, header, silent, do_load, sha_handle, checksum));
ESP_LOGV(TAG, "loading segment header %d at offset 0x%"PRIx32, i, next_addr);
CHECK_ERR(process_segment(i, next_addr, header, silent, do_load, sha_handle, checksum, data));
next_addr += sizeof(esp_image_segment_header_t);
data->segment_data[i] = next_addr;
next_addr += header->data_len;
@@ -510,7 +526,7 @@ err:
return err;
}
static esp_err_t process_segment(int index, uint32_t flash_addr, esp_image_segment_header_t *header, bool silent, bool do_load, bootloader_sha256_handle_t sha_handle, uint32_t *checksum)
static esp_err_t process_segment(int index, uint32_t flash_addr, esp_image_segment_header_t *header, bool silent, bool do_load, bootloader_sha256_handle_t sha_handle, uint32_t *checksum, esp_image_metadata_t *metadata)
{
esp_err_t err;
@@ -568,7 +584,7 @@ static esp_err_t process_segment(int index, uint32_t flash_addr, esp_image_segme
uint32_t offset_page = ((data_addr & MMAP_ALIGNED_MASK) != 0) ? 1 : 0;
/* Data we could map in case we are not aligned to PAGE boundary is one page size lesser. */
data_len = MIN(data_len_remain, ((free_page_count - offset_page) * SPI_FLASH_MMU_PAGE_SIZE));
CHECK_ERR(process_segment_data(load_addr, data_addr, data_len, do_load, sha_handle, checksum));
CHECK_ERR(process_segment_data(index, load_addr, data_addr, data_len, do_load, sha_handle, checksum, metadata));
data_addr += data_len;
data_len_remain -= data_len;
}
@@ -583,7 +599,42 @@ err:
return err;
}
static esp_err_t process_segment_data(intptr_t load_addr, uint32_t data_addr, uint32_t data_len, bool do_load, bootloader_sha256_handle_t sha_handle, uint32_t *checksum)
#if CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK
/* The __attribute__((optimize("O0"))) is used to disable optimizations for this function,
* preventing the compiler from potentially optimizing data_buffer and reading data directly from src.
* This is crucial as we want to read from Flash only once, ensuring the integrity of the data.
*/
__attribute__((optimize("O0")))
static size_t process_esp_app_desc_data(const uint32_t *src, bootloader_sha256_handle_t sha_handle, uint32_t *checksum, esp_image_metadata_t *metadata)
{
/* Using data_buffer here helps to securely read secure_version
* (for anti-rollback) from esp_app_desc_t, preventing FI attack.
* We read data from Flash into this buffer, which is covered by sha256.
* Therefore, if the flash is under attackers control and contents are modified
* the sha256 comparison will fail.
*
* The esp_app_desc_t structure is located in DROM and is always in segment #0.
*
* esp_app_desc_t is always at #0 segment (index==0).
* secure_version field of esp_app_desc_t is located at #2 word (w_i==1).
*/
uint32_t data_buffer[2];
memcpy(data_buffer, src, sizeof(data_buffer));
assert(data_buffer[0] == ESP_APP_DESC_MAGIC_WORD);
metadata->secure_version = data_buffer[1];
if (checksum != NULL) {
*checksum ^= data_buffer[0] ^ data_buffer[1];
}
if (sha_handle != NULL) {
bootloader_sha256_data(sha_handle, data_buffer, sizeof(data_buffer));
}
ESP_FAULT_ASSERT(memcmp(data_buffer, src, sizeof(data_buffer)) == 0);
ESP_FAULT_ASSERT(memcmp(&metadata->secure_version, &src[1], sizeof(uint32_t)) == 0);
return sizeof(data_buffer);
}
#endif // CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK
static esp_err_t process_segment_data(int segment, intptr_t load_addr, uint32_t data_addr, uint32_t data_len, bool do_load, bootloader_sha256_handle_t sha_handle, uint32_t *checksum, esp_image_metadata_t *metadata)
{
// If we are not loading, and the checksum is empty, skip processing this
// segment for data
@@ -616,10 +667,24 @@ static esp_err_t process_segment_data(intptr_t load_addr, uint32_t data_addr, ui
#endif
}
uint32_t *dest = (uint32_t *)load_addr;
#endif
#endif // BOOTLOADER_BUILD
const uint32_t *src = data;
#if CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK
// Case I: Bootloader verifying application
// Case II: Bootloader verifying bootloader
// Anti-rollback check should handle only Case I from above.
if (segment == 0 && metadata->start_addr != ESP_BOOTLOADER_OFFSET) {
ESP_LOGD(TAG, "additional anti-rollback check 0x%"PRIx32, data_addr);
// The esp_app_desc_t structure is located in DROM and is always in segment #0.
size_t len = process_esp_app_desc_data(src, sha_handle, checksum, metadata);
data_len -= len;
src += len / 4;
// In BOOTLOADER_BUILD, for DROM (segment #0) we do not load it into dest (only map it), do_load = false.
}
#endif // CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK
for (size_t i = 0; i < data_len; i += 4) {
int w_i = i / 4; // Word index
uint32_t w = src[w_i];

View File

@@ -262,6 +262,32 @@ bool config_remove_section(config_t *config, const char *section)
return list_remove(config->sections, sec);
}
bool config_update_newest_section(config_t *config, const char *section)
{
assert(config != NULL);
assert(section != NULL);
list_node_t *first_node = list_begin(config->sections);
if (first_node == NULL) {
return false;
}
section_t *first_sec = list_node(first_node);
if (strcmp(first_sec->name, section) == 0) {
return true;
}
for (const list_node_t *node = list_begin(config->sections); node != list_end(config->sections); node = list_next(node)) {
section_t *sec = list_node(node);
if (strcmp(sec->name, section) == 0) {
list_delete(config->sections, sec);
list_prepend(config->sections, sec);
return true;
}
}
return false;
}
bool config_remove_key(config_t *config, const char *section, const char *key)
{
assert(config != NULL);

View File

@@ -107,6 +107,11 @@ void config_set_string(config_t *config, const char *section, const char *key, c
// Neither |config| nor |section| may be NULL.
bool config_remove_section(config_t *config, const char *section);
// Updates |section| to be the first section in |config|. Return true if |section| is in
// |config| and updated successfully, false otherwise.
// Neither |config| nor |section| may be NULL.
bool config_update_newest_section(config_t *config, const char *section);
// Removes one specific |key| residing in |section| of the |config|. Returns true
// if the section and key were found and the key was removed, false otherwise.
// None of |config|, |section|, or |key| may be NULL.

View File

@@ -205,6 +205,11 @@ menu "HCI UART(H4) Options"
help
UART Baudrate for HCI. Please use standard baudrate.
config BTDM_CTRL_HCI_UART_FLOW_CTRL_EN
bool "Enable UART flow control"
depends on BTDM_CTRL_HCI_MODE_UART_H4
default y
endmenu
menu "MODEM SLEEP Options"
@@ -351,7 +356,7 @@ config BTDM_SCAN_DUPL_CACHE_SIZE
default 100
help
Maximum number of devices which can be recorded in scan duplicate filter.
When the maximum amount of device in the filter is reached, the cache will be refreshed.
When the maximum amount of device in the filter is reached, the oldest device will be refreshed.
config BTDM_SCAN_DUPL_CACHE_REFRESH_PERIOD
int "Duplicate scan list refresh period (seconds)"

View File

@@ -234,6 +234,8 @@ extern int coex_wifi_channel_get(uint8_t *primary, uint8_t *secondary);
extern int coex_register_wifi_channel_change_callback(void *cb);
/* Shutdown */
extern void esp_bt_controller_shutdown(void);
extern void sdk_config_set_bt_pll_track_enable(bool enable);
extern void sdk_config_set_uart_flow_ctrl_enable(bool enable);
extern char _bss_start_btdm;
extern char _bss_end_btdm;
@@ -1570,6 +1572,12 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
btdm_controller_set_sleep_mode(BTDM_MODEM_SLEEP_MODE_NONE);
#endif
#if CONFIG_BTDM_CTRL_HCI_UART_FLOW_CTRL_EN
sdk_config_set_uart_flow_ctrl_enable(true);
#else
sdk_config_set_uart_flow_ctrl_enable(false);
#endif
#ifdef CONFIG_PM_ENABLE
if (!s_btdm_allow_light_sleep) {
if ((err = esp_pm_lock_create(ESP_PM_NO_LIGHT_SLEEP, 0, "btLS", &s_light_sleep_pm_lock)) != ESP_OK) {
@@ -1721,6 +1729,8 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
btdm_controller_enable_sleep(true);
}
sdk_config_set_bt_pll_track_enable(true);
// inititalize bluetooth baseband
btdm_check_and_init_bb();

View File

@@ -279,20 +279,19 @@ choice BT_CTRL_SCAN_DUPL_TYPE
config BT_CTRL_SCAN_DUPL_TYPE_DEVICE
bool "Scan Duplicate By Device Address"
help
This way is to use advertiser address filtering. The adv packet of the same address is only
allowed to be reported once
Advertising packets with the same address, address type, and advertising type are reported once.
config BT_CTRL_SCAN_DUPL_TYPE_DATA
bool "Scan Duplicate By Advertising Data"
help
This way is to use advertising data filtering. All same advertising data only allow to be reported
once even though they are from different devices.
Advertising packets with identical advertising data, address type, and advertising type
are reported only once, even if they originate from different devices.
config BT_CTRL_SCAN_DUPL_TYPE_DATA_DEVICE
bool "Scan Duplicate By Device Address And Advertising Data"
help
This way is to use advertising data and device address filtering. All different adv packets with
the same address are allowed to be reported.
Advertising packets with the same address, advertising data, address type,
and advertising type are reported only once.
endchoice
config BT_CTRL_SCAN_DUPL_TYPE
@@ -468,3 +467,11 @@ config BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
Disable active scan backoff. The bluetooth spec requires that scanners should run a backoff procedure to
minimize collision of scan request PDUs from nultiple scanners. If scan backoff is disabled, in active
scanning, scan request PDU will be sent every time when HW receives scannable ADV PDU.
config BT_BLE_ADV_DATA_LENGTH_ZERO_AUX
bool "Enable aux packet when ext adv data length is zero"
default n
help
When this option is enabled, auxiliary packets will be present in the events of
'Non-Connectable and Non-Scannable' regardless of whether the advertising length is 0.
If this option is not enabled, auxiliary packets will only be present when the advertising length is not 0.

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
*/
@@ -694,7 +694,7 @@ static bool IRAM_ATTR is_in_isr_wrapper(void)
static void *malloc_internal_wrapper(size_t size)
{
void *p = heap_caps_malloc(size, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL|MALLOC_CAP_DMA);
void *p = heap_caps_malloc(size, MALLOC_CAP_INTERNAL|MALLOC_CAP_DMA);
if(p == NULL) {
ESP_LOGE(BT_LOG_TAG, "Malloc failed");
}
@@ -763,19 +763,26 @@ static void btdm_sleep_enter_phase1_wrapper(uint32_t lpcycles)
return;
}
// start a timer to wake up and acquire the pm_lock before modem_sleep awakes
uint32_t us_to_sleep = btdm_lpcycles_2_hus(lpcycles, NULL) >> 1;
#define BTDM_MIN_TIMER_UNCERTAINTY_US (1800)
#define BTDM_RTC_SLOW_CLK_RC_DRIFT_PERCENT 7
assert(us_to_sleep > BTDM_MIN_TIMER_UNCERTAINTY_US);
// allow a maximum time uncertainty to be about 488ppm(1/2048) at least as clock drift
// and set the timer in advance
uint32_t uncertainty = (us_to_sleep >> 11);
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
if (rtc_clk_slow_freq_get() == RTC_SLOW_FREQ_RTC) {
uncertainty = us_to_sleep * BTDM_RTC_SLOW_CLK_RC_DRIFT_PERCENT / 100;
}
#endif
if (uncertainty < BTDM_MIN_TIMER_UNCERTAINTY_US) {
uncertainty = BTDM_MIN_TIMER_UNCERTAINTY_US;
}
assert (s_lp_stat.wakeup_timer_started == 0);
// start a timer to wake up and acquire the pm_lock before modem_sleep awakes
if (esp_timer_start_once(s_btdm_slp_tmr, us_to_sleep - uncertainty) == ESP_OK) {
s_lp_stat.wakeup_timer_started = 1;
} else {
@@ -794,12 +801,12 @@ static void btdm_sleep_enter_phase2_wrapper(void)
assert(0);
}
if (s_lp_stat.pm_lock_released == 0) {
#ifdef CONFIG_PM_ENABLE
if (s_lp_stat.pm_lock_released == 0) {
esp_pm_lock_release(s_pm_lock);
#endif
s_lp_stat.pm_lock_released = 1;
}
#endif
}
}
@@ -1195,18 +1202,6 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
btdm_controller_mem_init();
#if CONFIG_MAC_BB_PD
if (esp_register_mac_bb_pd_callback(btdm_mac_bb_power_down_cb) != 0) {
err = ESP_ERR_INVALID_ARG;
goto error;
}
if (esp_register_mac_bb_pu_callback(btdm_mac_bb_power_up_cb) != 0) {
err = ESP_ERR_INVALID_ARG;
goto error;
}
#endif
osi_funcs_p = (struct osi_funcs_t *)malloc_internal_wrapper(sizeof(struct osi_funcs_t));
if (osi_funcs_p == NULL) {
return ESP_ERR_NO_MEM;
@@ -1447,11 +1442,6 @@ static void bt_controller_deinit_internal(void)
btdm_lpcycle_us = 0;
} while (0);
#if CONFIG_MAC_BB_PD
esp_unregister_mac_bb_pd_callback(btdm_mac_bb_power_down_cb);
esp_unregister_mac_bb_pu_callback(btdm_mac_bb_power_up_cb);
#endif
esp_bt_power_domain_off();
#if CONFIG_MAC_BB_PD
esp_mac_bb_pd_mem_deinit();
@@ -1500,6 +1490,18 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
s_lp_stat.pm_lock_released = 0;
#endif
#if CONFIG_MAC_BB_PD
if (esp_register_mac_bb_pd_callback(btdm_mac_bb_power_down_cb) != 0) {
ret = ESP_ERR_INVALID_ARG;
goto error;
}
if (esp_register_mac_bb_pu_callback(btdm_mac_bb_power_up_cb) != 0) {
ret = ESP_ERR_INVALID_ARG;
goto error;
}
#endif
if (s_lp_cntl.enable) {
btdm_controller_enable_sleep(true);
}
@@ -1519,6 +1521,11 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
error:
// disable low power mode
do {
#if CONFIG_MAC_BB_PD
esp_unregister_mac_bb_pd_callback(btdm_mac_bb_power_down_cb);
esp_unregister_mac_bb_pu_callback(btdm_mac_bb_power_up_cb);
#endif
btdm_controller_enable_sleep(false);
#ifdef CONFIG_PM_ENABLE
if (s_lp_cntl.no_light_sleep) {
@@ -1565,6 +1572,11 @@ esp_err_t esp_bt_controller_disable(void)
// disable low power mode
do {
#if CONFIG_MAC_BB_PD
esp_unregister_mac_bb_pd_callback(btdm_mac_bb_power_down_cb);
esp_unregister_mac_bb_pu_callback(btdm_mac_bb_power_up_cb);
#endif
#ifdef CONFIG_PM_ENABLE
if (s_lp_cntl.no_light_sleep) {
esp_pm_lock_release(s_light_sleep_pm_lock);

View File

@@ -6,6 +6,15 @@ if BLE_MESH
help
It is a temporary solution and needs further modifications.
config BLE_MESH_RANDOM_ADV_INTERVAL
bool "Support using random adv interval for mesh packets"
select BT_BLE_HIGH_DUTY_ADV_INTERVAL if BT_BLUEDROID_ENABLED
default n
help
Enable this option to allow using random advertising interval
for mesh packets. And this could help avoid collision of
advertising packets.
config BLE_MESH_USE_DUPLICATE_SCAN
bool "Support Duplicate Scan in BLE Mesh"
depends on BT_BLUEDROID_ENABLED
@@ -536,6 +545,20 @@ if BLE_MESH
Provisioner can provision up to 20 nodes and each node contains two elements,
then the replay protection list size of Provisioner should be at least 40.
config BLE_MESH_NOT_RELAY_REPLAY_MSG
bool "Not relay replayed messages in a mesh network"
depends on BLE_MESH_EXPERIMENTAL
default n
help
There may be many expired messages in a complex mesh network that would be
considered replayed messages.
Enable this option will refuse to relay such messages, which could help to
reduce invalid packets in the mesh network.
However, it should be noted that enabling this option may result in packet
loss in certain environments.
Therefore, users need to decide whether to enable this option according to
the actual usage situation.
config BLE_MESH_MSG_CACHE_SIZE
int "Network message cache size"
default 10
@@ -1239,4 +1262,12 @@ if BLE_MESH
endmenu
config BLE_MESH_EXPERIMENTAL
bool "Make BLE Mesh experimental features visible"
default n
help
Make BLE Mesh Experimental features visible.
Experimental features list:
- CONFIG_BLE_MESH_NOT_RELAY_REPLAY_MSG
endif # BLE_MESH

View File

@@ -65,7 +65,9 @@ esp_err_t esp_ble_mesh_init(esp_ble_mesh_prov_t *prov, esp_ble_mesh_comp_t *comp
esp_err_t esp_ble_mesh_deinit(esp_ble_mesh_deinit_param_t *param)
{
btc_ble_mesh_prov_args_t arg = {0};
SemaphoreHandle_t semaphore = NULL;
btc_msg_t msg = {0};
esp_err_t ret = ESP_OK;
if (param == NULL) {
return ESP_ERR_INVALID_ARG;
@@ -73,13 +75,36 @@ esp_err_t esp_ble_mesh_deinit(esp_ble_mesh_deinit_param_t *param)
ESP_BLE_HOST_STATUS_CHECK(ESP_BLE_HOST_STATUS_ENABLED);
// Create a semaphore
if ((semaphore = xSemaphoreCreateCounting(1, 0)) == NULL) {
BT_ERR("Failed to create semaphore");
return ESP_ERR_NO_MEM;
}
arg.mesh_deinit.param.erase_flash = param->erase_flash;
/* Transport semaphore pointer to BTC layer, and will give the semaphore in the BTC task */
arg.mesh_deinit.semaphore = semaphore;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_DEINIT_MESH;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
if (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL) != BT_STATUS_SUCCESS) {
vSemaphoreDelete(semaphore);
BT_ERR("Failed to start mesh deinit");
return ESP_FAIL;
}
/* Take the Semaphore, wait BLE Mesh de-initialization to finish. */
xSemaphoreTake(semaphore, portMAX_DELAY);
/* Don't forget to delete the semaphore at the end. */
vSemaphoreDelete(semaphore);
ret = bt_mesh_host_deinit();
if (ret != ESP_OK) {
return ret;
}
return ESP_OK;
}
#endif /* CONFIG_BLE_MESH_DEINIT */

View File

@@ -2268,6 +2268,8 @@ void btc_ble_mesh_prov_call_handler(btc_msg_t *msg)
case BTC_BLE_MESH_ACT_DEINIT_MESH:
act = ESP_BLE_MESH_DEINIT_MESH_COMP_EVT;
param.deinit_mesh_comp.err_code = bt_mesh_deinit((struct bt_mesh_deinit_param *)&arg->mesh_deinit.param);
/* Give the semaphore when BLE Mesh de-initialization is finished. */
xSemaphoreGive(arg->mesh_deinit.semaphore);
break;
#endif /* CONFIG_BLE_MESH_DEINIT */
default:

View File

@@ -309,6 +309,7 @@ typedef union {
} model_unsub_group_addr;
struct ble_mesh_deinit_args {
esp_ble_mesh_deinit_param_t param;
SemaphoreHandle_t semaphore;
} mesh_deinit;
} btc_ble_mesh_prov_args_t;

View File

@@ -45,6 +45,8 @@ void btc_ble_mesh_time_scene_client_cb_handler(btc_msg_t *msg);
void btc_ble_mesh_time_scene_client_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
void btc_ble_mesh_time_scene_client_arg_deep_free(btc_msg_t *msg);
void btc_ble_mesh_time_scene_client_publish_callback(uint32_t opcode, struct bt_mesh_model *model,
struct bt_mesh_msg_ctx *ctx,
struct net_buf_simple *buf);

View File

@@ -67,6 +67,8 @@ uint8_t bt_mesh_get_device_role(struct bt_mesh_model *model, bool srv_send);
int bt_mesh_rand(void *buf, size_t len);
uint32_t bt_mesh_get_rand(void);
#ifdef __cplusplus
}
#endif

View File

@@ -104,3 +104,8 @@ int bt_mesh_rand(void *buf, size_t len)
return 0;
}
uint32_t bt_mesh_get_rand(void)
{
return esp_random();
}

View File

@@ -99,6 +99,11 @@ int bt_mesh_host_init(void)
return 0;
}
int bt_mesh_host_deinit(void)
{
return 0;
}
void bt_mesh_hci_init(void)
{
const uint8_t *features = controller_get_interface()->get_features_ble()->as_array;
@@ -316,6 +321,7 @@ int bt_le_adv_start(const struct bt_mesh_adv_param *param,
tBLE_ADDR_TYPE addr_type_own = 0U;
tBLE_BD_ADDR p_dir_bda = {0};
tBTM_BLE_AFP adv_fil_pol = 0U;
uint16_t interval = 0U;
uint8_t adv_type = 0U;
int err = 0;
@@ -365,9 +371,24 @@ int bt_le_adv_start(const struct bt_mesh_adv_param *param,
adv_fil_pol = BLE_MESH_AP_SCAN_CONN_ALL;
p_start_adv_cb = start_adv_completed_cb;
interval = param->interval_min;
#if CONFIG_BLE_MESH_RANDOM_ADV_INTERVAL
/* If non-connectable mesh packets are transmitted with an adv interval
* not smaller than 10ms, then we will use a random adv interval between
* [interval / 2, interval] for them.
*/
if (adv_type == BLE_MESH_ADV_NONCONN_IND && interval >= 16) {
interval >>= 1;
interval += (bt_mesh_get_rand() % (interval + 1));
BT_INFO("%u->%u", param->interval_min, interval);
}
#endif
/* Check if we can start adv using BTM_BleSetAdvParamsStartAdvCheck */
BLE_MESH_BTM_CHECK_STATUS(
BTM_BleSetAdvParamsAll(param->interval_min, param->interval_max, adv_type,
BTM_BleSetAdvParamsAll(interval, interval, adv_type,
addr_type_own, &p_dir_bda,
channel_map, adv_fil_pol, p_start_adv_cb));
BLE_MESH_BTM_CHECK_STATUS(BTM_BleStartAdv());

View File

@@ -659,6 +659,7 @@ struct bt_mesh_gatt_attr {
}
int bt_mesh_host_init(void);
int bt_mesh_host_deinit(void);
int bt_le_adv_start(const struct bt_mesh_adv_param *param,
const struct bt_mesh_adv_data *ad, size_t ad_len,

View File

@@ -2,7 +2,7 @@
/*
* SPDX-FileCopyrightText: 2017 Intel Corporation
* SPDX-FileContributor: 2018-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2018-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -1265,7 +1265,7 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
#endif
if (!buf) {
BT_ERR("Out of relay buffers");
BT_INFO("Out of relay buffers");
return;
}
@@ -1509,7 +1509,11 @@ void bt_mesh_net_recv(struct net_buf_simple *data, int8_t rssi,
* was neither a local element nor an LPN we're Friends for.
*/
if (!BLE_MESH_ADDR_IS_UNICAST(rx.ctx.recv_dst) ||
(!rx.local_match && !rx.friend_match)) {
(!rx.local_match && !rx.friend_match
#if CONFIG_BLE_MESH_NOT_RELAY_REPLAY_MSG
&& !rx.replay_msg
#endif
)) {
net_buf_simple_restore(&buf, &state);
bt_mesh_net_relay(&buf, &rx);
}

View File

@@ -294,6 +294,9 @@ struct bt_mesh_net_rx {
ctl:1, /* Network Control */
net_if:2, /* Network interface */
local_match:1, /* Matched a local element */
#if CONFIG_BLE_MESH_NOT_RELAY_REPLAY_MSG
replay_msg:1, /* Replayed messages */
#endif
friend_match:1; /* Matched an LPN we're friends for */
uint16_t msg_cache_idx; /* Index of entry in message cache */
};

View File

@@ -82,12 +82,14 @@ static uint8_t bt_mesh_gatts_addr[6];
#endif /* defined(CONFIG_BLE_MESH_NODE) && CONFIG_BLE_MESH_NODE */
static bool g_host_init = false;
int bt_mesh_host_init(void)
{
static bool init = false;
int rc;
if (init == true) {
if (g_host_init == true) {
BT_WARN("Already initialized host for mesh!");
return -EALREADY;
}
@@ -102,7 +104,30 @@ int bt_mesh_host_init(void)
}
osi_alarm_init();
init = true;
g_host_init = true;
return 0;
}
int bt_mesh_host_deinit(void)
{
int rc;
if (g_host_init == false) {
return -EALREADY;
}
osi_alarm_deinit();
rc = osi_alarm_delete_mux();
if (rc != 0) {
return -1;
}
btc_deinit();
g_host_init = false;
return 0;
}
@@ -759,15 +784,17 @@ int bt_le_adv_start(const struct bt_mesh_adv_param *param,
const struct bt_mesh_adv_data *ad, size_t ad_len,
const struct bt_mesh_adv_data *sd, size_t sd_len)
{
struct ble_gap_adv_params adv_params;
uint8_t buf[BLE_HS_ADV_MAX_SZ];
uint16_t interval = 0;
uint8_t buf_len = 0;
int err;
#if BLE_MESH_DEV
if (bt_mesh_atomic_test_bit(bt_mesh_dev.flags, BLE_MESH_DEV_ADVERTISING)) {
return -EALREADY;
}
#endif
uint8_t buf[BLE_HS_ADV_MAX_SZ];
uint8_t buf_len = 0;
int err;
struct ble_gap_adv_params adv_params;
err = set_ad(ad, ad_len, buf, &buf_len);
if (err) {
@@ -798,8 +825,6 @@ int bt_le_adv_start(const struct bt_mesh_adv_param *param,
}
memset(&adv_params, 0, sizeof adv_params);
adv_params.itvl_min = param->interval_min;
adv_params.itvl_max = param->interval_max;
if (param->options & BLE_MESH_ADV_OPT_CONNECTABLE) {
adv_params.conn_mode = BLE_GAP_CONN_MODE_UND;
@@ -812,6 +837,25 @@ int bt_le_adv_start(const struct bt_mesh_adv_param *param,
adv_params.disc_mode = BLE_GAP_DISC_MODE_NON;
}
interval = param->interval_min;
#if CONFIG_BLE_MESH_RANDOM_ADV_INTERVAL
/* If non-connectable mesh packets are transmitted with an adv interval
* not smaller than 10ms, then we will use a random adv interval between
* [interval / 2, interval] for them.
*/
if (adv_params.conn_mode == BLE_GAP_CONN_MODE_NON &&
adv_params.disc_mode == BLE_GAP_DISC_MODE_NON && interval >= 16) {
interval >>= 1;
interval += (bt_mesh_get_rand() % (interval + 1));
BT_INFO("%u->%u", param->interval_min, interval);
}
#endif
adv_params.itvl_min = interval;
adv_params.itvl_max = interval;
again:
err = ble_gap_adv_start(BLE_OWN_ADDR_PUBLIC, NULL, BLE_HS_FOREVER, &adv_params,
gap_event_cb, NULL);
@@ -877,7 +921,7 @@ int bt_mesh_ble_adv_start(const struct bt_mesh_ble_adv_param *param,
break;
case BLE_MESH_ADV_NONCONN_IND:
adv_params.conn_mode = BLE_GAP_CONN_MODE_NON;
adv_params.disc_mode = BLE_GAP_DISC_MODE_GEN;
adv_params.disc_mode = BLE_GAP_DISC_MODE_NON;
break;
case BLE_MESH_ADV_DIRECT_IND_LOW_DUTY:
adv_params.conn_mode = BLE_GAP_CONN_MODE_DIR;

View File

@@ -19,6 +19,8 @@
#include "provisioner_prov.h"
#include "provisioner_main.h"
#define PROV_SVC_ADV_RX_CHECK(pre, cur) ((cur) < (pre) ? ((cur) + (UINT32_MAX - (pre)) >= 200) : ((cur) - (pre) >= 200))
#if CONFIG_BLE_MESH_PROVISIONER
_Static_assert(BLE_MESH_MAX_CONN >= CONFIG_BLE_MESH_PBG_SAME_TIME,
@@ -3426,6 +3428,21 @@ int bt_mesh_provisioner_prov_deinit(bool erase)
}
#endif /* CONFIG_BLE_MESH_DEINIT */
static bool bt_mesh_prov_svc_adv_filter(void)
{
static uint32_t timestamp = 0;
static uint32_t pre_timestamp = 0;
timestamp = k_uptime_get_32();
if (PROV_SVC_ADV_RX_CHECK(pre_timestamp, timestamp)) {
pre_timestamp = timestamp;
return false;
}
return true;
}
static bool is_unprov_dev_info_callback_to_app(bt_mesh_prov_bearer_t bearer, const uint8_t uuid[16],
const bt_mesh_addr_t *addr, uint16_t oob_info, int8_t rssi)
{
@@ -3443,6 +3460,11 @@ static bool is_unprov_dev_info_callback_to_app(bt_mesh_prov_bearer_t bearer, con
if (i == ARRAY_SIZE(unprov_dev)) {
BT_DBG("Device not in queue, notify to app layer");
if (adv_type == BLE_MESH_ADV_IND && bt_mesh_prov_svc_adv_filter()) {
return true;
}
if (notify_unprov_adv_pkt_cb) {
notify_unprov_adv_pkt_cb(addr->val, addr->type, adv_type, uuid, oob_info, bearer, rssi);
}

View File

@@ -711,6 +711,9 @@ bool bt_mesh_rpl_check(struct bt_mesh_net_rx *rx, struct bt_mesh_rpl **match)
return false;
} else {
#if CONFIG_BLE_MESH_NOT_RELAY_REPLAY_MSG
rx->replay_msg = 1;
#endif
return true;
}
}

View File

@@ -29,7 +29,7 @@ config BT_BLUEDROID_PINNED_TO_CORE
config BT_BTU_TASK_STACK_SIZE
int "Bluetooth Bluedroid Host Stack task stack size"
depends on BT_BLUEDROID_ENABLED
default 4096
default 4352
help
This select btu task stack size
@@ -61,21 +61,23 @@ config BT_SPP_ENABLED
help
This enables the Serial Port Profile
config BT_HFP_ENABLE
menuconfig BT_HFP_ENABLE
bool "Hands Free/Handset Profile"
depends on BT_CLASSIC_ENABLED
default n
help
Hands Free Unit and Audio Gateway can be included simultaneously
but they cannot run simultaneously due to internal limitations.
choice BT_HFP_ROLE
prompt "Hands-free Profile Role configuration"
config BT_HFP_CLIENT_ENABLE
bool "Hands Free Unit"
depends on BT_HFP_ENABLE
default y
config BT_HFP_CLIENT_ENABLE
bool "Hands Free Unit"
config BT_HFP_AG_ENABLE
bool "Audio Gateway"
endchoice
config BT_HFP_AG_ENABLE
bool "Audio Gateway"
depends on BT_HFP_ENABLE
default y
choice BT_HFP_AUDIO_DATA_PATH
prompt "audio(SCO) data path"
@@ -99,26 +101,26 @@ config BT_HFP_WBS_ENABLE
This enables Wide Band Speech. Should disable it when SCO data path is PCM.
Otherwise there will be no data transmited via GPIOs.
config BT_HID_ENABLED
menuconfig BT_HID_ENABLED
bool "Classic BT HID"
depends on BT_CLASSIC_ENABLED
default n
help
This enables the BT HID Host
choice BT_HID_ROLE
prompt "Profile Role configuration"
config BT_HID_HOST_ENABLED
bool "Classic BT HID Host"
depends on BT_HID_ENABLED
config BT_HID_HOST_ENABLED
bool "Classic BT HID Host"
help
This enables the BT HID Host
default n
help
This enables the BT HID Host
config BT_HID_DEVICE_ENABLED
bool "Classic BT HID Device"
help
This enables the BT HID Device
endchoice
config BT_HID_DEVICE_ENABLED
bool "Classic BT HID Device"
depends on BT_HID_ENABLED
help
This enables the BT HID Device
config BT_SSP_ENABLED
bool "Secure Simple Pairing"
@@ -205,7 +207,10 @@ config BT_GATTS_ROBUST_CACHING_ENABLED
depends on BT_GATTS_ENABLE
default n
help
This option enable gatt robust caching feature on server
This option enables the GATT robust caching feature on the server.
if turned on, the Client Supported Features characteristic, Database Hash characteristic,
and Server Supported Features characteristic will be included in the GAP SERVICE.
config BT_GATTS_DEVICE_NAME_WRITABLE
bool "Allow to write device name by GATT clients"
@@ -236,6 +241,14 @@ config BT_GATTC_MAX_CACHE_CHAR
help
Maximum GATTC cache characteristic count
config BT_GATTC_NOTIF_REG_MAX
int "Max gattc notify(indication) register number"
depends on BT_GATTC_ENABLE
range 1 64
default 5
help
Maximum GATTC notify(indication) register number
config BT_GATTC_CACHE_NVS_FLASH
bool "Save gattc cache data to nvs flash"
depends on BT_GATTC_ENABLE
@@ -1027,7 +1040,7 @@ config BT_ACL_CONNECTIONS
config BT_MULTI_CONNECTION_ENBALE
bool "Enable BLE multi-conections"
depends on BT_BLUEDROID_ENABLED
depends on BT_BLE_ENABLED
default y
help
Enable this option if there are multiple connections
@@ -1048,7 +1061,7 @@ config BT_BLE_DYNAMIC_ENV_MEMORY
config BT_BLE_HOST_QUEUE_CONG_CHECK
bool "BLE queue congestion check"
depends on BT_BLUEDROID_ENABLED
depends on BT_BLE_ENABLED
default n
help
When scanning and scan duplicate is not enabled, if there are a lot of adv packets around
@@ -1060,6 +1073,14 @@ config BT_SMP_ENABLE
depends on BT_BLUEDROID_ENABLED
default BT_CLASSIC_ENABLED || BT_BLE_SMP_ENABLE
config BT_SMP_MAX_BONDS
int "BT/BLE maximum bond device count"
depends on BT_SMP_ENABLE
range 1 32
default 15
help
The number of security records for peer devices.
config BT_BLE_ACT_SCAN_REP_ADV_SCAN
bool "Report adv data and scan response individually when BLE active scan"
depends on BT_BLUEDROID_ENABLED && BT_BLE_ENABLED
@@ -1073,7 +1094,7 @@ config BT_BLE_ACT_SCAN_REP_ADV_SCAN
config BT_BLE_ESTAB_LINK_CONN_TOUT
int "Timeout of BLE connection establishment"
depends on BT_BLUEDROID_ENABLED
depends on BT_BLE_ENABLED
range 1 60
default 30
help
@@ -1108,7 +1129,7 @@ config BT_BLE_RPA_SUPPORTED
config BT_BLE_RPA_TIMEOUT
int "Timeout of resolvable private address"
depends on BT_BLUEDROID_ENABLED
depends on BT_BLE_ENABLED
range 1 3600
default 900
help
@@ -1117,35 +1138,35 @@ config BT_BLE_RPA_TIMEOUT
config BT_BLE_50_FEATURES_SUPPORTED
bool "Enable BLE 5.0 features"
depends on (BT_BLUEDROID_ENABLED && (IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3))
depends on (BT_BLE_ENABLED && (IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3))
default y
help
This enables BLE 5.0 features, this option only support esp32c3/esp32s3 chip
config BT_BLE_42_FEATURES_SUPPORTED
bool "Enable BLE 4.2 features"
depends on (BT_BLUEDROID_ENABLED && (IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3))
depends on (BT_BLE_ENABLED && (IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3))
default n
help
This enables BLE 4.2 features.
config BT_BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER
bool "Enable BLE periodic advertising sync transfer feature"
depends on (BT_BLUEDROID_ENABLED && BT_BLE_50_FEATURES_SUPPORTED && SOC_ESP_NIMBLE_CONTROLLER)
depends on (BT_BLE_50_FEATURES_SUPPORTED && SOC_ESP_NIMBLE_CONTROLLER)
default n
help
This enables BLE periodic advertising sync transfer feature
config BT_BLE_FEAT_PERIODIC_ADV_ENH
bool "Enable periodic adv enhancements(adi support)"
depends on (BT_BLUEDROID_ENABLED && BT_BLE_50_FEATURES_SUPPORTED && SOC_ESP_NIMBLE_CONTROLLER)
depends on (BT_BLE_50_FEATURES_SUPPORTED && SOC_ESP_NIMBLE_CONTROLLER)
default n
help
Enable the periodic advertising enhancements
config BT_BLE_HIGH_DUTY_ADV_INTERVAL
bool "Enable BLE high duty advertising interval feature"
depends on BT_BLUEDROID_ENABLED
depends on BT_BLE_ENABLED
default n
help
This enable BLE high duty advertising interval feature

View File

@@ -22,6 +22,11 @@ esp_err_t esp_ble_gap_register_callback(esp_gap_ble_cb_t callback)
return (btc_profile_cb_set(BTC_PID_GAP_BLE, callback) == 0 ? ESP_OK : ESP_FAIL);
}
esp_gap_ble_cb_t esp_ble_gap_get_callback(void)
{
return (esp_gap_ble_cb_t) btc_profile_cb_get(BTC_PID_GAP_BLE);
}
#if (BLE_42_FEATURE_SUPPORT == TRUE)
esp_err_t esp_ble_gap_config_adv_data(esp_ble_adv_data_t *adv_data)
{
@@ -122,6 +127,19 @@ esp_err_t esp_ble_gap_stop_advertising(void)
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gap_clear_advertising(void)
{
btc_msg_t msg;
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_ACT_CLEAR_ADV;
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
esp_err_t esp_ble_gap_update_conn_params(esp_ble_conn_update_params_t *params)
@@ -470,8 +488,7 @@ esp_err_t esp_ble_gap_config_scan_rsp_data_raw(uint8_t *raw_data, uint32_t raw_d
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
if (raw_data == NULL
|| (raw_data_len <= 0 || raw_data_len > ESP_BLE_SCAN_RSP_DATA_LEN_MAX)) {
if ((raw_data_len != 0 && raw_data == NULL) || raw_data_len > ESP_BLE_ADV_DATA_LEN_MAX) {
return ESP_ERR_INVALID_ARG;
}
@@ -577,7 +594,11 @@ esp_err_t esp_ble_gap_set_security_param(esp_ble_sm_param_t param_type,
LOG_ERROR("ESP_BLE_APP_ENC_KEY_SIZE is deprecated, use ESP_GATT_PERM_ENCRYPT_KEY_SIZE in characteristic definition");
return ESP_ERR_NOT_SUPPORTED;
}
if (param_type == ESP_BLE_SM_MAX_KEY_SIZE || param_type == ESP_BLE_SM_MIN_KEY_SIZE) {
if (((uint8_t *)value)[0] > 16 || ((uint8_t *)value)[0] < 7) {
return ESP_ERR_INVALID_ARG;
}
}
btc_msg_t msg = {0};
btc_ble_gap_args_t arg;

View File

@@ -420,6 +420,10 @@ esp_err_t esp_bt_gap_set_qos(esp_bd_addr_t remote_bda, uint32_t t_poll)
return ESP_ERR_INVALID_STATE;
}
if (t_poll < ESP_BT_GAP_TPOLL_MIN || t_poll > ESP_BT_GAP_TPOLL_MAX) {
return ESP_ERR_INVALID_ARG;
}
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BT;
msg.act = BTC_GAP_BT_ACT_SET_QOS;

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
*/
@@ -29,6 +29,11 @@ esp_err_t esp_ble_gattc_register_callback(esp_gattc_cb_t callback)
return ESP_OK;
}
esp_gattc_cb_t esp_ble_gattc_get_callback(void)
{
return (esp_gattc_cb_t) btc_profile_cb_get(BTC_PID_GATTC);
}
esp_err_t esp_ble_gattc_app_register(uint16_t app_id)
{
btc_msg_t msg = {0};

View File

@@ -29,6 +29,11 @@ esp_err_t esp_ble_gatts_register_callback(esp_gatts_cb_t callback)
return (btc_profile_cb_set(BTC_PID_GATTS, callback) == 0 ? ESP_OK : ESP_FAIL);
}
esp_gatts_cb_t esp_ble_gatts_get_callback(void)
{
return (esp_gatts_cb_t) btc_profile_cb_get(BTC_PID_GATTS);
}
esp_err_t esp_ble_gatts_app_register(uint16_t app_id)
{
btc_msg_t msg = {0};

View File

@@ -1,16 +1,8 @@
// Copyright 2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>
#include <stdlib.h>
@@ -187,6 +179,9 @@ esp_err_t esp_bt_hf_volume_control(esp_bd_addr_t remote_addr, esp_hf_volume_cont
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
return ESP_ERR_INVALID_STATE;
}
if (volume < 0 || volume > 15) {
return ESP_ERR_INVALID_ARG;
}
btc_msg_t msg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_HF;
@@ -253,6 +248,9 @@ esp_err_t esp_bt_hf_indchange_notification(esp_bd_addr_t remote_addr,
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
return ESP_ERR_INVALID_STATE;
}
if (signal < 0 || signal > 5) {
return ESP_ERR_INVALID_ARG;
}
btc_msg_t msg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_HF;
@@ -280,6 +278,10 @@ esp_err_t esp_bt_hf_cind_response(esp_bd_addr_t remote_addr,
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
return ESP_ERR_INVALID_STATE;
}
if (signal < 0 || signal > 5 || batt_lev < 0 || batt_lev > 5) {
return ESP_ERR_INVALID_ARG;
}
btc_msg_t msg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_HF;
@@ -353,11 +355,14 @@ esp_err_t esp_bt_hf_clcc_response(esp_bd_addr_t remote_addr, int index, esp_hf_c
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}
esp_err_t esp_bt_hf_cnum_response(esp_bd_addr_t remote_addr, char *number, esp_hf_subscriber_service_type_t type)
esp_err_t esp_bt_hf_cnum_response(esp_bd_addr_t remote_addr, char *number, int number_type, esp_hf_subscriber_service_type_t service_type)
{
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
return ESP_ERR_INVALID_STATE;
}
if (number == NULL || number_type < 128 || number_type > 175) {
return ESP_ERR_INVALID_ARG;
}
btc_msg_t msg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_HF;
@@ -367,7 +372,8 @@ esp_err_t esp_bt_hf_cnum_response(esp_bd_addr_t remote_addr, char *number, esp_h
memset(&arg, 0, sizeof(btc_hf_args_t));
memcpy(&(arg.cnum_rep), remote_addr, sizeof(esp_bd_addr_t));
arg.cnum_rep.number = number; //deep_copy
arg.cnum_rep.type = type;
arg.cnum_rep.number_type = number_type;
arg.cnum_rep.service_type = service_type;
/* Switch to BTC context */
bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t),
@@ -528,10 +534,30 @@ esp_err_t esp_bt_hf_register_data_callback(esp_hf_incoming_data_cb_t recv, esp_h
}
#if (BTM_SCO_HCI_INCLUDED == TRUE)
esp_err_t esp_hf_ag_pkt_stat_nums_get(uint16_t sync_conn_handle)
{
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
return ESP_ERR_INVALID_STATE;
}
btc_msg_t msg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_HF;
msg.act = BTC_HF_REQUEST_PKT_STAT_EVT;
btc_hf_args_t arg;
memset(&arg, 0, sizeof(btc_hf_args_t));
arg.pkt_sync_hd.sync_conn_handle = sync_conn_handle;
/* Switch to BTC context */
bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL);
return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}
void esp_hf_outgoing_data_ready(void)
{
btc_hf_ci_sco_data();
}
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE ) */
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE) */
#endif // BTC_HF_INCLUDED

View File

@@ -1,16 +1,8 @@
// Copyright 2018 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "common/bt_target.h"
#include <string.h>
@@ -470,8 +462,27 @@ esp_err_t esp_hf_client_register_data_callback(esp_hf_client_incoming_data_cb_t
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}
#if (BTM_SCO_HCI_INCLUDED == TRUE)
esp_err_t esp_hf_client_pkt_stat_nums_get(uint16_t sync_conn_handle)
{
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
return ESP_ERR_INVALID_STATE;
}
btc_msg_t msg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_HF_CLIENT;
msg.act = BTC_HF_CLIENT_REQUEST_PKT_STAT_EVT;
btc_hf_client_args_t arg;
memset(&arg, 0, sizeof(btc_hf_client_args_t));
arg.pkt_sync_hd.sync_conn_handle = sync_conn_handle;
/* Switch to BTC context */
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_hf_client_args_t), NULL, NULL);
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}
#if (BTM_SCO_HCI_INCLUDED == TRUE )
void esp_hf_client_outgoing_data_ready(void)
{
BTA_HfClientCiData();
@@ -492,6 +503,6 @@ int32_t esp_hf_client_pcm_resample(void *src, uint32_t in_bytes, void *dst)
return BTA_DmPcmResample(src, in_bytes, dst);
}
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE ) */
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE) */
#endif /* BTC_HF_CLIENT_INCLUDED */

View File

@@ -1,16 +1,8 @@
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __ESP_A2DP_API_H__
#define __ESP_A2DP_API_H__
@@ -182,7 +174,7 @@ typedef int32_t (* esp_a2d_source_data_cb_t)(uint8_t *buf, int32_t len);
*
* @return
* - ESP_OK: success
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: if callback is a NULL function pointer
*
*/
@@ -199,7 +191,7 @@ esp_err_t esp_a2d_register_callback(esp_a2d_cb_t callback);
*
* @return
* - ESP_OK: success
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: if callback is a NULL function pointer
*
*/
@@ -216,7 +208,7 @@ esp_err_t esp_a2d_sink_register_data_callback(esp_a2d_sink_data_cb_t callback);
*
* @return
* - ESP_OK: if the initialization request is sent successfully
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -231,7 +223,7 @@ esp_err_t esp_a2d_sink_init(void);
*
* @return
* - ESP_OK: if the deinitialization request is sent successfully
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -247,7 +239,7 @@ esp_err_t esp_a2d_sink_deinit(void);
*
* @return
* - ESP_OK: connect request is sent to lower layer successfully
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -263,7 +255,7 @@ esp_err_t esp_a2d_sink_connect(esp_bd_addr_t remote_bda);
*
* @return
* - ESP_OK: disconnect request is sent to lower layer successfully
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -279,7 +271,7 @@ esp_err_t esp_a2d_sink_disconnect(esp_bd_addr_t remote_bda);
*
* @return
* - ESP_OK: control command is sent to lower layer successfully
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -296,7 +288,7 @@ esp_err_t esp_a2d_media_ctrl(esp_a2d_media_ctrl_t ctrl);
*
* @return
* - ESP_OK: if the initialization request is sent to lower layer successfully
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -311,7 +303,7 @@ esp_err_t esp_a2d_source_init(void);
*
* @return
* - ESP_OK: success
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -328,7 +320,7 @@ esp_err_t esp_a2d_source_deinit(void);
*
* @return
* - ESP_OK: success
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: if callback is a NULL function pointer
*
*/
@@ -344,7 +336,7 @@ esp_err_t esp_a2d_source_register_data_callback(esp_a2d_source_data_cb_t callbac
*
* @return
* - ESP_OK: connect request is sent to lower layer successfully
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -359,7 +351,7 @@ esp_err_t esp_a2d_source_connect(esp_bd_addr_t remote_bda);
* @param[in] remote_bda: remote bluetooth device address
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/

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
*/
@@ -208,6 +208,8 @@ typedef enum {
ESP_GAP_BLE_PERIODIC_ADV_SET_INFO_TRANS_COMPLETE_EVT, /*!< when periodic advertising set info transfer complete, the event comes */
ESP_GAP_BLE_SET_PAST_PARAMS_COMPLETE_EVT, /*!< when set periodic advertising sync transfer params complete, the event comes */
ESP_GAP_BLE_PERIODIC_ADV_SYNC_TRANS_RECV_EVT, /*!< when periodic advertising sync transfer received, the event comes */
// BLE_INCLUDED
ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT, /*!< When clear advertising complete, the event comes */
ESP_GAP_BLE_EVT_MAX, /*!< when maximum advertising event complete, the event comes */
} esp_gap_ble_cb_event_t;
@@ -417,7 +419,10 @@ typedef enum {
typedef enum {
BLE_SCAN_DUPLICATE_DISABLE = 0x0, /*!< the Link Layer should generate advertising reports to the host for each packet received */
BLE_SCAN_DUPLICATE_ENABLE = 0x1, /*!< the Link Layer should filter out duplicate advertising reports to the Host */
BLE_SCAN_DUPLICATE_MAX = 0x2, /*!< 0x02 0xFF, Reserved for future use */
#if (BLE_50_FEATURE_SUPPORT == TRUE)
BLE_SCAN_DUPLICATE_ENABLE_RESET, /*!< Duplicate filtering enabled, reset for each scan period, only supported in BLE 5.0. */
#endif
BLE_SCAN_DUPLICATE_MAX /*!< Reserved for future use. */
} esp_ble_scan_duplicate_t;
#if (BLE_42_FEATURE_SUPPORT == TRUE)
/// Ble scan parameters
@@ -675,6 +680,8 @@ typedef enum {
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_BEACON_TYPE, /*!< BLE mesh beacon AD type, the format is | Len | 0x2B | Beacon Type | Beacon Data | */
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_PROV_SRV_ADV, /*!< BLE mesh provisioning service uuid, the format is | 0x02 | 0x01 | flags | 0x03 | 0x03 | 0x1827 | .... |` */
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_PROXY_SRV_ADV, /*!< BLE mesh adv with proxy service uuid, the format is | 0x02 | 0x01 | flags | 0x03 | 0x03 | 0x1828 | .... |` */
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_PROXY_SOLIC_ADV, /*!< BLE mesh adv with proxy service uuid, the format is | 0x02 | 0x01 | flags | 0x03 | 0x03 | 0x1859 | .... |` */
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_URI_ADV, /*!< BLE mesh URI adv, the format is ...| Len | 0x24 | data |... */
} esp_ble_duplicate_exceptional_info_type_t;
typedef enum {
@@ -682,7 +689,9 @@ typedef enum {
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_LINK_ID_LIST = BLE_BIT(1), /*!< duplicate scan exceptional mesh link ID list */
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_BEACON_TYPE_LIST = BLE_BIT(2), /*!< duplicate scan exceptional mesh beacon type list */
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_PROV_SRV_ADV_LIST = BLE_BIT(3), /*!< duplicate scan exceptional mesh adv with provisioning service uuid */
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_PROXY_SRV_ADV_LIST = BLE_BIT(4), /*!< duplicate scan exceptional mesh adv with provisioning service uuid */
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_PROXY_SRV_ADV_LIST = BLE_BIT(4), /*!< duplicate scan exceptional mesh adv with proxy service uuid */
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_PROXY_SOLIC_ADV_LIST = BLE_BIT(5), /*!< duplicate scan exceptional mesh adv with proxy solicitation PDU uuid */
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_URI_ADV_LIST = BLE_BIT(6), /*!< duplicate scan exceptional URI list */
ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_ALL_LIST = 0xFFFF, /*!< duplicate scan exceptional all list */
} esp_duplicate_scan_exceptional_list_type_t;
@@ -1022,6 +1031,12 @@ typedef union {
struct ble_adv_stop_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate adv stop operation success status */
} adv_stop_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT
*/
struct ble_adv_clear_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate adv clear operation success status */
} adv_clear_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT */
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
/**
* @brief ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT
@@ -1399,6 +1414,15 @@ typedef void (* esp_gap_ble_cb_t)(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_p
*/
esp_err_t esp_ble_gap_register_callback(esp_gap_ble_cb_t callback);
/**
* @brief This function is called to get the current gap callback
*
* @return
* - esp_gap_ble_cb_t : callback function
*
*/
esp_gap_ble_cb_t esp_ble_gap_get_callback(void);
#if (BLE_42_FEATURE_SUPPORT == TRUE)
/**
* @brief This function is called to override the BTA default ADV parameters.
@@ -2198,8 +2222,9 @@ esp_err_t esp_ble_gap_set_ext_scan_params(const esp_ble_ext_scan_params_t *param
/**
* @brief This function is used to enable scanning.
*
* @param[in] duration : Scan duration
* @param[in] period : Time interval from when the Controller started its last Scan Duration until it begins the subsequent Scan Duration.
* @param[in] duration Scan duration time, where Time = N * 10 ms. Range: 0x0001 to 0xFFFF.
* @param[in] period Time interval from when the Controller started its last Scan Duration until it begins the subsequent Scan Duration.
* Time = N * 1.28 sec. Range: 0x0001 to 0xFFFF.
*
* @return - ESP_OK : success
* - other : failed
@@ -2363,6 +2388,16 @@ esp_err_t esp_ble_gap_set_periodic_adv_sync_trans_params(esp_bd_addr_t addr,
const esp_ble_gap_past_params_t *params);
#endif //#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
/**
* @brief This function is used to clear legacy advertising
*
*
* @return - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_gap_clear_advertising(void);
#ifdef __cplusplus
}
#endif

View File

@@ -238,6 +238,11 @@ typedef enum {
#define ESP_BT_GAP_MIN_INQ_LEN (0x01) /*!< Minimum inquiry duration, unit is 1.28s */
#define ESP_BT_GAP_MAX_INQ_LEN (0x30) /*!< Maximum inquiry duration, unit is 1.28s */
/** Minimum, Default and Maximum poll interval **/
#define ESP_BT_GAP_TPOLL_MIN (0x0006) /*!< Minimum poll interval, unit is 625 microseconds */
#define ESP_BT_GAP_TPOLL_DFT (0x0028) /*!< Default poll interval, unit is 625 microseconds */
#define ESP_BT_GAP_TPOLL_MAX (0x1000) /*!< Maximum poll interval, unit is 625 microseconds */
/// GAP state callback parameters
typedef union {
/**

View File

@@ -282,6 +282,15 @@ typedef void (* esp_gattc_cb_t)(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_
*/
esp_err_t esp_ble_gattc_register_callback(esp_gattc_cb_t callback);
/**
* @brief This function is called to get the current application callbacks
* with BTA GATTC module.
*
* @return
* - esp_gattC_cb_t : current callback
*
*/
esp_gattc_cb_t esp_ble_gattc_get_callback(void);
/**
* @brief This function is called to register application callbacks

View File

@@ -304,6 +304,16 @@ typedef void (* esp_gatts_cb_t)(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_
*/
esp_err_t esp_ble_gatts_register_callback(esp_gatts_cb_t callback);
/**
* @brief This function is called to get the current application callbacks
* with BTA GATTS module.
*
* @return
* - esp_gatts_cb_t : current callback
*
*/
esp_gatts_cb_t esp_ble_gatts_get_callback(void);
/**
* @brief This function is called to register application identifier
*

View File

@@ -1,16 +1,8 @@
// Copyright 2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __ESP_HF_AG_API_H__
#define __ESP_HF_AG_API_H__
@@ -70,13 +62,22 @@ typedef enum
ESP_HF_DIAL_EVT, /*!< Origin an outgoing call with specific number or the dial the last number */
ESP_HF_WBS_RESPONSE_EVT, /*!< Codec Status */
ESP_HF_BCS_RESPONSE_EVT, /*!< Final Codec Choice */
ESP_HF_PKT_STAT_NUMS_GET_EVT, /*!< Request number of packet different status */
} esp_hf_cb_event_t;
/// Dial type of ESP_HF_DIAL_EVT
typedef enum
{
ESP_HF_DIAL_NUM = 0, /*!< Dial with a phone number */
ESP_HF_DIAL_VOIP, /*!< Dial with VoIP */
ESP_HF_DIAL_MEM, /*!< Dial with a memory position */
} esp_hf_dial_type_t;
/// HFP AG callback parameters
typedef union
{
/**
* @brief ESP_HS_CONNECTION_STATE_EVT
* @brief ESP_HF_CONNECTION_STATE_EVT
*/
struct hf_conn_stat_param {
esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */
@@ -91,6 +92,7 @@ typedef union
struct hf_audio_stat_param {
esp_bd_addr_t remote_addr; /*!< Remote bluetooth device address */
esp_hf_audio_state_t state; /*!< Audio connection state */
uint16_t sync_conn_handle; /*!< (e)SCO connection handle */
} audio_stat; /*!< AG callback param of ESP_HF_AUDIO_STATE_EVT */
/**
@@ -105,6 +107,7 @@ typedef union
* @brief ESP_HF_VOLUME_CONTROL_EVT
*/
struct hf_volume_control_param {
esp_bd_addr_t remote_addr; /*!< Remote bluetooth device address */
esp_hf_volume_type_t type; /*!< Volume control target, speaker or microphone */
int volume; /*!< Gain, ranges from 0 to 15 */
} volume_control; /*!< AG callback param of ESP_HF_VOLUME_CONTROL_EVT */
@@ -113,48 +116,89 @@ typedef union
* @brief ESP_HF_UNAT_RESPOSNE_EVT
*/
struct hf_unat_rep_param {
esp_bd_addr_t remote_addr; /*!< Remote bluetooth device address */
char *unat; /*!< Unknown AT command string */
}unat_rep; /*!< AG callback param of ESP_HF_UNAT_RESPONSE_EVT */
/**
* @brief ESP_HF_CIND_RESPONSE_EVT
*/
struct hf_cind_param {
esp_hf_call_status_t call_status; /*!< call status indicator */
esp_hf_call_setup_status_t call_setup_status; /*!< call setup status indicator */
esp_hf_network_state_t svc; /*!< bluetooth proprietary call hold status indicator */
int signal_strength; /*!< bluetooth proprietary call hold status indicator */
esp_hf_roaming_status_t roam; /*!< bluetooth proprietary call hold status indicator */
int battery_level; /*!< battery charge value, ranges from 0 to 5 */
esp_hf_call_held_status_t call_held_status; /*!< bluetooth proprietary call hold status indicator */
} cind; /*!< AG callback param of ESP_HF_CIND_RESPONSE_EVT */
} unat_rep; /*!< AG callback param of ESP_HF_UNAT_RESPONSE_EVT */
/**
* @brief ESP_HF_DIAL_EVT
*/
struct hf_out_call_param {
esp_bd_addr_t remote_addr; /*!< remote bluetooth device address */
esp_hf_dial_type_t type; /*!< dial type */
char *num_or_loc; /*!< location in phone memory */
} out_call; /*!< AG callback param of ESP_HF_DIAL_EVT */
/**
* @brief ESP_HF_VTS_RESPOSNE_EVT
* @brief ESP_HF_IND_UPDATE_EVT
*/
struct hf_ind_upd_param {
esp_bd_addr_t remote_addr; /*!< remote bluetooth device address */
} ind_upd; /*!< AG callback param of ESP_HF_IND_UPDATE_EVT */
/**
* @brief ESP_HF_CIND_RESPONSE_EVT
*/
struct hf_cind_rep_param {
esp_bd_addr_t remote_addr; /*!< remote bluetooth device address */
} cind_rep; /*!< AG callback param of ESP_HF_CIND_RESPONSE_EVT */
/**
* @brief ESP_HF_COPS_RESPONSE_EVT
*/
struct hf_cops_rep_param {
esp_bd_addr_t remote_addr; /*!< remote bluetooth device address */
} cops_rep; /*!< AG callback param of ESP_HF_COPS_RESPONSE_EVT */
/**
* @brief ESP_HF_CLCC_RESPONSE_EVT
*/
struct hf_clcc_rep_param {
esp_bd_addr_t remote_addr; /*!< remote bluetooth device address */
} clcc_rep; /*!< AG callback param of ESP_HF_CLCC_RESPONSE_EVT */
/**
* @brief ESP_HF_CNUM_RESPONSE_EVT
*/
struct hf_cnum_rep_param {
esp_bd_addr_t remote_addr; /*!< remote bluetooth device address */
} cnum_rep; /*!< AG callback param of ESP_HF_CNUM_RESPONSE_EVT */
/**
* @brief ESP_HF_VTS_RESPONSE_EVT
*/
struct hf_vts_rep_param {
esp_bd_addr_t remote_addr; /*!< Remote bluetooth device address */
char *code; /*!< MTF code from HF Client */
}vts_rep; /*!< AG callback param of ESP_HF_VTS_RESPONSE_EVT */
} vts_rep; /*!< AG callback param of ESP_HF_VTS_RESPONSE_EVT */
/**
* @brief ESP_HF_NREC_RESPOSNE_EVT
*/
struct hf_nrec_param {
esp_hf_nrec_t state; /*!< NREC enabled or disabled */
esp_bd_addr_t remote_addr; /*!< Remote bluetooth device address */
esp_hf_nrec_t state; /*!< NREC enabled or disabled */
} nrec; /*!< AG callback param of ESP_HF_NREC_RESPONSE_EVT */
/**
* @brief ESP_HF_ATA_RESPONSE_EVT
*/
struct hf_ata_rep_param {
esp_bd_addr_t remote_addr; /*!< remote bluetooth device address */
} ata_rep; /*!< AG callback param of ESP_HF_ATA_RESPONSE_EVT */
/**
* @brief ESP_HF_CHUP_RESPONSE_EVT
*/
struct hf_chup_rep_param {
esp_bd_addr_t remote_addr; /*!< remote bluetooth device address */
} chup_rep; /*!< AG callback param of ESP_HF_CHUP_RESPONSE_EVT */
/**
* @brief ESP_HF_WBS_RESPONSE_EVT
*/
struct hf_wbs_rep_param {
esp_bd_addr_t remote_addr; /*!< Remote bluetooth device address */
esp_hf_wbs_config_t codec; /*!< codec mode CVSD or mSBC */
} wbs_rep; /*!< AG callback param of ESP_HF_WBS_RESPONSE_EVT */
@@ -162,9 +206,23 @@ typedef union
* @brief ESP_HF_BCS_RESPONSE_EVT
*/
struct hf_bcs_rep_param {
esp_bd_addr_t remote_addr; /*!< Remote bluetooth device address */
esp_hf_wbs_config_t mode; /*!< codec mode CVSD or mSBC */
} bcs_rep; /*!< AG callback param of ESP_HF_BCS_RESPONSE_EVT */
/**
* @brief ESP_HF_PKT_STAT_NUMS_GET_EVT
*/
struct ag_pkt_status_nums {
uint32_t rx_total; /*!< the total number of packets received */
uint32_t rx_correct; /*!< the total number of packets data correctly received */
uint32_t rx_err; /*!< the total number of packets data with possible invalid */
uint32_t rx_none; /*!< the total number of packets data no received */
uint32_t rx_lost; /*!< the total number of packets data partially lost */
uint32_t tx_total; /*!< the total number of packets send */
uint32_t tx_discarded; /*!< the total number of packets send lost */
} pkt_nums; /*!< AG callback param of ESP_HF_PKT_STAT_NUMS_GET_EVT */
} esp_hf_cb_param_t; /*!< HFP AG callback param compound*/
/**
@@ -216,7 +274,7 @@ typedef void (* esp_hf_cb_t) (esp_hf_cb_event_t event, esp_hf_cb_param_t *param)
*
* @return
* - ESP_OK: success
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: if callback is a NULL function pointer
*
*/
@@ -231,7 +289,7 @@ esp_err_t esp_bt_hf_register_callback(esp_hf_cb_t callback);
*
* @return
* - ESP_OK: if the initialization request is sent successfully
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -246,7 +304,7 @@ esp_err_t esp_bt_hf_init(esp_bd_addr_t remote_addr);
*
* @return
* - ESP_OK: success
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -261,7 +319,7 @@ esp_err_t esp_bt_hf_deinit(esp_bd_addr_t remote_addr);
*
* @return
* - ESP_OK: connect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -276,7 +334,7 @@ esp_err_t esp_bt_hf_connect(esp_bd_addr_t remote_bda);
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -290,8 +348,8 @@ esp_err_t esp_bt_hf_disconnect(esp_bd_addr_t remote_bda);
* @param[in] remote_bda: remote bluetooth device address
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: audio connect request is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -305,8 +363,8 @@ esp_err_t esp_bt_hf_connect_audio(esp_bd_addr_t remote_bda);
* @param[in] remote_bda: remote bluetooth device address
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: audio disconnect request is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -322,8 +380,8 @@ esp_err_t esp_bt_hf_disconnect_audio(esp_bd_addr_t remote_bda);
* @param[in] value: 0 - voice recognition disabled, 1- voice recognition enabled
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: response of volume recognition is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -341,8 +399,9 @@ esp_err_t esp_bt_hf_vra(esp_bd_addr_t remote_bda, esp_hf_vr_state_t value);
* @param[in] volume: gain of the speaker of microphone, ranges 0 to 15
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: volume synchronization control is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_ARG: if arguments are invalid
* - ESP_FAIL: others
*
*/
@@ -358,8 +417,8 @@ esp_err_t esp_bt_hf_volume_control(esp_bd_addr_t remote_bda, esp_hf_volume_contr
* @param[in] unat: User AT command response to HF Client.
* It will response "ERROR" by default if unat is NULL.
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: response of unknown AT command is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -374,8 +433,8 @@ esp_err_t esp_hf_unat_response(esp_bd_addr_t remote_addr, char *unat);
* @param[in] response_code: AT command response code
* @param[in] error_code: CME error code
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: extend error code is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -392,8 +451,9 @@ esp_err_t esp_bt_hf_cmee_response(esp_bd_addr_t remote_bda, esp_hf_at_response_c
* @param[in] ntk_state: network service state
* @param[in] signal: signal strength from 0 to 5
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: device status notification is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_ARG: if arguments are invalid
* - ESP_FAIL: others
*
*/
@@ -415,8 +475,9 @@ esp_err_t esp_bt_hf_indchange_notification(esp_bd_addr_t remote_addr, esp_hf_cal
* @param[in] batt_lev: batery level from 0 to 5
* @param[in] call_held_status: call held status
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: response to device individual indicators is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_ARG: if the arguments are invalid
* - ESP_FAIL: others
*
*/
@@ -434,8 +495,8 @@ esp_err_t esp_bt_hf_cind_response(esp_bd_addr_t remote_addr,
* @param[in] remote_addr: remote bluetooth device address
* @param[in] name: current operator name
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: reponse for AT+COPS command is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -447,7 +508,7 @@ esp_err_t esp_bt_hf_cops_response(esp_bd_addr_t remote_addr, char *name);
* As a precondition to use this API, Service Level Connection shall exist with HFP client.
*
* @param[in] remote_addr: remote bluetooth device address
* @param[in] index: the index of current call
* @param[in] index: the index of current call, starting with 1, finishing response with 0 (send OK)
* @param[in] dir: call direction (incoming/outgoing)
* @param[in] current_call_state: current call state
* @param[in] mode: current call mode (voice/data/fax)
@@ -455,8 +516,8 @@ esp_err_t esp_bt_hf_cops_response(esp_bd_addr_t remote_addr, char *name);
* @param[in] number: current call number
* @param[in] type: international type or unknow
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: response to AT+CLCC command is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -471,14 +532,18 @@ esp_err_t esp_bt_hf_clcc_response(esp_bd_addr_t remote_addr, int index, esp_hf_c
*
* @param[in] remote_addr: remote bluetooth device address
* @param[in] number: registration number
* @param[in] type: service type (unknown/voice/fax)
* @param[in] number_type: value of number type from
* 128-143: national or international, may contain prefix and/or escape digits
* 144-159: international, includes country code prefix, add "+" if needed
* 160-175: national, but no prefix nor escape digits
* @param[in] service_type: service type (unknown/voice/fax)
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: response for AT+CNUM command is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
esp_err_t esp_bt_hf_cnum_response(esp_bd_addr_t remote_addr, char *number, esp_hf_subscriber_service_type_t type);
esp_err_t esp_bt_hf_cnum_response(esp_bd_addr_t remote_addr, char *number, int number_type, esp_hf_subscriber_service_type_t service_type);
/**
*
@@ -488,8 +553,9 @@ esp_err_t esp_bt_hf_cnum_response(esp_bd_addr_t remote_addr, char *number, esp_h
* @param[in] remote_addr: remote bluetooth device address
* @param[in] state: in-band ring tone state
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: information of in-band ring tone is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_ARG: if arguments are invalid
* - ESP_FAIL: others
*
*/
@@ -508,8 +574,8 @@ esp_err_t esp_bt_hf_bsir(esp_bd_addr_t remote_addr, esp_hf_in_band_ring_state_t
* @param[in] number: number of the incoming call
* @param[in] call_addr_type: call address type
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: answer incoming call is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -530,8 +596,8 @@ esp_err_t esp_bt_hf_answer_call(esp_bd_addr_t remote_addr, int num_active, int n
* @param[in] number: number of the incoming call
* @param[in] call_addr_type: call address type
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: reject incoming call is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -543,6 +609,9 @@ esp_err_t esp_bt_hf_reject_call(esp_bd_addr_t remote_addr, int num_active, int n
*
* @brief Initiate a call from AG.
* As a precondition to use this API, Service Level Connection shall exist with HFP client.
* If the AG is driven by the HF to call esp_hf_ag_out_call, it needs to response an OK or ERROR
* to HF. But if the AG is actively calling esp_hf_ag_out_call, it does not need to take a response
* to HF.
*
* @param[in] remote_addr: remote bluetooth device address
* @param[in] num_active: the number of active call
@@ -552,8 +621,8 @@ esp_err_t esp_bt_hf_reject_call(esp_bd_addr_t remote_addr, int num_active, int n
* @param[in] number: number of the outgoing call
* @param[in] call_addr_type: call address type
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: a call initiation is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -574,8 +643,8 @@ esp_err_t esp_bt_hf_out_call(esp_bd_addr_t remote_addr, int num_active, int num_
* @param[in] number: number of the call
* @param[in] call_addr_type: call address type
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: end an ongoing call is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -592,12 +661,28 @@ esp_err_t esp_bt_hf_end_call(esp_bd_addr_t remote_addr, int num_active, int num_
*
* @return
* - ESP_OK: success
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: if callback is a NULL function pointer
*
*/
esp_err_t esp_bt_hf_register_data_callback(esp_hf_incoming_data_cb_t recv, esp_hf_outgoing_data_cb_t send);
/**
*
* @brief Get the number of packets received and sent
*
* This function is only used in the case that Voice Over HCI is enabled and the audio state is connected.
* When the operation is completed, the callback function will be called with ESP_HF_PKT_STAT_NUMS_GET_EVT.
*
* @param[in] sync_conn_handle: the (e)SCO connection handle
*
* @return
* - ESP_OK: if the request is sent successfully
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
esp_err_t esp_hf_ag_pkt_stat_nums_get(uint16_t sync_conn_handle);
/**
* @brief Trigger the lower-layer to fetch and send audio data.

View File

@@ -1,16 +1,8 @@
// Copyright 2018 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __ESP_HF_CLIENT_API_H__
#define __ESP_HF_CLIENT_API_H__
@@ -96,6 +88,7 @@ typedef enum {
ESP_HF_CLIENT_BSIR_EVT, /*!< setting of in-band ring tone */
ESP_HF_CLIENT_BINP_EVT, /*!< requested number of last voice tag from AG */
ESP_HF_CLIENT_RING_IND_EVT, /*!< ring indication event */
ESP_HF_CLIENT_PKT_STAT_NUMS_GET_EVT, /*!< requested number of packet different status */
} esp_hf_client_cb_event_t;
/// HFP client callback parameters
@@ -116,6 +109,7 @@ typedef union {
struct hf_client_audio_stat_param {
esp_hf_client_audio_state_t state; /*!< audio connection state */
esp_bd_addr_t remote_bda; /*!< remote bluetooth device address */
uint16_t sync_conn_handle; /*!< (e)SCO connection handle */
} audio_stat; /*!< HF callback param of ESP_HF_CLIENT_AUDIO_STATE_EVT */
/**
@@ -251,6 +245,19 @@ typedef union {
const char *number; /*!< phone number corresponding to the last voice tag in the HF */
} binp; /*!< HF callback param of ESP_HF_CLIENT_BINP_EVT */
/**
* @brief ESP_HF_CLIENT_PKT_STAT_NUMS_GET_EVT
*/
struct hf_client_pkt_status_nums {
uint32_t rx_total; /*!< the total number of packets received */
uint32_t rx_correct; /*!< the total number of packets data correctly received */
uint32_t rx_err; /*!< the total number of packets data with possible invalid */
uint32_t rx_none; /*!< the total number of packets data no received */
uint32_t rx_lost; /*!< the total number of packets data partially lost */
uint32_t tx_total; /*!< the total number of packets send */
uint32_t tx_discarded; /*!< the total number of packets send lost */
} pkt_nums; /*!< HF callback param of ESP_HF_CLIENT_PKT_STAT_NUMS_GET_EVT */
} esp_hf_client_cb_param_t; /*!< HFP client callback parameters */
/**
@@ -298,7 +305,7 @@ typedef void (* esp_hf_client_cb_t)(esp_hf_client_cb_event_t event, esp_hf_clien
*
* @return
* - ESP_OK: success
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: if callback is a NULL function pointer
*
*/
@@ -311,7 +318,7 @@ esp_err_t esp_hf_client_register_callback(esp_hf_client_cb_t callback);
*
* @return
* - ESP_OK: if the initialization request is sent successfully
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -324,7 +331,7 @@ esp_err_t esp_hf_client_init(void);
*
* @return
* - ESP_OK: success
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -339,7 +346,7 @@ esp_err_t esp_hf_client_deinit(void);
*
* @return
* - ESP_OK: connect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -354,7 +361,7 @@ esp_err_t esp_hf_client_connect(esp_bd_addr_t remote_bda);
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -367,8 +374,8 @@ esp_err_t esp_hf_client_disconnect(esp_bd_addr_t remote_bda);
*
* @param[in] remote_bda: remote bluetooth device address
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: connect audio request is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -381,8 +388,8 @@ esp_err_t esp_hf_client_connect_audio(esp_bd_addr_t remote_bda);
*
* @param[in] remote_bda: remote bluetooth device address
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: disconnect audio request is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -394,8 +401,8 @@ esp_err_t esp_hf_client_disconnect_audio(esp_bd_addr_t remote_bda);
* As a precondition to use this API, Service Level Connection shall exist with AG.
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: starting voice recognition is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -407,8 +414,8 @@ esp_err_t esp_hf_client_start_voice_recognition(void);
* As a precondition to use this API, Service Level Connection shall exist with AG.
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: stoping voice recognition is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -423,8 +430,8 @@ esp_err_t esp_hf_client_stop_voice_recognition(void);
* @param[in] volume: gain of the speaker of microphone, ranges 0 to 15
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: volume update is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -438,8 +445,8 @@ esp_err_t esp_hf_client_volume_update(esp_hf_volume_control_target_t type, int v
* @param[in] number: number string of the call. If NULL, the last number is called(aka re-dial)
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: a call placing is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -453,8 +460,8 @@ esp_err_t esp_hf_client_dial(const char *number);
* @param[in] location: location of the number in the memory
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: a memory call placing is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -471,8 +478,8 @@ esp_err_t esp_hf_client_dial_memory(int location);
* ESP_HF_CHLD_TYPE_REL_X or ESP_HF_CHLD_TYPE_PRIV_X
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: command AT+CHLD is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -486,8 +493,8 @@ esp_err_t esp_hf_client_send_chld_cmd(esp_hf_chld_type_t chld, int idx);
* @param[in] btrh: response and hold action to send
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: command AT+BTRH is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -499,8 +506,8 @@ esp_err_t esp_hf_client_send_btrh_cmd(esp_hf_btrh_cmd_t btrh);
* As a precondition to use this API, Service Level Connection shall exist with AG.
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: a call answering is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -508,12 +515,12 @@ esp_err_t esp_hf_client_answer_call(void);
/**
*
* @brief Reject an incoming call(send AT+CHUP command).
* @brief Reject an incoming call or terminate an ongoing call(send AT+CHUP command).
* As a precondition to use this API, Service Level Connection shall exist with AG.
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: the call rejecting is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -525,8 +532,8 @@ esp_err_t esp_hf_client_reject_call(void);
* As a precondition to use this API, Service Level Connection shall exist with AG.
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: query of current calls is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -538,8 +545,8 @@ esp_err_t esp_hf_client_query_current_calls(void);
* As a precondition to use this API, Service Level Connection shall exist with AG.
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: query of current operator name is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -551,8 +558,8 @@ esp_err_t esp_hf_client_query_current_operator_name(void);
* As a precondition to use this API, Service Level Connection shall exist with AG
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: the retrieving of subscriber information is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -566,8 +573,8 @@ esp_err_t esp_hf_client_retrieve_subscriber_info(void);
* @param[in] code: dtmf code, single ascii character in the set 0-9, #, *, A-D
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: the DTMF codes are sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -579,8 +586,8 @@ esp_err_t esp_hf_client_send_dtmf(char code);
* As a precondition to use this API, Service Level Connection shall exist with AG.
*
* @return
* - ESP_OK: disconnect request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_OK: the phone number request corresponding to last voice tag recorded is sent to lower layer
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -593,7 +600,7 @@ esp_err_t esp_hf_client_request_last_voice_tag_number(void);
*
* @return
* - ESP_OK: NREC=0 request is sent to lower layer
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
@@ -610,13 +617,29 @@ esp_err_t esp_hf_client_send_nrec(void);
*
* @return
* - ESP_OK: success
* - ESP_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: if callback is a NULL function pointer
*
*/
esp_err_t esp_hf_client_register_data_callback(esp_hf_client_incoming_data_cb_t recv,
esp_hf_client_outgoing_data_cb_t send);
/**
*
* @brief Get the number of packets received and sent
* This function is only used in the case that Voice Over HCI is enabled and the audio state is connected.
* When the operation is completed, the callback function will be called with ESP_HF_CLIENT_PKT_STAT_NUMS_GET_EVT.
*
* @param[in] sync_conn_handle: the (e)SCO connection handle
*
* @return
* - ESP_OK: if the request is sent successfully
* - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled
* - ESP_FAIL: others
*
*/
esp_err_t esp_hf_client_pkt_stat_nums_get(uint16_t sync_conn_handle);
/**
* @brief Trigger the lower-layer to fetch and send audio data.
* This function is only only used in the case that Voice Over HCI is enabled. After this

View File

@@ -159,7 +159,7 @@ typedef enum {
/// +CNUM service type of the phone number
typedef enum {
ESP_HF_SUBSCRIBER_SERVICE_TYPE_UNKNOWN = 0, /*!< unknown */
ESP_HF_SUBSCRIBER_SERVICE_TYPE_VOICE, /*!< voice service */
ESP_HF_SUBSCRIBER_SERVICE_TYPE_VOICE = 4, /*!< voice service */
ESP_HF_SUBSCRIBER_SERVICE_TYPE_FAX, /*!< fax service */
} esp_hf_subscriber_service_type_t;

View File

@@ -577,6 +577,14 @@ void bta_dm_disable (tBTA_DM_MSG *p_data)
bta_dm_disable_search_and_disc();
bta_dm_cb.disabling = TRUE;
#if BLE_INCLUDED == TRUE
/* reset scan activity status*/
btm_cb.ble_ctr_cb.scan_activity = 0;
/* reset advertising activity status*/
btm_cb.ble_ctr_cb.inq_var.state = 0;
#endif
#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
BTM_BleClearBgConnDev();
#endif
@@ -5633,6 +5641,16 @@ void btm_dm_ble_multi_adv_disable(tBTA_DM_MSG *p_data)
p_data->ble_multi_adv_disable.inst_id, p_ref, BTA_FAILURE);
}
}
void bta_dm_ble_gap_clear_adv(tBTA_DM_MSG *p_data)
{
if (BTM_BleClearAdv(p_data->ble_clear_adv.p_clear_adv_cback) == FALSE) {
if (p_data->ble_clear_adv.p_clear_adv_cback) {
(*p_data->ble_clear_adv.p_clear_adv_cback)(BTA_FAILURE);
}
}
}
#if (BLE_50_FEATURE_SUPPORT == TRUE)
void bta_dm_ble_gap_read_phy(tBTA_DM_MSG *p_data)
{

View File

@@ -1744,6 +1744,29 @@ extern void BTA_DmBleBroadcast (BOOLEAN start, tBTA_START_STOP_ADV_CMPL_CBACK *p
}
}
/*******************************************************************************
**
** Function BTA_DmBleClearAdv
**
** Description This function is called to clear Advertising
**
** Parameters p_adv_data_cback : clear adv complete callback.
**
** Returns None
**
*******************************************************************************/
void BTA_DmBleClearAdv (tBTA_CLEAR_ADV_CMPL_CBACK *p_clear_adv_cback)
{
tBTA_DM_API_CLEAR_ADV *p_msg;
if ((p_msg = (tBTA_DM_API_CLEAR_ADV *)
osi_malloc(sizeof(tBTA_DM_API_CLEAR_ADV))) != NULL) {
p_msg->hdr.event = BTA_DM_API_BLE_CLEAR_ADV_EVT;
p_msg->p_clear_adv_cback = p_clear_adv_cback;
bta_sys_sendmsg(p_msg);
}
}
#endif
/*******************************************************************************
**

View File

@@ -361,7 +361,7 @@ void bta_dm_co_ble_io_req(BD_ADDR bd_addr, tBTA_IO_CAP *p_io_cap,
*p_resp_key = bte_appl_cfg.ble_resp_key;
}
if (bte_appl_cfg.ble_max_key_size > 7 && bte_appl_cfg.ble_max_key_size <= 16) {
if (bte_appl_cfg.ble_max_key_size >= 7 && bte_appl_cfg.ble_max_key_size <= 16) {
*p_max_key_size = bte_appl_cfg.ble_max_key_size;
}
#endif ///SMP_INCLUDED == TRUE
@@ -389,7 +389,7 @@ void bta_dm_co_ble_set_init_key_req(UINT8 init_key)
{
#if (SMP_INCLUDED == TRUE)
init_key &= 0x0f; // 4~7bit reservd, only used the 0~3bit
bte_appl_cfg.ble_init_key &= init_key;
bte_appl_cfg.ble_init_key = init_key;
#endif ///SMP_INCLUDED == TRUE
}
@@ -397,7 +397,7 @@ void bta_dm_co_ble_set_rsp_key_req(UINT8 rsp_key)
{
#if (SMP_INCLUDED == TRUE)
rsp_key &= 0x0f; // 4~7bit reservd, only used the 0~3bit
bte_appl_cfg.ble_resp_key &= rsp_key;
bte_appl_cfg.ble_resp_key = rsp_key;
#endif ///SMP_INCLUDED == TRUE
}

View File

@@ -209,6 +209,9 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
bta_dm_ble_gap_periodic_adv_set_info_trans, /* BTA_DM_API_PERIODIC_ADV_SET_INFO_TRANS_EVT */
bta_dm_ble_gap_set_periodic_adv_sync_trans_params, /* BTA_DM_API_SET_PERIODIC_ADV_SYNC_TRANS_PARAMS_EVT */
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
#if BLE_INCLUDED == TRUE
bta_dm_ble_gap_clear_adv, /* BTA_DM_API_BLE_CLEAR_ADV_EVT */
#endif
};

View File

@@ -34,13 +34,13 @@
void bta_dm_set_qos(tBTA_DM_MSG *p_data)
{
FLOW_SPEC p_flow = {
.qos_flags = 0, /* TBD */
.service_type = GUARANTEED, /* see below */
.token_rate = 0, /* bytes/second */
.token_bucket_size = 0, /* bytes */
.peak_bandwidth = 0, /* bytes/second */
.latency = 625 * p_data->qos_set.t_poll, /* microseconds */
.delay_variation = 0xFFFFFFFF /* microseconds */
.qos_flags = 0, /* TBD */
.service_type = NO_TRAFFIC, /* service_type */
.token_rate = 0, /* bytes/second */
.token_bucket_size = 0, /* bytes */
.peak_bandwidth = 0, /* bytes/second */
.latency = 625 * p_data->qos_set.t_poll, /* microseconds */
.delay_variation = 0xFFFFFFFF /* microseconds */
};
tBTM_STATUS status = BTM_SetQoS (p_data->qos_set.bd_addr, &p_flow, p_data->qos_set.p_cb);

View File

@@ -206,6 +206,9 @@ enum {
BTA_DM_API_PERIODIC_ADV_SET_INFO_TRANS_EVT,
BTA_DM_API_SET_PERIODIC_ADV_SYNC_TRANS_PARAMS_EVT,
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
#if BLE_INCLUDED == TRUE
BTA_DM_API_BLE_CLEAR_ADV_EVT,
#endif
BTA_DM_MAX_EVT
};
@@ -842,6 +845,11 @@ typedef struct {
BD_ADDR remote_bda;
} tBTA_DM_API_BLE_DISCONNECT;
typedef struct {
BT_HDR hdr;
tBTA_CLEAR_ADV_CMPL_CBACK *p_clear_adv_cback;
} tBTA_DM_API_CLEAR_ADV;
#endif /* BLE_INCLUDED */
/* data type for BTA_DM_API_REMOVE_ACL_EVT */
@@ -1212,6 +1220,7 @@ typedef union {
tBTA_DM_API_PERIODIC_ADV_SET_INFO_TRANS ble_periodic_adv_set_info_trans;
tBTA_DM_API_SET_PAST_PARAMS ble_set_past_params;
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
tBTA_DM_API_CLEAR_ADV ble_clear_adv;
#endif
tBTA_DM_API_REMOVE_ACL remove_acl;
@@ -1643,6 +1652,8 @@ extern void btm_dm_ble_multi_adv_disable(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_multi_adv_data(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_multi_adv_upd_param(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_multi_adv_enb(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_gap_clear_adv(tBTA_DM_MSG *p_data);
#if (BLE_50_FEATURE_SUPPORT == TRUE)
extern void bta_dm_ble_gap_read_phy(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_gap_set_prefer_default_phy(tBTA_DM_MSG *p_data);

View File

@@ -122,8 +122,11 @@ void bta_gattc_reset_discover_st(tBTA_GATTC_SERV *p_srcb, tBTA_GATT_STATUS statu
static void bta_gattc_enable(tBTA_GATTC_CB *p_cb)
{
APPL_TRACE_DEBUG("bta_gattc_enable");
if (p_cb->state == BTA_GATTC_STATE_DISABLED) {
/* This is a workaround because the task priority of btc (BTA_GATTC_CLOSE_EVT
in that task) is lower than the priority of the btu task.
Consequently, the p_cb->state fails to be restored to BTA_GATTC_STATE_DISABLED
and remains in the BTA_GATTC_STATE_DISABLING state. */
if (p_cb->state == BTA_GATTC_STATE_DISABLED || p_cb->state == BTA_GATTC_STATE_DISABLING) {
/* initialize control block */
memset(&bta_gattc_cb, 0, sizeof(tBTA_GATTC_CB));
bta_gattc_cb.auto_disc = true;
@@ -200,7 +203,11 @@ void bta_gattc_register(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_data)
cb_data.reg_oper.status = BTA_GATT_NO_RESOURCES;
/* check if GATTC module is already enabled . Else enable */
if (p_cb->state == BTA_GATTC_STATE_DISABLED) {
/* This is a workaround because the task priority of btc (BTA_GATTC_CLOSE_EVT
in that task) is lower than the priority of the btu task.
Consequently, the p_cb->state fails to be restored to BTA_GATTC_STATE_DISABLED
and remains in the BTA_GATTC_STATE_DISABLING state. */
if (p_cb->state == BTA_GATTC_STATE_DISABLED || p_cb->state == BTA_GATTC_STATE_DISABLING) {
bta_gattc_enable (p_cb);
}
/* todo need to check duplicate uuid */

View File

@@ -932,7 +932,7 @@ tBTA_GATT_STATUS BTA_GATTC_RegisterForNotifications (tBTA_GATTC_IF client_if,
}
if (i == BTA_GATTC_NOTIF_REG_MAX) {
status = BTA_GATT_NO_RESOURCES;
APPL_TRACE_ERROR("Max Notification Reached, registration failed.");
APPL_TRACE_ERROR("Max Notification Reached, registration failed,see CONFIG_BT_GATTC_NOTIF_REG_MAX in menuconfig");
}
}
} else {

View File

@@ -510,6 +510,10 @@ UINT8 bta_gattc_co_find_hash_in_cache(hash_key_t hash_key)
UINT8 bta_gattc_co_get_addr_num(void)
{
if (cache_env == NULL) {
return 0;
}
return cache_env->num_addr;
}

View File

@@ -534,4 +534,17 @@ void bta_gattc_deinit(void)
FREE_AND_RESET(bta_gattc_cb_ptr);
#endif /* #if BTA_DYNAMIC_MEMORY */
}
uint8_t bta_gattc_cl_rcb_active_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < BTA_GATTC_CL_MAX; i ++) {
if (bta_gattc_cb.cl_rcb[i].in_use) {
count++;
}
}
return count;
}
#endif /* GATTC_INCLUDED == TRUE && BLE_INCLUDED == TRUE */

View File

@@ -679,7 +679,7 @@ BOOLEAN bta_gattc_mark_bg_conn (tBTA_GATTC_IF client_if, BD_ADDR_PTR remote_bda
#if (!CONFIG_BT_STACK_NO_LOG)
char bdstr[18] = {0};
#endif
APPL_TRACE_ERROR("%s unable to find the bg connection mask for: %s", __func__,
APPL_TRACE_WARNING("%s unable to find the bg connection mask for: %s", __func__,
bdaddr_to_string((bt_bdaddr_t *)remote_bda_ptr, bdstr, sizeof(bdstr)));
}
return FALSE;

View File

@@ -495,11 +495,11 @@ void bta_gatts_add_char_descr(tBTA_GATTS_SRVC_CB *p_srvc_cb, tBTA_GATTS_DATA *p_
/*******************************************************************************
**
** Function bta_gatts_add_char_descr
** Function bta_gatts_set_attr_value
**
** Description action function to add characteristic descriptor.
** Description This function is used to set the attribute value.
**
** Returns none.
** Returns None.
**
*******************************************************************************/
void bta_gatts_set_attr_value(tBTA_GATTS_SRVC_CB *p_srvc_cb, tBTA_GATTS_DATA *p_msg)
@@ -526,8 +526,23 @@ void bta_gatts_set_attr_value(tBTA_GATTS_SRVC_CB *p_srvc_cb, tBTA_GATTS_DATA *p_
}
}
/*******************************************************************************
**
** Function bta_gatts_get_attr_value
**
** Description This function retrieves the attribute value associated with
** the given attribute handle.
**
** Returns tGATT_STATUS - GATT status indicating success or failure in
** retrieving the attribute value.
**
*******************************************************************************/
tGATT_STATUS bta_gatts_get_attr_value(UINT16 attr_handle, UINT16 *length, UINT8 **value)
{
if (GATTS_GetAttributeValueInternal(attr_handle, length, value) == 0) {
return 0;
}
return GATTS_GetAttributeValue(attr_handle, length, value);
}

View File

@@ -152,4 +152,17 @@ void bta_gatts_deinit(void)
#endif /* #if BTA_DYNAMIC_MEMORY */
}
uint8_t bta_gatts_srvc_active_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < BTA_GATTS_MAX_SRVC_NUM; i ++) {
if (bta_gatts_cb.srvc_cb[i].in_use) {
count++;
}
}
return count;
}
#endif /* GATTS_INCLUDED */

View File

@@ -319,10 +319,6 @@ typedef struct {
bool update_incl_srvc;
} tBTA_GATTC_SERV;
#ifndef BTA_GATTC_NOTIF_REG_MAX
#define BTA_GATTC_NOTIF_REG_MAX BTA_GATTC_CONN_MAX
#endif
typedef struct {
BOOLEAN in_use;
BD_ADDR remote_bda;

View File

@@ -397,10 +397,6 @@ void bta_ag_rfc_close(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
bta_sys_conn_close(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
/* call close call-out */
#if (BTM_SCO_HCI_INCLUDED == TRUE)
bta_ag_sco_co_close();
#endif
/* call close cback */
(*bta_ag_cb.p_cback)(BTA_AG_CLOSE_EVT, (tBTA_AG *) &close);
@@ -785,14 +781,17 @@ void bta_ag_rcvd_slc_ready(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
void bta_ag_setcodec(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
#if (BTM_WBS_INCLUDED == TRUE)
UINT16 handle = p_data->api_setcodec.hdr.layer_specific;
tBTA_AG_PEER_CODEC codec_type = p_data->api_setcodec.codec;
tBTA_AG_VAL val;
val.hdr.handle = handle;
val.num = codec_type;
/* Check if the requested codec type is valid */
if((codec_type != BTA_AG_CODEC_NONE) &&
(codec_type != BTA_AG_CODEC_CVSD) &&
(codec_type != BTA_AG_CODEC_MSBC)) {
val.num = codec_type;
val.hdr.status = BTA_AG_FAIL_RESOURCES;
APPL_TRACE_ERROR("%s error: unsupported codec type %d", __func__, codec_type);
(*bta_ag_cb.p_cback)(BTA_AG_WBS_EVT, (tBTA_AG *) &val);
@@ -804,11 +803,9 @@ void bta_ag_setcodec(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
(codec_type == BTA_AG_CODEC_CVSD)) {
p_scb->sco_codec = codec_type;
p_scb->codec_updated = TRUE;
val.num = codec_type;
val.hdr.status = BTA_AG_SUCCESS;
APPL_TRACE_DEBUG("%s: Updated codec type %d", __func__, codec_type);
} else {
val.num = codec_type;
val.hdr.status = BTA_AG_FAIL_RESOURCES;
APPL_TRACE_ERROR("%s error: unsupported codec type %d",__func__, codec_type);
}

View File

@@ -245,7 +245,6 @@ void BTA_AgAudioClose(UINT16 handle)
}
}
/*******************************************************************************
**
** Function BTA_AgResult
@@ -297,7 +296,30 @@ void BTA_AgSetCodec(UINT16 handle, tBTA_AG_PEER_CODEC codec)
}
}
#if (BTM_SCO_HCI_INCLUDED == TRUE )
#if (BTM_SCO_HCI_INCLUDED == TRUE)
/*******************************************************************************
**
** Function BTA_AgPktStatsNumsGet
**
** Description Specify the sync_conn_handle to be used for the packet numbers
** received or send.
**
**
** Returns void
**
*******************************************************************************/
void BTA_AgPktStatsNumsGet(UINT16 handle, UINT16 sync_conn_handle)
{
tBTA_AG_PKT_STAT_GET *p_buf;
if ((p_buf = (tBTA_AG_PKT_STAT_GET *) osi_malloc(sizeof(tBTA_AG_PKT_STAT_GET))) != NULL) {
p_buf->hdr.event = BTA_AG_PKT_STAT_NUMS_GET_EVT;
p_buf->hdr.layer_specific = handle;
p_buf->sync_conn_handle = sync_conn_handle;
bta_sys_sendmsg(p_buf);
}
}
/************************************************************************************************
* Function BTA_AgCiData
*
@@ -317,6 +339,6 @@ void BTA_AgCiData(UINT16 handle)
bta_sys_sendmsg(p_buf);
}
}
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE ) */
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE) */
#endif /* #if (BTA_AG_INCLUDED == TRUE)*/

View File

@@ -146,6 +146,14 @@ enum
BTA_AG_HF_CMD_BAC
};
/* dialing type of BTA_AG_HF_CMD_D */
enum
{
BTA_AG_HF_DIAL_NUM = 0,
BTA_AG_HF_DIAL_VOIP,
BTA_AG_HF_DIAL_MEM,
};
/* HFP AT command interpreter table */
const tBTA_AG_AT_CMD bta_ag_hfp_cmd[] =
{
@@ -856,6 +864,8 @@ void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
case BTA_AG_HF_CMD_D:
{
UINT16 src = 0;
UINT16 dst = 0;
/* Do not send OK for Dial cmds Let application decide whether to send OK or ERROR*/
/* if mem dial cmd, make sure string contains only digits */
if(p_arg[0] == '>') {
@@ -863,6 +873,8 @@ void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
event = 0;
bta_ag_send_error(p_scb, BTA_AG_ERR_INV_CHAR_IN_DSTR);
}
val.value = BTA_AG_HF_DIAL_MEM;
src = 1;
} else if (p_arg[0] == 'V') {
/* ATDV : Dial VoIP Call */
/* We do not check string. Code will be added later if needed. */
@@ -870,6 +882,7 @@ void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
event = 0;
bta_ag_send_error(p_scb, BTA_AG_ERR_OP_NOT_SUPPORTED);
}
val.value = BTA_AG_HF_DIAL_VOIP;
} else {
/* If dial cmd, make sure string contains only dial digits
** Dial digits are 0-9, A-C, *, #, + */
@@ -877,6 +890,17 @@ void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
event = 0;
bta_ag_send_error(p_scb, BTA_AG_ERR_INV_CHAR_IN_DSTR);
}
val.value = BTA_AG_HF_DIAL_NUM;
}
if (event != 0) {
while ((val.str[dst] = p_arg[src]) != '\0') {
if (val.str[dst] == ';') {
val.str[dst] = '\0';
break;
}
src++;
dst++;
}
}
break;
}
@@ -1498,7 +1522,6 @@ void bta_ag_hfp_result(tBTA_AG_SCB *p_scb, tBTA_AG_API_RESULT *p_result)
if (p_result->data.ok_flag != BTA_AG_OK_ERROR) {
if (p_result->data.str[0] != 0) {
bta_ag_send_result(p_scb, code, p_result->data.str, 0);
bta_ag_send_ok(p_scb);
}
if (p_result->data.ok_flag == BTA_AG_OK_DONE) {
bta_ag_send_ok(p_scb);

View File

@@ -91,6 +91,7 @@ enum
BTA_AG_CI_SCO_DATA,
BTA_AG_CI_RX_DATA,
BTA_AG_RCVD_SLC_READY,
BTA_AG_PKT_STAT_NUMS,
BTA_AG_NUM_ACTIONS
};
@@ -133,7 +134,8 @@ const tBTA_AG_ACTION bta_ag_action[] =
bta_ag_send_ring,
bta_ag_ci_sco_data,
bta_ag_ci_rx_data,
bta_ag_rcvd_slc_ready
bta_ag_rcvd_slc_ready,
bta_ag_pkt_stat_nums
};
/* state table information */
@@ -167,7 +169,8 @@ const UINT8 bta_ag_st_init[][BTA_AG_NUM_COLS] =
/* RING_TOUT_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_INIT_ST},
/* SVC_TOUT_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_INIT_ST},
/* CI_SCO_DATA_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_INIT_ST},
/* CI_SLC_READY_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_INIT_ST}
/* CI_SLC_READY_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_INIT_ST},
/* PKT_STAT_NUMS_GET_EVT */ {BTA_AG_PKT_STAT_NUMS, BTA_AG_IGNORE, BTA_AG_INIT_ST}
};
/* state table for opening state */
@@ -196,7 +199,8 @@ const UINT8 bta_ag_st_opening[][BTA_AG_NUM_COLS] =
/* RING_TOUT_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_OPENING_ST},
/* SVC_TOUT_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_OPENING_ST},
/* CI_SCO_DATA_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_OPENING_ST},
/* CI_SLC_READY_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_OPENING_ST}
/* CI_SLC_READY_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_OPENING_ST},
/* PKT_STAT_NUMS_GET_EVT */ {BTA_AG_PKT_STAT_NUMS, BTA_AG_IGNORE, BTA_AG_OPENING_ST}
};
/* state table for open state */
@@ -225,7 +229,8 @@ const UINT8 bta_ag_st_open[][BTA_AG_NUM_COLS] =
/* RING_TOUT_EVT */ {BTA_AG_SEND_RING, BTA_AG_IGNORE, BTA_AG_OPEN_ST},
/* SVC_TOUT_EVT */ {BTA_AG_START_CLOSE, BTA_AG_IGNORE, BTA_AG_CLOSING_ST},
/* CI_SCO_DATA_EVT */ {BTA_AG_CI_SCO_DATA, BTA_AG_IGNORE, BTA_AG_OPEN_ST},
/* CI_SLC_READY_EVT */ {BTA_AG_RCVD_SLC_READY, BTA_AG_IGNORE, BTA_AG_OPEN_ST}
/* CI_SLC_READY_EVT */ {BTA_AG_RCVD_SLC_READY, BTA_AG_IGNORE, BTA_AG_OPEN_ST},
/* PKT_STAT_NUMS_GET_EVT */ {BTA_AG_PKT_STAT_NUMS, BTA_AG_IGNORE, BTA_AG_OPEN_ST}
};
/* state table for closing state */
@@ -254,7 +259,8 @@ const UINT8 bta_ag_st_closing[][BTA_AG_NUM_COLS] =
/* RING_TOUT_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_CLOSING_ST},
/* SVC_TOUT_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_CLOSING_ST},
/* CI_SCO_DATA_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_CLOSING_ST},
/* CI_SLC_READY_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_CLOSING_ST}
/* CI_SLC_READY_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_CLOSING_ST},
/* PKT_STAT_NUMS_GET_EVT */ {BTA_AG_PKT_STAT_NUMS, BTA_AG_IGNORE, BTA_AG_CLOSING_ST}
};
/* type for state table */
@@ -357,6 +363,8 @@ static char *bta_ag_evt_str(UINT16 event, tBTA_AG_RES result)
return "SCO data Callin";
case BTA_AG_CI_SLC_READY_EVT:
return "SLC Ready Callin";
case BTA_AG_PKT_STAT_NUMS_GET_EVT:
return "Get Packet Nums";
default:
return "Unknown AG Event";
}

View File

@@ -342,7 +342,7 @@ static void bta_ag_sco_read_cback(UINT16 sco_inx, BT_HDR *p_data, tBTM_SCO_DATA_
{
if (status != BTM_SCO_DATA_CORRECT)
{
APPL_TRACE_WARNING("bta_ag_sco_read_cback: status(%d)", status);
APPL_TRACE_DEBUG("bta_ag_sco_read_cback: status(%d)", status);
}
/* Callout function must free the data. */
@@ -475,6 +475,7 @@ static void bta_ag_cback_sco(tBTA_AG_SCB *p_scb, UINT8 event)
sco.handle = bta_ag_scb_to_idx(p_scb);
sco.app_id = p_scb->app_id;
sco.sync_conn_handle = BTM_ReadScoHandle(p_scb->sco_idx);
/* call close cback */
(*bta_ag_cb.p_cback)(event, (tBTA_AG *) &sco);
@@ -1477,6 +1478,32 @@ void bta_ag_sco_codec_nego(tBTA_AG_SCB *p_scb, BOOLEAN result)
}
#endif
/*******************************************************************************
**
** Function bta_ag_pkt_stat_nums
**
** Description Get the number of packet states
**
**
** Returns void
**
*******************************************************************************/
void bta_ag_pkt_stat_nums(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
UNUSED(p_scb);
#if (BTM_SCO_HCI_INCLUDED == TRUE)
tBTA_AG_PKT_STAT_NUMS pkt_stat_nums;
uint16_t sync_conn_handle = p_data->pkt_stat.sync_conn_handle;
BTM_PktStatNumsGet(sync_conn_handle, (tBTM_SCO_PKT_STAT_NUMS *) &pkt_stat_nums);
/* call app cback */
if (bta_ag_cb.p_cback) {
(*bta_ag_cb.p_cback)(BTA_AG_PKT_NUMS_GET_EVT, (tBTA_AG*) &pkt_stat_nums);
}
#endif
}
/*******************************************************************************
**
** Function bta_ag_sco_shutdown

View File

@@ -243,13 +243,16 @@ void bta_ag_del_records(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
UNUSED(p_data);
/* get services of all other registered servers */
for (i = 0; i < BTA_AG_NUM_IDX; i++, p++) {
for (i = 0; i < BTA_AG_NUM_IDX; i++) {
if (p_scb == p) {
continue;
}
if (p->in_use && p->dealloc == FALSE) {
others |= p->reg_services;
}
if (i < BTA_AG_NUM_SCB) {
p++;
}
}
others >>= BTA_HSP_SERVICE_ID;
services = p_scb->reg_services >> BTA_HSP_SERVICE_ID;

View File

@@ -113,6 +113,7 @@ enum
BTA_AG_SVC_TOUT_EVT,
BTA_AG_CI_SCO_DATA_EVT,
BTA_AG_CI_SLC_READY_EVT,
BTA_AG_PKT_STAT_NUMS_GET_EVT,
BTA_AG_MAX_EVT,
/* these events are handled outside of the state machine */
@@ -218,6 +219,13 @@ typedef struct
char p_data[BTA_AG_MTU+1];
} tBTA_AG_CI_RX_WRITE;
/* data type for BTA_AG_PKT_STAT_NUMS_GET_EVT */
typedef struct
{
BT_HDR hdr;
UINT16 sync_conn_handle;
} tBTA_AG_PKT_STAT_GET;
/* union of all event datatypes */
typedef union
{
@@ -232,6 +240,7 @@ typedef union
tBTA_AG_DISC_RESULT disc_result;
tBTA_AG_RFC rfc;
tBTA_AG_CI_RX_WRITE ci_rx_write;
tBTA_AG_PKT_STAT_GET pkt_stat;
} tBTA_AG_DATA;
/* type for each profile */
@@ -276,7 +285,7 @@ typedef struct
tBTA_AG_SCO_MSBC_SETTINGS codec_msbc_settings; /* settings to be used for the impending eSCO */
TIMER_LIST_ENT cn_timer; /* codec negotiation timer */
#endif
UINT16 sco_idx; /* SCO handle */
UINT16 sco_idx; /* SCO connection index */
BOOLEAN in_use; /* scb in use */
BOOLEAN dealloc; /* TRUE if service shutting down */
BOOLEAN clip_enabled; /* set to TRUE if HF enables CLIP reporting */
@@ -437,6 +446,7 @@ extern void bta_ag_ci_sco_data(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
extern void bta_ag_set_esco_param(BOOLEAN set_reset, tBTM_ESCO_PARAMS *param);
extern void bta_ag_ci_rx_data(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
extern void bta_ag_rcvd_slc_ready(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
extern void bta_ag_pkt_stat_nums(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
#endif /* #if (BTA_AG_INCLUDED == TRUE) */

View File

@@ -61,7 +61,8 @@ static const uint8_t bta_hf_client_cb_data_size[] = {
sizeof(tBTA_HF_CLIENT_VAL), // #define BTA_HF_CLIENT_BSIR_EVT 19
sizeof(tBTA_HF_CLIENT_NUMBER), // #define BTA_HF_CLIENT_BINP_EVT 20
sizeof(tBTA_HF_CLIENT_VAL), // #define BTA_HF_CLIENT_RING_INDICATION 21
0, // #define BTA_HF_CLIENT_DISABLE_EVT 30
0, // #define BTA_HF_CLIENT_DISABLE_EVT 22
sizeof(tBTA_SCO_PKT_STAT_NUMS), // #define BTA_HF_CLIENT_PKT_STAT_NUMS_GET_EVT 23
};
/*****************************************************************************
** External Function Declarations
@@ -294,7 +295,28 @@ void BTA_HfClientSendAT(UINT16 handle, tBTA_HF_CLIENT_AT_CMD_TYPE at, UINT32 val
bta_sys_sendmsg(p_buf);
}
}
#if (BTM_SCO_HCI_INCLUDED == TRUE )
#if (BTM_SCO_HCI_INCLUDED == TRUE)
/*******************************************************************************
**
** Function BTA_HfClientPktStatsNumsGet
**
** Description Get the packet ststus numbers received and send for a specific (e)SCO connection handle.
**
**
** Returns void
**
*******************************************************************************/
void BTA_HfClientPktStatsNumsGet(UINT16 sync_conn_handle)
{
tBTA_HF_CLIENT_PKT_STAT_GET *p_buf;
if ((p_buf = (tBTA_HF_CLIENT_PKT_STAT_GET *) osi_malloc(sizeof(tBTA_HF_CLIENT_PKT_STAT_GET))) != NULL) {
p_buf->hdr.event = BTA_HF_CLIENT_PKT_NUMS_GET_EVT;
p_buf->sync_conn_handle = sync_conn_handle;
bta_sys_sendmsg(p_buf);
}
}
void BTA_HfClientCiData(void)
{
BT_HDR *p_buf;

View File

@@ -75,6 +75,7 @@ enum {
BTA_HF_CLIENT_SEND_AT_CMD,
#if (BTM_SCO_HCI_INCLUDED == TRUE)
BTA_HF_CLIENT_CI_SCO_DATA,
BTA_HF_CLIENT_PKT_STAT_NUMS,
#endif
BTA_HF_CLIENT_NUM_ACTIONS,
};
@@ -111,8 +112,9 @@ const tBTA_HF_CLIENT_ACTION bta_hf_client_action[] = {
/* BTA_HF_CLIENT_DISC_ACP_RES */ bta_hf_client_disc_acp_res,
/* BTA_HF_CLIENT_SVC_CONN_OPEN */ bta_hf_client_svc_conn_open,
/* BTA_HF_CLIENT_SEND_AT_CMD */ bta_hf_client_send_at_cmd,
#if (BTM_SCO_HCI_INCLUDED == TRUE )
#if (BTM_SCO_HCI_INCLUDED == TRUE)
/* BTA_HF_CLIENT_CI_SCO_DATA */ bta_hf_client_ci_sco_data,
/* BTA_HF_CLIENT_PKT_STAT_NUMS */ bta_hf_client_pkt_stat_nums,
#endif /* (BTM_SCO_HCI_INCLUDED == TRUE ) */
};
@@ -143,6 +145,7 @@ const UINT8 bta_hf_client_st_init[][BTA_HF_CLIENT_NUM_COLS] = {
/* SEND_AT_CMD_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_INIT_ST},
#if (BTM_SCO_HCI_INCLUDED == TRUE )
/* CI_SCO_DATA_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_INIT_ST},
/* PKT_STAT_NUMS_GET_EVT */ {BTA_HF_CLIENT_PKT_STAT_NUMS, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_INIT_ST},
#endif /* (BTM_SCO_HCI_INCLUDED == TRUE ) */
};
@@ -166,8 +169,9 @@ const UINT8 bta_hf_client_st_opening[][BTA_HF_CLIENT_NUM_COLS] = {
/* SCO_OPEN_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPENING_ST},
/* SCO_CLOSE_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPENING_ST},
/* SEND_AT_CMD_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPENING_ST},
#if (BTM_SCO_HCI_INCLUDED == TRUE )
#if (BTM_SCO_HCI_INCLUDED == TRUE)
/* CI_SCO_DATA_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPENING_ST},
/* PKT_STAT_NUMS_GET_EVT */ {BTA_HF_CLIENT_PKT_STAT_NUMS, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPENING_ST},
#endif /* (BTM_SCO_HCI_INCLUDED == TRUE ) */
};
@@ -193,6 +197,7 @@ const UINT8 bta_hf_client_st_open[][BTA_HF_CLIENT_NUM_COLS] = {
/* SEND_AT_CMD_EVT */ {BTA_HF_CLIENT_SEND_AT_CMD, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPEN_ST},
#if (BTM_SCO_HCI_INCLUDED == TRUE )
/* CI_SCO_DATA_EVT */ {BTA_HF_CLIENT_CI_SCO_DATA, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPEN_ST},
/* PKT_STAT_NUMS_GET_EVT */ {BTA_HF_CLIENT_PKT_STAT_NUMS, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPEN_ST},
#endif /* (BTM_SCO_HCI_INCLUDED == TRUE ) */
};
@@ -218,6 +223,7 @@ const UINT8 bta_hf_client_st_closing[][BTA_HF_CLIENT_NUM_COLS] = {
/* SEND_AT_CMD_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_CLOSING_ST},
#if (BTM_SCO_HCI_INCLUDED == TRUE )
/* CI_SCO_DATA_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_CLOSING_ST},
/* PKT_STAT_NUMS_GET_EVT */ {BTA_HF_CLIENT_PKT_STAT_NUMS, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_CLOSING_ST},
#endif /* (BTM_SCO_HCI_INCLUDED == TRUE ) */
};
@@ -640,6 +646,7 @@ static char *bta_hf_client_evt_str(UINT16 event)
CASE_RETURN_STR(BTA_HF_CLIENT_SCO_OPEN_EVT)
CASE_RETURN_STR(BTA_HF_CLIENT_SCO_CLOSE_EVT)
CASE_RETURN_STR(BTA_HF_CLIENT_SEND_AT_CMD_EVT)
CASE_RETURN_STR(BTA_HF_CLIENT_PKT_NUMS_GET_EVT)
default:
return "Unknown HF Client Event";
}

View File

@@ -155,6 +155,7 @@ void bta_hf_client_cback_sco(UINT8 event)
tBTA_HF_CLIENT_HDR evt;
memset(&evt, 0, sizeof(evt));
evt.sync_conn_handle = BTM_ReadScoHandle(bta_hf_client_cb.scb.sco_idx);
/* call app cback */
(*bta_hf_client_cb.p_cback)(event, (tBTA_HF_CLIENT_HDR *) &evt);
@@ -237,7 +238,29 @@ static void bta_hf_client_sco_conn_rsp(tBTM_ESCO_CONN_REQ_EVT_DATA *p_data)
BTM_EScoConnRsp(p_data->sco_inx, hci_status, &resp);
}
#if (BTM_SCO_HCI_INCLUDED == TRUE )
#if (BTM_SCO_HCI_INCLUDED == TRUE)
/*******************************************************************************
**
** Function bta_hf_client_pkt_stat_nums
**
** Description Get the packet status number
**
**
** Returns void
**
*******************************************************************************/
void bta_hf_client_pkt_stat_nums(tBTA_HF_CLIENT_DATA *p_data)
{
tBTA_SCO_PKT_STAT_NUMS pkt_stat_nums;
uint16_t sync_conn_handle = p_data->pkt_stat.sync_conn_handle;
BTM_PktStatNumsGet(sync_conn_handle, (tBTM_SCO_PKT_STAT_NUMS *) &pkt_stat_nums);
/* call app cback */
if (bta_hf_client_cb.p_cback) {
(*bta_hf_client_cb.p_cback)(BTA_HF_CLIENT_PKT_STAT_NUMS_GET_EVT, (void*) &pkt_stat_nums);
}
}
/*******************************************************************************
**
** Function bta_hf_client_ci_sco_data
@@ -254,6 +277,7 @@ void bta_hf_client_ci_sco_data(tBTA_HF_CLIENT_DATA *p_data)
bta_hf_client_sco_event(BTA_HF_CLIENT_SCO_CI_DATA_E);
}
#endif
/*******************************************************************************
**
** Function bta_hf_client_sco_connreq_cback

View File

@@ -26,15 +26,6 @@
/* ASCII character string of arguments to the AT command */
#define BTA_HF_CLIENT_AT_MAX_LEN 512
/* AT command table element */
typedef struct {
const char *p_cmd; /* AT command string */
UINT8 arg_type; /* allowable argument type syntax */
UINT8 fmt; /* whether arg is int or string */
UINT8 min; /* minimum value for int arg */
INT16 max; /* maximum value for int arg */
} tBTA_AG_AT_CMD;
/* callback function executed when command is parsed */
typedef void (tBTA_AG_AT_CMD_CBACK)(void *p_user, UINT16 cmd, UINT8 arg_type,
char *p_arg, INT16 int_arg);

View File

@@ -64,6 +64,7 @@ enum {
BTA_HF_CLIENT_SEND_AT_CMD_EVT,
#if (BTM_SCO_HCI_INCLUDED == TRUE )
BTA_HF_CLIENT_CI_SCO_DATA_EVT,
BTA_HF_CLIENT_PKT_NUMS_GET_EVT,
#endif /* (BTM_SCO_HCI_INCLUDED == TRUE ) */
BTA_HF_CLIENT_MAX_EVT,
@@ -120,6 +121,12 @@ typedef struct {
char str[BTA_HF_CLIENT_NUMBER_LEN + 1];
} tBTA_HF_CLIENT_DATA_VAL;
/* data type for BTA_HF_CLIENT_PKT_NUMS_GET_EVT */
typedef struct {
BT_HDR hdr;
UINT16 sync_conn_handle;
} tBTA_HF_CLIENT_PKT_STAT_GET;
/* union of all event datatypes */
typedef union {
BT_HDR hdr;
@@ -129,6 +136,7 @@ typedef union {
tBTA_HF_CLIENT_DISC_RESULT disc_result;
tBTA_HF_CLIENT_RFC rfc;
tBTA_HF_CLIENT_DATA_VAL val;
tBTA_HF_CLIENT_PKT_STAT_GET pkt_stat;
} tBTA_HF_CLIENT_DATA;
@@ -299,6 +307,7 @@ extern void bta_hf_client_binp(char *number);
extern void bta_hf_client_dial(tBTA_HF_CLIENT_DATA *p_data);
extern void bta_hf_client_send_at_cmd(tBTA_HF_CLIENT_DATA *p_data);
#if (BTM_SCO_HCI_INCLUDED == TRUE )
extern void bta_hf_client_pkt_stat_nums(tBTA_HF_CLIENT_DATA *p_data);
extern void bta_hf_client_ci_sco_data(tBTA_HF_CLIENT_DATA *p_data);
#endif /* (BTM_SCO_HCI_INCLUDED == TRUE ) */
#endif /* #if (BTA_HF_INCLUDED == TRUE) */

View File

@@ -158,6 +158,8 @@ typedef UINT8 tBTA_AG_RES;
#endif
#define BTA_AG_AUDIO_MSBC_OPEN_EVT 32 /* Audio connection with mSBC codec open */
#define BTA_AG_PKT_NUMS_GET_EVT 33 /* AG packet status nums */
/* Values below are for HFP only */
#define BTA_AG_AT_A_EVT 10 /* Answer a incoming call */
#define BTA_AG_AT_D_EVT 11 /* Place a call using number or memory dial */
@@ -261,15 +263,15 @@ typedef UINT8 tBTA_AG_BTRH_TYPE;
#endif
/* indicator constants HFP 1.1 and later */
#define BTA_AG_IND_CALL 0 /* position of call indicator */
#define BTA_AG_IND_CALLSETUP 1 /* position of callsetup indicator */
#define BTA_AG_IND_SERVICE 2 /* position of service indicator */
#define BTA_AG_IND_CALL 1 /* position of call indicator */
#define BTA_AG_IND_CALLSETUP 2 /* position of callsetup indicator */
#define BTA_AG_IND_SERVICE 3 /* position of service indicator */
/* indicator constants HFP 1.5 and later */
#define BTA_AG_IND_SIGNAL 3 /* position of signal strength indicator */
#define BTA_AG_IND_ROAM 4 /* position of roaming indicator */
#define BTA_AG_IND_BATTCHG 5 /* position of battery charge indicator */
#define BTA_AG_IND_CALLHELD 6 /* position of callheld indicator */
#define BTA_AG_IND_BEARER 7 /* position of bearer indicator */
#define BTA_AG_IND_SIGNAL 4 /* position of signal strength indicator */
#define BTA_AG_IND_ROAM 5 /* position of roaming indicator */
#define BTA_AG_IND_BATTCHG 6 /* position of battery charge indicator */
#define BTA_AG_IND_CALLHELD 7 /* position of callheld indicator */
#define BTA_AG_IND_BEARER 8 /* position of bearer indicator */
typedef UINT16 tBTA_AG_IND_TYPE;
/* call indicator values */
@@ -327,6 +329,7 @@ typedef struct
UINT16 handle;
UINT8 app_id;
tBTA_AG_STATUS status;
UINT16 sync_conn_handle;
} tBTA_AG_HDR;
/* data associated with BTA_AG_REGISTER_EVT */
@@ -405,6 +408,17 @@ typedef struct {
char number[BTA_AG_NUMBER_LEN + 1];
} tBTA_AG_CNUM;
/* data associated with BTA_HF_CLIENT_PKT_STAT_NUMS_GET_EVT */
typedef struct {
UINT32 rx_total;
UINT32 rx_correct;
UINT32 rx_err;
UINT32 rx_none;
UINT32 rx_lost;
UINT32 tx_total;
UINT32 tx_discarded;
} tBTA_AG_PKT_STAT_NUMS;
/* union of data associated with AG callback */
typedef union
{
@@ -421,6 +435,7 @@ typedef union
tBTA_AG_AT_RESULT result;
tBTA_AG_CLCC clcc;
tBTA_AG_CNUM cnum;
tBTA_AG_PKT_STAT_NUMS pkt_num;
} tBTA_AG;
/* AG callback */
@@ -581,6 +596,18 @@ void BTA_AgSetCodec(UINT16 handle, tBTA_AG_PEER_CODEC codec);
#if (BTM_SCO_HCI_INCLUDED == TRUE )
/*******************************************************************************
**
** Function BTA_AgPktStatsNumsGet
**
** Description Get the Number of packets status received
**
**
** Returns void
**
*******************************************************************************/
void BTA_AgPktStatsNumsGet(UINT16 handle, UINT16 sync_conn_handle);
/*******************************************************************************
**
** Function BTA_AgCiData

View File

@@ -1237,6 +1237,8 @@ typedef void (tBTA_START_STOP_SCAN_CMPL_CBACK) (tBTA_STATUS status);
typedef void (tBTA_START_STOP_ADV_CMPL_CBACK) (tBTA_STATUS status);
typedef void (tBTA_CLEAR_ADV_CMPL_CBACK) (tBTA_STATUS status);
typedef void (tBTA_BLE_TRACK_ADV_CMPL_CBACK)(int action, tBTA_STATUS status,
tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
tBTA_DM_BLE_REF_VALUE ref_value);
@@ -2611,6 +2613,19 @@ extern void BTA_DmBleSetAdvConfigRaw (UINT8 *p_raw_adv, UINT32 raw_adv_len,
void BTA_DmBleSetLongAdv (UINT8 *adv_data, UINT32 adv_data_len,
tBTA_SET_ADV_DATA_CMPL_CBACK *p_adv_data_cback);
/*******************************************************************************
**
** Function BTA_DmBleClearAdv
**
** Description This function is called to clear Advertising
**
** Parameters p_adv_data_cback : clear adv complete callback.
**
** Returns None
**
*******************************************************************************/
void BTA_DmBleClearAdv (tBTA_CLEAR_ADV_CMPL_CBACK *p_clear_adv_cback);
/*******************************************************************************
**
** Function BTA_DmBleSetScanRsp

View File

@@ -112,7 +112,8 @@ typedef UINT8 tBTA_HF_CLIENT_AT_RESULT_TYPE;
#define BTA_HF_CLIENT_BSIR_EVT 19 /* in-band ring tone setting changed event */
#define BTA_HF_CLIENT_BINP_EVT 20 /* binp number event */
#define BTA_HF_CLIENT_RING_INDICATION 21 /* HF Client ring indication */
#define BTA_HF_CLIENT_DISABLE_EVT 30 /* HF Client disabled */
#define BTA_HF_CLIENT_DISABLE_EVT 22 /* HF Client disabled */
#define BTA_HF_CLIENT_PKT_STAT_NUMS_GET_EVT 23 /* HF Client packet status nums */
typedef UINT8 tBTA_HF_CLIENT_EVT;
@@ -159,6 +160,7 @@ typedef UINT8 tBTA_HF_CLIENT_AT_CMD_TYPE;
/* data associated with most non-AT events */
/* placeholder, if not needed should be removed*/
typedef struct {
UINT16 sync_conn_handle;
} tBTA_HF_CLIENT_HDR;
/* data associated with BTA_HF_CLIENT_REGISTER_EVT */
@@ -228,6 +230,17 @@ typedef struct {
UINT16 value;
} tBTA_HF_CLIENT_VAL;
/* data associated with BTA_HF_CLIENT_PKT_STAT_NUMS_GET_EVT */
typedef struct {
UINT32 rx_total;
UINT32 rx_correct;
UINT32 rx_err;
UINT32 rx_none;
UINT32 rx_lost;
UINT32 tx_total;
UINT32 tx_discarded;
} tBTA_SCO_PKT_STAT_NUMS;
/* union of data associated with AG callback */
typedef union {
tBTA_HF_CLIENT_HDR hdr;
@@ -241,6 +254,7 @@ typedef union {
tBTA_HF_CLIENT_AT_RESULT result;
tBTA_HF_CLIENT_CLCC clcc;
tBTA_HF_CLIENT_CNUM cnum;
tBTA_SCO_PKT_STAT_NUMS pkt_num;
} tBTA_HF_CLIENT;
typedef UINT32 tBTA_HF_CLIENT_FEAT;
@@ -376,6 +390,18 @@ void BTA_HfClientAudioClose(UINT16 handle);
void BTA_HfClientSendAT(UINT16 handle, tBTA_HF_CLIENT_AT_CMD_TYPE at, UINT32 val1, UINT32 val2, const char *str);
#if (BTM_SCO_HCI_INCLUDED == TRUE )
/*******************************************************************************
**
** Function BTA_HfClientPktStatsNumsGet
**
** Description Get the Number of packets status received and send
**
**
** Returns void
**
*******************************************************************************/
void BTA_HfClientPktStatsNumsGet(UINT16 sync_conn_handle);
void BTA_HfClientCiData(void);
#endif /*#if (BTM_SCO_HCI_INCLUDED == TRUE ) */

View File

@@ -824,7 +824,7 @@ extern tBTA_JV_STATUS BTA_JvRfcommConnect(tBTA_SEC sec_mask,
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
extern tBTA_JV_STATUS BTA_JvRfcommClose(UINT32 handle, tBTA_JV_RFCOMM_CBACK *p_cback, void *user_data);
extern tBTA_JV_STATUS BTA_JvRfcommClose(UINT32 handle, void *user_data);
/*******************************************************************************
**

View File

@@ -285,11 +285,10 @@ tBTA_JV_RFC_CB *bta_jv_rfc_port_to_cb(UINT16 port_handle)
return p_cb;
}
static tBTA_JV_STATUS bta_jv_free_rfc_cb(tBTA_JV_RFC_CB *p_cb, tBTA_JV_PCB *p_pcb, BOOLEAN close_server)
static tBTA_JV_STATUS bta_jv_free_rfc_cb(tBTA_JV_RFC_CB *p_cb, tBTA_JV_PCB *p_pcb, BOOLEAN close_server, BOOLEAN close_pending)
{
tBTA_JV_STATUS status = BTA_JV_SUCCESS;
BOOLEAN remove_server = FALSE;
int close_pending = 0;
UINT8 used = 0, i, listen = 0;
tPORT_STATE port_state;
@@ -312,11 +311,11 @@ static tBTA_JV_STATUS bta_jv_free_rfc_cb(tBTA_JV_RFC_CB *p_cb, tBTA_JV_PCB *p_pc
switch (p_pcb->state) {
case BTA_JV_ST_CL_CLOSING:
case BTA_JV_ST_SR_CLOSING:
APPL_TRACE_WARNING("bta_jv_free_sr_rfc_cb: return on closing, port state:%d, "
APPL_TRACE_DEBUG("bta_jv_free_sr_rfc_cb: return on closing, port state:%d, "
"scn:%d, p_pcb:%p, user_data:%p", p_pcb->state, p_cb->scn, p_pcb,
p_pcb->user_data);
status = BTA_JV_FAILURE;
return status;
break;
case BTA_JV_ST_CL_OPEN:
case BTA_JV_ST_CL_OPENING:
APPL_TRACE_DEBUG("bta_jv_free_sr_rfc_cb: state: %d, scn:%d,"
@@ -1199,10 +1198,15 @@ void bta_jv_delete_record(tBTA_JV_MSG *p_data)
*******************************************************************************/
static void bta_jv_l2cap_client_cback(UINT16 gap_handle, UINT16 event)
{
if (gap_handle >= BTA_JV_MAX_L2C_CONN) {
APPL_TRACE_WARNING("Invalid gap_handle: %u", gap_handle);
return;
}
tBTA_JV_L2C_CB *p_cb = &bta_jv_cb.l2c_cb[gap_handle];
tBTA_JV evt_data = {0};
if (gap_handle >= BTA_JV_MAX_L2C_CONN && !p_cb->p_cback) {
if (!p_cb->p_cback) {
return;
}
@@ -1354,12 +1358,17 @@ void bta_jv_l2cap_close(tBTA_JV_MSG *p_data)
*******************************************************************************/
static void bta_jv_l2cap_server_cback(UINT16 gap_handle, UINT16 event)
{
if (gap_handle >= BTA_JV_MAX_L2C_CONN) {
APPL_TRACE_WARNING("Invalid gap_handle: %u", gap_handle);
return;
}
tBTA_JV_L2C_CB *p_cb = &bta_jv_cb.l2c_cb[gap_handle];
tBTA_JV evt_data = {0};
tBTA_JV_L2CAP_CBACK *p_cback;
void *user_data;
if (gap_handle >= BTA_JV_MAX_L2C_CONN && !p_cb->p_cback) {
if (!p_cb->p_cback) {
return;
}
@@ -1669,6 +1678,7 @@ static void bta_jv_port_mgmt_cl_cback(UINT32 code, UINT16 port_handle, void* dat
BD_ADDR rem_bda = {0};
UINT16 lcid;
tBTA_JV_RFCOMM_CBACK *p_cback; /* the callback function */
void *user_data = NULL;
APPL_TRACE_DEBUG( "bta_jv_port_mgmt_cl_cback:code:%d, port_handle%d", code, port_handle);
if (NULL == p_cb || NULL == p_cb->p_cback) {
@@ -1695,13 +1705,14 @@ static void bta_jv_port_mgmt_cl_cback(UINT32 code, UINT16 port_handle, void* dat
evt_data.rfc_close.async = FALSE;
evt_data.rfc_close.status = BTA_JV_SUCCESS;
}
//p_pcb->state = BTA_JV_ST_NONE;
//p_pcb->cong = FALSE;
p_cback = p_cb->p_cback;
p_cback(BTA_JV_RFCOMM_CLOSE_EVT, &evt_data, p_pcb->user_data);
//bta_jv_free_rfc_cb(p_cb, p_pcb);
}
user_data = p_pcb->user_data;
// To free up resources.
p_pcb->state = BTA_JV_ST_CL_CLOSING;
bta_jv_free_rfc_cb(p_cb, p_pcb, FALSE, FALSE);
p_cback(BTA_JV_RFCOMM_CLOSE_EVT, &evt_data, user_data);
}
}
/*******************************************************************************
@@ -1858,7 +1869,6 @@ void bta_jv_rfcomm_close(tBTA_JV_MSG *p_data)
tBTA_JV_API_RFCOMM_CLOSE *cc = &(p_data->rfcomm_close);
tBTA_JV_RFC_CB *p_cb = NULL;
tBTA_JV_PCB *p_pcb = NULL;
tBTA_JV evt_data = {0};
APPL_TRACE_DEBUG("%s, rfc handle:%d",__func__, cc->handle);
if (!cc->handle) {
APPL_TRACE_ERROR("%s, rfc handle is null", __func__);
@@ -1869,20 +1879,9 @@ void bta_jv_rfcomm_close(tBTA_JV_MSG *p_data)
if (!find_rfc_pcb(user_data, &p_cb, &p_pcb)) {
return;
}
if(cc->p_cback) {
evt_data.rfc_close.status = BTA_JV_SUCCESS;
evt_data.rfc_close.port_status = PORT_LOCAL_CLOSED;
evt_data.rfc_close.handle = cc->handle;
evt_data.rfc_close.async = TRUE;
if (p_pcb && (p_pcb->state == BTA_JV_ST_SR_LISTEN ||
p_pcb->state == BTA_JV_ST_SR_OPEN ||
p_pcb->state == BTA_JV_ST_CL_OPEN ||
p_pcb->state == BTA_JV_ST_CL_OPENING)) {
evt_data.rfc_close.async = FALSE;
}
cc->p_cback(BTA_JV_RFCOMM_CLOSE_EVT, (tBTA_JV *)&evt_data, user_data);
}
bta_jv_free_rfc_cb(p_cb, p_pcb, FALSE);
bta_jv_free_rfc_cb(p_cb, p_pcb, FALSE, TRUE);
APPL_TRACE_DEBUG("%s: sec id in use:%d, rfc_cb in use:%d",__func__,
get_sec_id_used(), get_rfc_cb_used());
}
@@ -1982,7 +1981,7 @@ static void bta_jv_port_mgmt_sr_cback(UINT32 code, UINT16 port_handle, void *dat
APPL_TRACE_ERROR("create new listen port, but upper layer reject connection");
p_pcb_new_listen->user_data = NULL;
p_pcb->state = BTA_JV_ST_SR_LISTEN;
bta_jv_free_rfc_cb(p_cb, p_pcb_new_listen, FALSE);
bta_jv_free_rfc_cb(p_cb, p_pcb_new_listen, FALSE, FALSE);
if (p_mgmt_cb_arg) {
p_mgmt_cb_arg->accept = FALSE;
}
@@ -2022,10 +2021,11 @@ static void bta_jv_port_mgmt_sr_cback(UINT32 code, UINT16 port_handle, void *dat
evt_data.rfc_close.async = FALSE;
evt_data.rfc_close.status = BTA_JV_SUCCESS;
}
//p_pcb->state = BTA_JV_ST_NONE;
p_cback(BTA_JV_RFCOMM_CLOSE_EVT, &evt_data, user_data);
//bta_jv_free_rfc_cb(p_cb, p_pcb);
// To free up resources.
p_pcb->state = BTA_JV_ST_SR_CLOSING;
bta_jv_free_rfc_cb(p_cb, p_pcb, FALSE, FALSE);
p_cback(BTA_JV_RFCOMM_CLOSE_EVT, &evt_data, user_data);
APPL_TRACE_DEBUG("PORT_CLOSED after BTA_JV_RFCOMM_CLOSE_EVT: curr_sess:%d, max_sess:%d",
p_cb->curr_sess, p_cb->max_sess);
}
@@ -2259,7 +2259,7 @@ void bta_jv_rfcomm_stop_server(tBTA_JV_MSG *p_data)
}
APPL_TRACE_DEBUG("bta_jv_rfcomm_stop_server: p_pcb:%p, p_pcb->port_handle:%d",
p_pcb, p_pcb->port_handle);
bta_jv_free_rfc_cb(p_cb, p_pcb, TRUE);
bta_jv_free_rfc_cb(p_cb, p_pcb, TRUE, FALSE);
APPL_TRACE_DEBUG("bta_jv_rfcomm_stop_server: sec id in use:%d, rfc_cb in use:%d",
get_sec_id_used(), get_rfc_cb_used());
}

View File

@@ -913,7 +913,7 @@ tBTA_JV_STATUS BTA_JvRfcommConnect(tBTA_SEC sec_mask,
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
tBTA_JV_STATUS BTA_JvRfcommClose(UINT32 handle, tBTA_JV_RFCOMM_CBACK *p_cback, void *user_data)
tBTA_JV_STATUS BTA_JvRfcommClose(UINT32 handle, void *user_data)
{
tBTA_JV_STATUS status = BTA_JV_FAILURE;
tBTA_JV_API_RFCOMM_CLOSE *p_msg;
@@ -928,7 +928,6 @@ tBTA_JV_STATUS BTA_JvRfcommClose(UINT32 handle, tBTA_JV_RFCOMM_CBACK *p_cback, v
p_msg->handle = handle;
p_msg->p_cb = &bta_jv_cb.rfc_cb[hi];
p_msg->p_pcb = &bta_jv_cb.port_cb[p_msg->p_cb->rfc_hdl[si] - 1];
p_msg->p_cback = p_cback;
p_msg->user_data = user_data;
bta_sys_sendmsg(p_msg);
status = BTA_JV_SUCCESS;

View File

@@ -324,7 +324,6 @@ typedef struct {
UINT32 handle;
tBTA_JV_RFC_CB *p_cb;
tBTA_JV_PCB *p_pcb;
tBTA_JV_RFCOMM_CBACK *p_cback;
void *user_data;
} tBTA_JV_API_RFCOMM_CLOSE;

View File

@@ -1,4 +1,4 @@
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
// Copyright 2015-2023 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -30,7 +30,6 @@ static void _btc_storage_save(void)
{
uint16_t addr_section_count = 0;
bt_bdaddr_t bd_addr;
uint32_t device_type = 0;
const btc_config_section_iter_t *need_remove_iter = NULL;
const btc_config_section_iter_t *iter = btc_config_section_begin();
@@ -55,9 +54,7 @@ static void _btc_storage_save(void)
continue;
}
if (!string_is_bdaddr(section) ||
!btc_config_get_int(section, BTC_BLE_STORAGE_DEV_TYPE_STR, (int *)&device_type) ||
((device_type & BT_DEVICE_TYPE_BLE) != BT_DEVICE_TYPE_BLE)) {
if (!string_is_bdaddr(section)) {
iter = btc_config_section_next(iter);
continue;
}
@@ -72,19 +69,20 @@ static void _btc_storage_save(void)
if (need_remove_iter) {
while(need_remove_iter != btc_config_section_end()) {
const char *need_remove_section = btc_config_section_name(need_remove_iter);
if (!string_is_bdaddr(need_remove_section) ||
!btc_config_get_int(need_remove_section, BTC_BLE_STORAGE_DEV_TYPE_STR, (int *)&device_type) ||
((device_type & BT_DEVICE_TYPE_BLE) != BT_DEVICE_TYPE_BLE)) {
if (!string_is_bdaddr(need_remove_section)) {
need_remove_iter = btc_config_section_next(need_remove_iter);
continue;
}
need_remove_iter = btc_config_section_next(need_remove_iter);
//delete device info
string_to_bdaddr(need_remove_section, &bd_addr);
BTM_SecDeleteDevice(bd_addr.address, BT_TRANSPORT_LE);
BTA_DmRemoveDevice(bd_addr.address, BT_TRANSPORT_LE);
BTA_DmRemoveDevice(bd_addr.address, BT_TRANSPORT_BR_EDR);
//delete config info
if(btc_config_remove_section(need_remove_section)) {
BTIF_TRACE_WARNING("exceeded the maximum nubmer of bonded devices, delete the last device info : %s", need_remove_section);
if (btc_config_remove_section(need_remove_section)) {
// The need_remove_section has been freed
BTIF_TRACE_WARNING("Exceeded the maximum number of bonded devices. Deleting the last device info: %02x:%02x:%02x:%02x:%02x:%02x",
bd_addr.address[0], bd_addr.address[1], bd_addr.address[2], bd_addr.address[3], bd_addr.address[4], bd_addr.address[5]);
}
}
}
@@ -209,6 +207,170 @@ bt_status_t btc_storage_get_ble_bonding_key(bt_bdaddr_t *remote_bd_addr,
return ret;
}
static bt_status_t _btc_storage_remove_all_ble_keys(const char *name)
{
int ret = 0;
if (name == NULL) {
return BT_STATUS_FAIL;
}
if (btc_config_exist(name, BTC_BLE_STORAGE_ADDR_TYPE_STR)) {
ret |= btc_config_remove(name, BTC_BLE_STORAGE_ADDR_TYPE_STR);
}
if (btc_config_exist(name, BTC_BLE_STORAGE_LE_KEY_PENC_STR)) {
ret |= btc_config_remove(name, BTC_BLE_STORAGE_LE_KEY_PENC_STR);
}
if (btc_config_exist(name, BTC_BLE_STORAGE_LE_KEY_PID_STR)) {
ret |= btc_config_remove(name, BTC_BLE_STORAGE_LE_KEY_PID_STR);
}
if (btc_config_exist(name, BTC_BLE_STORAGE_LE_KEY_PCSRK_STR)) {
ret |= btc_config_remove(name, BTC_BLE_STORAGE_LE_KEY_PCSRK_STR);
}
if (btc_config_exist(name, BTC_BLE_STORAGE_LE_KEY_LENC_STR)) {
ret |= btc_config_remove(name, BTC_BLE_STORAGE_LE_KEY_LENC_STR);
}
if (btc_config_exist(name, BTC_BLE_STORAGE_LE_KEY_LCSRK_STR)) {
ret |= btc_config_remove(name, BTC_BLE_STORAGE_LE_KEY_LCSRK_STR);
}
if (btc_config_exist(name, BTC_BLE_STORAGE_LE_KEY_LID_STR)) {
ret |= btc_config_remove(name, BTC_BLE_STORAGE_LE_KEY_LID_STR);
}
return ret;
}
void btc_storage_remove_unused_sections(uint8_t *cur_addr, tBTM_LE_PID_KEYS *del_pid_key)
{
bt_bdaddr_t bd_addr;
uint32_t device_type = 0;
if (del_pid_key == NULL) {
return;
}
btc_config_lock();
const btc_config_section_iter_t *iter = btc_config_section_begin();
while (iter != btc_config_section_end()) {
//store the next iter, if remove section, then will not loss the point
const char *section = btc_config_section_name(iter);
if (string_is_bdaddr(section) &&
!btc_config_exist(section, BTC_BLE_STORAGE_DEV_TYPE_STR) &&
!btc_config_exist(section, BTC_BLE_STORAGE_ADDR_TYPE_STR) &&
!btc_config_exist(section, BTC_BLE_STORAGE_LINK_KEY_STR) &&
!btc_config_exist(section, BTC_BLE_STORAGE_LE_KEY_PENC_STR) &&
!btc_config_exist(section, BTC_BLE_STORAGE_LE_KEY_PID_STR) &&
!btc_config_exist(section, BTC_BLE_STORAGE_LE_KEY_PCSRK_STR) &&
!btc_config_exist(section, BTC_BLE_STORAGE_LE_KEY_LENC_STR) &&
!btc_config_exist(section, BTC_BLE_STORAGE_LE_KEY_LCSRK_STR)) {
iter = btc_config_section_next(iter);
btc_config_remove_section(section);
continue;
}
if (!string_is_bdaddr(section) ||
!btc_config_get_int(section, BTC_BLE_STORAGE_DEV_TYPE_STR, (int *)&device_type) ||
((device_type & BT_DEVICE_TYPE_BLE) != BT_DEVICE_TYPE_BLE)) {
iter = btc_config_section_next(iter);
continue;
}
string_to_bdaddr(section, &bd_addr);
char buffer[sizeof(tBTM_LE_KEY_VALUE)] = {0};
if (_btc_storage_get_ble_bonding_key(&bd_addr, BTM_LE_KEY_PID, buffer, sizeof(tBTM_LE_PID_KEYS)) == BT_STATUS_SUCCESS) {
tBTM_LE_PID_KEYS *pid_key = (tBTM_LE_PID_KEYS *) buffer;
iter = btc_config_section_next(iter);
if (memcmp(del_pid_key->static_addr, pid_key->static_addr, 6) == 0 && memcmp(cur_addr, bd_addr.address, 6) != 0 && del_pid_key->addr_type == pid_key->addr_type) {
if (device_type == BT_DEVICE_TYPE_DUMO) {
btc_config_set_int(section, BTC_BLE_STORAGE_DEV_TYPE_STR, BT_DEVICE_TYPE_BREDR);
_btc_storage_remove_all_ble_keys(section);
} else {
//delete unused sections
BTIF_TRACE_DEBUG("delete section %s\n", section);
btc_config_remove_section(section);
}
}
} else {
iter = btc_config_section_next(iter);
}
}
btc_config_unlock();
}
void btc_storage_delete_duplicate_ble_devices(void)
{
bt_bdaddr_t bd_addr;
char buffer[sizeof(tBTM_LE_KEY_VALUE)] = {0};
char temp_buffer[sizeof(tBTM_LE_KEY_VALUE)] = {0};
tBTM_LE_PID_KEYS *pid_key;
tBTM_LE_PID_KEYS *temp_pid_key;
uint32_t device_type = 0;
bt_bdaddr_t temp_bd_addr;
btc_config_lock();
for (const btc_config_section_iter_t *iter = btc_config_section_begin(); iter != btc_config_section_end();
iter = btc_config_section_next(iter)) {
const char *name = btc_config_section_name(iter);
if (!string_is_bdaddr(name) ||
!btc_config_get_int(name, BTC_BLE_STORAGE_DEV_TYPE_STR, (int *)&device_type) ||
((device_type & BT_DEVICE_TYPE_BLE) != BT_DEVICE_TYPE_BLE)) {
continue;
}
string_to_bdaddr(name, &bd_addr);
if (_btc_storage_get_ble_bonding_key(&bd_addr, BTM_LE_KEY_PID, buffer, sizeof(tBTM_LE_PID_KEYS)) == BT_STATUS_SUCCESS)
{
pid_key = (tBTM_LE_PID_KEYS *) buffer;
const btc_config_section_iter_t *temp_iter = btc_config_section_next(iter);
while (temp_iter != NULL)
{
const char *temp_name = btc_config_section_name(temp_iter);
if (!string_is_bdaddr(temp_name) || !btc_config_get_int(temp_name, BTC_BLE_STORAGE_DEV_TYPE_STR, (int *)&device_type) ||
((device_type & BT_DEVICE_TYPE_BLE) != BT_DEVICE_TYPE_BLE)) {
temp_iter = btc_config_section_next(temp_iter);
continue;
}
string_to_bdaddr(temp_name, &temp_bd_addr);
if (_btc_storage_get_ble_bonding_key(&temp_bd_addr, BTM_LE_KEY_PID, temp_buffer, sizeof(tBTM_LE_PID_KEYS)) == BT_STATUS_SUCCESS)
{
temp_pid_key = (tBTM_LE_PID_KEYS *) temp_buffer;
if (memcmp(pid_key->static_addr, temp_pid_key->static_addr, 6) == 0 && pid_key->addr_type == temp_pid_key->addr_type) {
const char *temp_name = btc_config_section_name(temp_iter);
temp_iter = btc_config_section_next(temp_iter);
if (device_type == BT_DEVICE_TYPE_DUMO) {
btc_config_set_int(temp_name, BTC_BLE_STORAGE_DEV_TYPE_STR, BT_DEVICE_TYPE_BREDR);
_btc_storage_remove_all_ble_keys(temp_name);
} else {
BTC_TRACE_DEBUG("delete %s\n", temp_name);
btc_config_remove_section(temp_name);
}
} else {
temp_iter = btc_config_section_next(temp_iter);
}
} else {
temp_iter = btc_config_section_next(temp_iter);
}
}
}
}
btc_config_unlock();
}
/*******************************************************************************
**
** Function btc_storage_remove_ble_bonding_keys
@@ -227,27 +389,8 @@ static bt_status_t _btc_storage_remove_ble_bonding_keys(bt_bdaddr_t *remote_bd_a
BTIF_TRACE_DEBUG(" %s in bd addr:%s",__FUNCTION__, bdstr);
if (btc_config_exist(bdstr, BTC_BLE_STORAGE_ADDR_TYPE_STR)) {
ret |= btc_config_remove(bdstr, BTC_BLE_STORAGE_ADDR_TYPE_STR);
}
if (btc_config_exist(bdstr, BTC_BLE_STORAGE_LE_KEY_PENC_STR)) {
ret |= btc_config_remove(bdstr, BTC_BLE_STORAGE_LE_KEY_PENC_STR);
}
if (btc_config_exist(bdstr, BTC_BLE_STORAGE_LE_KEY_PID_STR)) {
ret |= btc_config_remove(bdstr, BTC_BLE_STORAGE_LE_KEY_PID_STR);
}
if (btc_config_exist(bdstr, BTC_BLE_STORAGE_LE_KEY_PCSRK_STR)) {
ret |= btc_config_remove(bdstr, BTC_BLE_STORAGE_LE_KEY_PCSRK_STR);
}
if (btc_config_exist(bdstr, BTC_BLE_STORAGE_LE_KEY_LENC_STR)) {
ret |= btc_config_remove(bdstr, BTC_BLE_STORAGE_LE_KEY_LENC_STR);
}
if (btc_config_exist(bdstr, BTC_BLE_STORAGE_LE_KEY_LCSRK_STR)) {
ret |= btc_config_remove(bdstr, BTC_BLE_STORAGE_LE_KEY_LCSRK_STR);
}
if (btc_config_exist(bdstr, BTC_BLE_STORAGE_LE_KEY_LID_STR)) {
ret |= btc_config_remove(bdstr, BTC_BLE_STORAGE_LE_KEY_LID_STR);
}
ret = _btc_storage_remove_all_ble_keys(bdstr);
//here don't remove section, because config_save will check it
_btc_storage_save();
return ret ? BT_STATUS_SUCCESS : BT_STATUS_FAIL;
@@ -766,7 +909,7 @@ static void _btc_read_le_key(const uint8_t key_type, const size_t key_len, bt_bd
*key_found = true;
}
}
static bt_status_t _btc_storage_in_fetch_bonded_ble_device(const char *remote_bd_addr, int add)
bt_status_t _btc_storage_in_fetch_bonded_ble_device(const char *remote_bd_addr, int add)
{
uint32_t device_type;
int addr_type;
@@ -808,58 +951,13 @@ static bt_status_t _btc_storage_in_fetch_bonded_ble_device(const char *remote_bd
if (key_found) {
return BT_STATUS_SUCCESS;
} else {
BTC_TRACE_DEBUG("Remote device:%s, no link key or ble key found", remote_bd_addr);
}
return BT_STATUS_FAIL;
}
static bt_status_t btc_storage_in_fetch_bonded_ble_devices(int add)
{
bt_status_t status = BT_STATUS_FAIL;
uint32_t device_type = 0;
btc_config_lock();
for (const btc_config_section_iter_t *iter = btc_config_section_begin(); iter != btc_config_section_end();
iter = btc_config_section_next(iter)) {
const char *name = btc_config_section_name(iter);
if (!string_is_bdaddr(name) ||
!btc_config_get_int(name, BTC_BLE_STORAGE_DEV_TYPE_STR, (int *)&device_type) ||
((device_type & BT_DEVICE_TYPE_BLE) != BT_DEVICE_TYPE_BLE)) {
continue;
}
BTC_TRACE_DEBUG("%s, name = %s", __func__, name);
if (_btc_storage_in_fetch_bonded_ble_device(name, add) != BT_STATUS_SUCCESS) {
BTC_TRACE_DEBUG("Remote device:%s, no link key or ble key found", name);
} else {
status = BT_STATUS_SUCCESS;
}
}
btc_config_unlock();
return status;
}
/*******************************************************************************
**
** Function btc_storage_load_bonded_devices
**
** Description btc storage API - Loads all the bonded devices from NVRAM
** and adds to the BTA.
** Additionally, this API also invokes the adaper_properties_cb
** and remote_device_properties_cb for each of the bonded devices.
**
** Returns BT_STATUS_SUCCESS if successful, BT_STATUS_FAIL otherwise
**
*******************************************************************************/
bt_status_t btc_storage_load_bonded_ble_devices(void)
{
bt_status_t status;
status = btc_storage_in_fetch_bonded_ble_devices(1);
BTC_TRACE_DEBUG("Storage load rslt %d\n", status);
return status;
}
bt_status_t btc_storage_get_bonded_ble_devices_list(esp_ble_bond_dev_t *bond_dev, int dev_num)
{
bt_bdaddr_t bd_addr;

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