Compare commits

..

792 Commits

Author SHA1 Message Date
morris
e499576efd change(version): Update version to 4.4.8 2024-06-27 18:24:14 +08:00
morris
8498af6bd4 Merge branch 'ci/fix_macos_runner_v4.4' into 'release/v4.4'
ci: select correct python version for mac runners (v4.4)

See merge request espressif/esp-idf!31577
2024-06-26 12:41:57 +08:00
morris
0ab74e5c5d Merge branch 'docs/delete_user_guide_esp32_s2_devkitm_1_v4.4' into 'release/v4.4'
docs: Delete user guide esp32-s2-devkitm-1 (v4.4)

See merge request espressif/esp-idf!31611
2024-06-26 11:30:59 +08:00
Fu Hanxi
d1c0cc5e3d ci: disable macos test on 4.4 branch
python 3.6 failed to install with requirements.txt
2024-06-25 16:27:04 +08:00
zhangshuxian
c689d2ab9e docs: Delete user guide esp32-s2-devkitm-1 2024-06-25 16:02:08 +08:00
Jiang Jiang Jian
1558b05d1c Merge branch 'bugfix/wpa3_sta_mem_leak_v4.4' into 'release/v4.4'
Fix memory leak in wpa3 station mode (Backport v4.4)

See merge request espressif/esp-idf!31612
2024-06-20 21:37:09 +08:00
Shyamal Khachane
eaba2427aa fix(esp_wifi): Fix memory leak in wpa3 station mode 2024-06-20 14:14:47 +08:00
Jiang Jiang Jian
d98ba8b570 Merge branch 'bugfix/station_ic_pmf_state_v4.4' into 'release/v4.4'
fix(wifi): Disable IC_PMF variable properly when station disconnects from PMF AP and always clear keys in tx_cb (Backport v4.4)

See merge request espressif/esp-idf!31557
2024-06-20 10:44:37 +08:00
Sarvesh Bodakhe
2b39e1c625 fix(wifi): Fix station PMF issues
Fix issue of station PMF not getting reset when disconnecting from PMF connection
2024-06-18 12:14:11 +05:30
Jiang Jiang Jian
d07bdc70b6 Merge branch 'feature/refactor_ftm_code_v4.4' into 'release/v4.4'
Refactor and improve FTM code (Backport v4.4)

See merge request espressif/esp-idf!31402
2024-06-18 10:43:56 +08:00
Jiang Jiang Jian
834ae1c002 Merge branch 'fix/fsync-call-propagation-to-secondary-console_v4.4' into 'release/v4.4'
fix(console): Fsync not propagated to secondary output (backport v4.4)

See merge request espressif/esp-idf!30265
2024-06-14 10:22:51 +08:00
Jiang Jiang Jian
147bc3b889 Merge branch 'docs/update_esp_vfs_notes_v4.4' into 'release/v4.4'
docs(vfs): update esp_vfs_register_fd api description (v4.4)

See merge request espressif/esp-idf!30429
2024-06-14 10:21:31 +08:00
Jiang Jiang Jian
b145507fff Merge branch 'docs/add_missing_usb_functions_to_esp32-c3_devkit_user_guides_v4.4' into 'release/v4.4'
Docs: Added missing USB functions to ESP32-C3 DevKit User Guides (v4.4)

See merge request espressif/esp-idf!30870
2024-06-14 10:21:03 +08:00
Jiang Jiang Jian
df497dde7a Merge branch 'docs/fix_a_typo_in_cn_version' into 'release/v4.4'
docs: Edit a typo in CN version

See merge request espressif/esp-idf!31377
2024-06-14 10:17:31 +08:00
Jiang Jiang Jian
a7a18f4632 Merge branch 'refactor/avoid_using_git_v4.4' into 'release/v4.4'
fix(tools): Avoiding crashing when Git is not present in system when acquiring IDF version (v4.4)

See merge request espressif/esp-idf!31437
2024-06-14 10:15:51 +08:00
Nachiket Kukade
9d1a374e01 feat(esp_wifi): Refactor and improve FTM code
Update wifi libs with below -

1. Break FTM State Machine code into separate functions
2. Use dynamic allocation for FTM session to save memory
3. Add API to get FTM report instead of event based mechanism
4. Add FTM Request retry and comeback support
2024-06-13 21:03:44 +05:30
Jiang Jiang Jian
fd916b39ef Merge branch 'bugfix/free_reattempt_adv_data_v4.4' into 'release/v4.4'
fix(nimble): Added change to free memory in case of failure (v4.4)

See merge request espressif/esp-idf!31165
2024-06-13 22:25:38 +08:00
Jiang Jiang Jian
7c2922a7d5 Merge branch 'bugfix/fix_ble_evt_time_v4.4' into 'release/v4.4'
fix(ble/controller): Update esp32 bt-lib (1e63e23) (v4.4)

See merge request espressif/esp-idf!31485
2024-06-13 20:51:52 +08:00
Rahul Tank
dd8185bdf1 Added change to free memory in case of failure 2024-06-13 17:58:51 +05:30
linruihao
9f0e5aec6c fix(bt/controller): Fixed assert issue caused by DPORT access 2024-06-13 17:34:12 +08:00
zhanghaipeng
5b4f8a6e50 fix(ble/controller): Update esp32 bt-lib (1e63e23)
- Optimized GATT write and notify throughput on ESP32
- Fixed BLE connect timeout after using DTM on ESP32
- Added ke memory debug tools on ESP32
- Fixed memory leak issue when BLE SCAN and other event coexist on ESP32
2024-06-13 14:53:10 +08:00
Jiang Jiang Jian
d1c8a1d1c2 Merge branch 'bugfix/fix_ble_pktlen_change_v4.4' into 'release/v4.4'
Bugfix/fix ble pktlen change (v4.4)

See merge request espressif/esp-idf!31253
2024-06-13 14:47:41 +08:00
Jiang Jiang Jian
2146569780 Merge branch 'fix/assert_in_bt_controller_v4.4' into 'release/v4.4'
fix(bt): fix some issues in bluetooth controller(backport v4.4)

See merge request espressif/esp-idf!31325
2024-06-13 14:46:42 +08:00
Jiang Jiang Jian
ed01a2a32d Merge branch 'fix/fix_sta_scan_when_connected_cause_bcn_timeout_loop_v4.4' into 'release/v4.4'
fix(wifi):fix sta scan when connected cause bcn timeout loop issue

See merge request espressif/esp-idf!31467
2024-06-13 14:46:22 +08:00
Jakub Kocka
1091defe43 fix(tools): Avoid crashing when Git is used to acquire IDF version
Closes https://github.com/espressif/esp-idf/issues/13345
2024-06-12 13:50:50 +02:00
wangtao@espressif.com
de8df121e6 fix(wifi):fix sta scan when connected cause bcn timeout loop issue 2024-06-12 17:59:01 +08:00
shenmengjing
6912d661d9 docs: Edit a typo in CN version 2024-06-07 10:53:00 +08:00
gongyantao
a0eb182f45 fix(bt): fix some issues in bluetooth controller
1: fix return incorrect link key with hci command rd_stored_link_key
2: fix the assert triggered during APB TX
3: fix role switch LMP collision bug
2024-06-05 09:14:31 +08:00
zhanghaipeng
64b1fe94e8 fix(ble/bluedroid): Optimize BLE stack connect callback name 2024-06-03 17:34:29 +08:00
zhanghaipeng
818644cf5a fix(ble/bluedroid): Fixed BLE no data length change event 2024-06-02 19:28:26 +08:00
Jiang Jiang Jian
c0e0af03d1 Merge branch 'bugfix/fix_esp32_cant_tx_after_tx_timeout_v4.4' into 'release/v4.4'
fix(wifi): fix esp32 unrecoverable m f issue, fix rxAppendBlock issue

See merge request espressif/esp-idf!31136
2024-05-28 20:02:49 +08:00
Jiang Jiang Jian
1e877f6872 Merge branch 'bugfix/stop_tg_wdt_in_xpd_xtal_lightsleep_v4.4' into 'release/v4.4'
fix(esp_hw_support): stop tg wdt in xpd xtal lightsleep (v4.4)

See merge request espressif/esp-idf!31137
2024-05-28 19:35:34 +08:00
wuzhenghui
7521a51845 fix(esp_hw_support/sleep): stop TG0/TG1 watchdog if XTAL not power down in lightsleep 2024-05-28 17:56:56 +08:00
wuzhenghui
339ae99b04 change(esp_hw_support/sleep): improve esp32c3 systimer stall bug workaround 2024-05-28 17:56:52 +08:00
liuning
b8477e0282 fix(wifi): fix esp32 unrecoverable m f issue, fix rxAppendBlock issue 2024-05-28 17:49:07 +08:00
Jiang Jiang Jian
ea45a644f0 Merge branch 'bugfix/ftm_fix_wrong_compensation_v4.4' into 'release/v4.4'
Fix issues in calibration and selecting FTM compensation with external AP (Backport v4.4)

See merge request espressif/esp-idf!30927
2024-05-28 17:02:21 +08:00
Nachiket Kukade
9b0602adbd fix(esp_wifi): Fix issue in selecting FTM compensation with external AP
Additionally update FTM Compensation values with calibration
2024-05-28 12:14:21 +05:30
Jiang Jiang Jian
822fbc2fc2 Merge branch 'bugfix/mldv6_report_memory_leak_v4.4' into 'release/v4.4'
fix(esp_netif): Fix mldv6 report memory leak in esp_netif(v4.4)

See merge request espressif/esp-idf!31060
2024-05-28 10:58:18 +08:00
Island
d84b40dc5a Merge branch 'feat/add_api_to_set_privacy_mode_v4.4' into 'release/v4.4'
feat(bt/bluedroid): support BLE set privacy mode (v4.4)

See merge request espressif/esp-idf!30908
2024-05-27 14:56:05 +08:00
Rahul Tank
799e503c47 Merge branch 'feature/ble_resolve_adv_data_v4.4' into 'release/v4.4'
feat(nimble): Added API to get resolve ADV data (v4.4)

See merge request espressif/esp-idf!31057
2024-05-24 17:30:05 +08:00
WanqQixiang
ef5a6437a8 fix(esp_netif): Fix mldv6 report memory leak in esp_netif 2024-05-24 15:17:55 +08:00
Abhinav Kudnar
c9972418fb feat(nimble): Added API to get resolve ADV data 2024-05-24 12:04:59 +05:30
Jiang Jiang Jian
1fda281bb7 Merge branch 'bugfix/libphy_esp32s2_ant_cfg_20240523_v4.4' into 'release/v4.4'
fix(phy): update esp32s2 libphy support ant api(Backport v4.4)

See merge request espressif/esp-idf!31041
2024-05-24 14:27:21 +08:00
Island
a94dcb9cda Merge branch 'fix/ble_mesh_gatts_bugfix_v4.4' into 'release/v4.4'
BLE Mesh Gatts bugfix (v4.4)

See merge request espressif/esp-idf!30876
2024-05-24 14:10:07 +08:00
Rahul Tank
1424b2b1e6 Merge branch 'bugfix/restart_advertising_if_slave_23e_v4.4' into 'release/v4.4'
fix(nimble): start advertising if disconnect due to 0x3E in slave (v4.4)

See merge request espressif/esp-idf!31036
2024-05-23 20:39:04 +08:00
luoxu
5c642bf0ee fix(ble_mesh): Create service after service register success 2024-05-23 14:34:03 +08:00
muhaidong
5d4a90e7a6 fix(phy): update esp32s2 libphy support ant api 2024-05-23 14:33:14 +08:00
Jiang Jiang Jian
79e71e008c Merge branch 'bugfix/loadprohibited_after_bt_deinit_v4.4' into 'release/v4.4'
Fixed some coexist issues

See merge request espressif/esp-idf!31007
2024-05-22 16:19:00 +08:00
Rahul Tank
ccb2bc24cb fix(nimble): start advertising if disconnect due to 0x3E in slave 2024-05-22 13:27:04 +05:30
Jiang Jiang Jian
b2bc7b17f8 Merge branch 'bugfix/libphy_chips_20240430_v4.4' into 'release/v4.4'
update c3 s3 libphy, fix coex bug

See merge request espressif/esp-idf!30972
2024-05-22 14:00:08 +08:00
baohongde
77106b3238 fix(coex): Fixed some coexist issues
- Fixed crash issue in coexist callback
- Fixed coexist scheme status update issue
2024-05-22 11:49:07 +08:00
chenjianhua
6e0661ab3e fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(a771b7c)
- Fixed assert when starting advertising due to preemption
- Fixed RPA generation after each reboot
- Fixed RPA renew timer start and stop
2024-05-22 11:49:06 +08:00
Jiang Jiang Jian
509c4c2953 Merge branch 'bugfix/sae_memleak_v4.4' into 'release/v4.4'
fix(wpa_supplicant):Fix memory leak in wpa3-sae

See merge request espressif/esp-idf!30986
2024-05-22 11:45:41 +08:00
chenjianhua
543276b4ab feat(bt/bluedroid): support BLE set privacy mode 2024-05-22 10:47:42 +08:00
aditi_lonkar
fc33940ce9 fix(wpa_supplicant):Fix memory leak in wpa3-sae 2024-05-21 18:53:04 +05:30
Sergei Silnov
d0274c0efb Merge branch 'ci/use_github_on_macos_runners_v4.4' into 'release/v4.4'
ci: use github repo for mac runners (v4.4)

See merge request espressif/esp-idf!30975
2024-05-21 18:49:07 +08:00
Wang Meng Yang
22dd4ba5e8 Merge branch 'bugfix/fix_hid_connection_failed_bug_v4.4' into 'release/v4.4'
fix(bt/bluedroid): Fix HID connection bugs[backport 4.4]

See merge request espressif/esp-idf!30592
2024-05-21 16:47:07 +08:00
Fu Hanxi
68ad59ac93 ci: make fast_template_app optional 2024-05-21 05:55:51 +02:00
Fu Hanxi
99e551beb9 ci: use github repo for mac runners 2024-05-21 05:49:17 +02:00
liuning
f13847832b update c3 s3 libphy, fix coex bug 2024-05-21 11:27:35 +08:00
Jiang Jiang Jian
58c78162b9 Merge branch 'bugfix/fix_some_wifi_bugs_240516_v4.4' into 'release/v4.4'
fix(wifi): fix some wifi issues(Backport v4.4)

See merge request espressif/esp-idf!30905
2024-05-17 14:03:57 +08:00
muhaidong
de337d5625 fix(wifi): fixed some wifi bugs 240516
1. fix esp_wifi_set_mode() return error issue
2. fix qos encapsulated eapol issue
3. eapol arp and dhcp add flag PP_F_PER_PKT_RATE
4. fix lmac_stop_hw_txq issue
5. fix typo
6. limite number of amsdu  block in eb
7. fix recycle cache sub amsdu eb issue
8. update ba session store and restore rx ba num
9. fix multicast address qos frame by reset rx ba
10. fix lmacStopTransmit issue
11. sync multi antenna gpio register from IDF
12. clear eb to fix tx single AMPDU to some AP not reply BA when ampdu_entry single bit was set
2024-05-17 11:43:49 +08:00
muhaidong
5b7985b89f fix(wifi): fixed scan get ap number issue 2024-05-17 10:32:22 +08:00
muhaidong
7fbb4cfa51 fix(wifi): fixed task watchdog got triggered by esp_wifi_stop issue 2024-05-17 10:31:36 +08:00
muhaidong
a5e717662f fix(wifi): fix multicast address qos frames issue 2024-05-17 10:30:22 +08:00
muhaidong
9d34f39c37 fix(wifi): fix some wifi issues
1. fix qos encapsulated eapol issue
2. fixed dhcp offer and dhcp ack data rates
2024-05-16 21:59:15 +08:00
Jiang Jiang Jian
4a69a889a5 Merge branch 'fix/assert_1024_in_rwbt_isr_v4.4' into 'release/v4.4'
fix(bt/ble): fix some issues in bluetooth controller(backport v4.4)

See merge request espressif/esp-idf!30817
2024-05-16 16:43:21 +08:00
wangning
d783018e82 docs(esp32c3): Added missing USB functions to esp32-c3 devkit user guides 2024-05-16 11:49:32 +08:00
Jiang Jiang Jian
a3233986a2 Merge branch 'bugfix/fix_mesh_packet_tx_issue_v4.4' into 'release/v4.4'
fix(wifi): fix the tx issue when mesh packet lifetime remain equal to zero (v4.4)

See merge request espressif/esp-idf!30812
2024-05-16 10:49:53 +08:00
Rahul Tank
74767e9704 Merge branch 'feat/add_data_len_chg_evt_v4.4' into 'release/v4.4'
fix(nimble): Add support for data length change evt (v4.4)

See merge request espressif/esp-idf!30842
2024-05-15 17:57:49 +08:00
Rahul Tank
280a7f71c6 fix(nimble): Add support for data length change evt 2024-05-15 12:06:02 +05:30
Rahul Tank
3168c79b05 Merge branch 'bugix/avoid_reset_extract_cb_v4.4' into 'release/v4.4'
fix(nimble): Avoid slave instance reset inside extract_cb (v4.4)

See merge request espressif/esp-idf!30491
2024-05-15 13:45:49 +08:00
Jin Cheng
b6028aa34e fix(bt/controller): Parse out the correct packet types from Host parameters
- For HCI command HCI_Enhanced_Setup_Synchronous_Connection
2024-05-14 11:51:44 +08:00
gongyantao
eee102f4ee fix(bt/ble): fix some issues in bluetooth controller
1: fix assert 1024 issue when bt tx and wifi coexist on esp32
2: fix ble scan backoff
3: parse out the correct packet types from host parameters for
   hci command hci_enhanced_setup_synchronous_connection
2024-05-14 10:11:48 +08:00
zhangyanjiao
7fe58c450c fix(wifi): fix the tx issue when mesh packet lifetime remain equal to zero 2024-05-14 10:08:05 +08:00
Jiang Jiang Jian
5bdc532007 Merge branch 'doc/update_bt_sleep_process_v4.4' into 'release/v4.4'
docs: Update the process of Bluetooth entering sleep in the sleep_modes.rst(v4.4)

See merge request espressif/esp-idf!30764
2024-05-13 14:28:49 +08:00
Jiang Jiang Jian
9160abc5c5 Merge branch 'bugfix/bt_bss_in_extram_v4.4' into 'release/v4.4'
fix(bt): Fix missing linker symbol when ESP_ALLOW_BSS_SEG_EXTERNAL_MEMORY enabled(backport v4.4)

See merge request espressif/esp-idf!30376
2024-05-13 11:04:20 +08:00
Island
1b42fee4f0 Merge branch 'fix/idfgh-12762_v4.4' into 'release/v4.4'
fix(ble_mesh):Fixed a compatibility issue with the provisioner (v4.4)

See merge request espressif/esp-idf!30733
2024-05-10 17:14:23 +08:00
Island
2faabba4a4 Merge branch 'bugfix/BLEQABR23-798_v4.4' into 'release/v4.4'
bugfix(ble_mesh): Close BLEQABR23-798 (v4.4)

See merge request espressif/esp-idf!30648
2024-05-10 17:14:07 +08:00
Wang Meng Yang
5510aabe91 Merge branch 'optimize/bt_make_alarm_num_configurable_v4.4' into 'release/v4.4'
optimize(ble_mesh): Make alarm number configurable (v4.4)

See merge request espressif/esp-idf!30509
2024-05-10 15:05:52 +08:00
xiongweichao
79b78a4b9d docs: Update the process of Bluetooth entering sleep in the sleep_modes.rst 2024-05-10 11:58:01 +08:00
Rahul Tank
6abd351b76 fix(nimble): Avoid slave instance reset inside extract_cb 2024-05-09 12:12:02 +05:30
luoxu
d4aa5c8cc0 fix(ble_mesh):Fixed a compatibility issue with the provisioner
Closes https://github.com/espressif/esp-idf/issues/13741
2024-05-09 10:58:11 +08:00
luoxu
1b16370e83 bugfix(ble_mesh): Close BLEQABR23-798 2024-05-07 09:49:44 +08:00
Wang Mengyang
69a1d87f46 fix(bt): Fix missing linker symbol when ESP_ALLOW_BSS_SEG_EXTERNAL_MEMORY enabled
1. Closes https://github.com/espressif/esp-idf/issues/10427
2: Rename ymbol names
3. support memory release in case that ESP_ALLOW_BSS_SEG_EXTERNAL_MEMORY is enabled
4. improve the implementation of memory release
2024-05-07 09:42:29 +08:00
liqigan
21df723fca fix(bt/bluedroid): Fix HID Device connection failed bug
Closes https://github.com/espressif/esp-idf/issues/13671
2024-04-30 18:04:34 +08:00
liqigan
bc6f4b7e31 fix(bt/bluedroid): Fix HID Host connection bugs
1. Fix is_orig value inconsistency for HIDH open event
2. Fix the error state for repeat connection of the same device
2024-04-30 18:04:28 +08:00
Wang Meng Yang
be2fba6057 Merge branch 'bugfix/hf_local_param_null_v4.4' into 'release/v4.4'
fix(bt/bluedroid): allocate memory for control block of HFP Audio Gateway (v4.4)

See merge request espressif/esp-idf!30443
2024-04-30 17:25:15 +08:00
wangjialiang
50b301fc14 feat(ble_mesh): Make alarm number configurable 2024-04-30 16:16:15 +08:00
Island
c1f02f6f09 Merge branch 'bugfix/fix_ble_coex_assert_v4.4' into 'release/v4.4'
Update esp32 bt-lib (4012cfb)(backport v4.4)

See merge request espressif/esp-idf!30518
2024-04-28 10:48:10 +08:00
Island
29221d1926 Merge branch 'bugfix/fix_ble_max_attribute_value_v4.4' into 'release/v4.4'
Bugfix/fix ble max attribute value v4.4

See merge request espressif/esp-idf!30413
2024-04-28 10:37:14 +08:00
zhanghaipeng
2ca8c10a49 feat(ble/bluedroid): Support BLE command status debug log 2024-04-26 17:15:00 +08:00
zhanghaipeng
8bf1391cac fix(ble/controller): Update esp32 bt-lib (4012cfb)
- Fixed BLE coex assert
- Fixed BLE DTM status and tx count
2024-04-26 16:51:49 +08:00
morris
8f44525dd8 Merge branch 'fix/uart_wakeup_threshold_v4.4' into 'release/v4.4'
fix(uart): Fix mismatch wakeup rising edges required with the threshold configured (v4.4)

See merge request espressif/esp-idf!30477
2024-04-25 10:37:27 +08:00
morris
6c3f8c2092 Merge branch 'bugfix/gpio_drive_cap_v4.4' into 'release/v4.4'
fix(gpio): add workaround to ensure correct IO drive strength for C3 and S3 (v4.4)

See merge request espressif/esp-idf!30471
2024-04-25 10:37:17 +08:00
Michael (XIAO Xufeng)
88b9c7130e Merge branch 'bugfix/i2c_timeout_issue_v4.4' into 'release/v4.4'
fix(i2c): fix issues related to timeout and alive interval tick (backport v4.4)

See merge request espressif/esp-idf!29982
2024-04-24 23:57:01 +08:00
Song Ruo Jing
06442fd319 fix(uart): Fix mismatch wakeup rising edges required with the threshold configured
Closes https://github.com/espressif/esp-idf/issues/12586
2024-04-24 17:40:35 +08:00
Song Ruo Jing
6a82e5d232 fix(gpio): add workaround to ensure correct IO drive strength for C3 and S3 2024-04-24 17:15:59 +08:00
zhanghaipeng
c13311dacb fix(ble/bluedroid): Optimized BLE SPP example for improved compatibility 2024-04-24 15:59:28 +08:00
zhanghaipeng
b4d51f2202 feat(ble/bluedroid): Support BLE add device to resolving list 2024-04-24 12:22:38 +08:00
zhanghaipeng
f9a646879b feat(ble/bluedroid): Support create BLE static random address and NRPA 2024-04-24 10:55:32 +08:00
zhanghaipeng
8eeaea0c58 feat(ble/bluedroid): Support set resolvable provate address timeout by api 2024-04-24 10:55:14 +08:00
Rahul Tank
370636b183 Merge branch 'bugfix/rpa_timeout_api_v4.4' into 'release/v4.4'
fix(nimble): Expose API to set RPA Timeout (v4.4)

See merge request espressif/esp-idf!30411
2024-04-24 10:28:00 +08:00
Jin Cheng
97eb2e7f8d fix(bt/bluedroid): allocate memory for control block of HFP Audio Gateway in its initialization when dynamic memory is wnabled 2024-04-24 08:29:27 +08:00
sonika.rathi
78c572bbc3 docs(vfs): update esp_vfs_register_fd api description
Closes https://github.com/espressif/esp-idf/issues/11586
2024-04-23 15:25:41 +02:00
zhanghaipeng
c8a8f026ca fix(ble/bluedroid): Fixed BLE GATT max length of an attribute value 2024-04-23 16:47:28 +08:00
zhanghaipeng
597baf46fc fix(ble/bluedroid): Optimize BLE documentation comments to comply with Doxygen syntax 2024-04-23 16:47:15 +08:00
zhanghaipeng
1a7b33cf9d fix(ble/bluedroid): Optimize the BLE documentation 2024-04-23 16:45:37 +08:00
Rahul Tank
e992cafbca fix(nimble): Expose API to set RPA Timeout 2024-04-23 12:01:58 +05:30
Jiang Jiang Jian
7cd82420c2 Merge branch 'doc/update_espnow_example_v4.4' into 'release/v4.4'
docs(wifi): change the magic varible from int to uint32_t on the receiving side (v4.4)

See merge request espressif/esp-idf!30310
2024-04-22 10:44:27 +08:00
Jiang Jiang Jian
a4eb486982 Merge branch 'bugfix/fix_some_ble_bugs_cjh_v4.4' into 'release/v4.4'
Fixed some BT and BLE bugs 2404 (backport v4.4)

See merge request espressif/esp-idf!30261
2024-04-22 10:43:57 +08:00
Wang Meng Yang
0f651657c1 Merge branch 'bugfix/crash_after_bluedroid_deinit_v4.4' into 'release/v4.4'
fix(bt/bluedroid): Fixed controller using null pointer after bluedroid deinit(v4.4)

See merge request espressif/esp-idf!30330
2024-04-19 12:19:08 +08:00
chenjianhua
b30aa8f087 feat(bt): Update bt lib for ESP32-C3 and ESP32-S3(c23ab4c)
- Support QA test vendor HCI command and event
2024-04-18 14:52:26 +08:00
baohongde
fd2122886a fix(ble/controller): Fixed LoadProhibited after bluetooth deinit 2024-04-18 14:52:18 +08:00
chenjianhua
cae9f68eff fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(5274796)
- Fixed extended uncoded and coded scan scheduling
- Add config for channel assessment and ping procedure
- Clear random address for extended advertising
- Add periodic advertising list check
- Fixed periodic advertising data setting with zero length
2024-04-18 14:52:12 +08:00
baohongde
02bfd5749f feat(ble/controller): Add coexist schm for BLE 2024-04-18 14:49:56 +08:00
chenjianhua
fe1299e5da feat(bt): Update bt lib for ESP32(e314148)
- Support QA test vendor HCI command and event
2024-04-18 14:47:53 +08:00
zhanghaipeng
b01187b472 fix(bt/controller): Update bt lib for ESP32(5838b68)
- Fixed BLE scan assert
 - Fixed assert(10,0) in lld_pdu
 - Add BLE scan backoff in menuconfig
2024-04-18 14:47:53 +08:00
Jin Cheng
4bbb3c9203 fix(bt/controller): Use embedded assembly to get access to DPORT registers 2024-04-18 14:47:53 +08:00
xiongweichao
0e31aae24d fix(bt/bluedroid): Fixed crash after bluedroid deinit
hci_host_env.downstream_data_ready is set to NULL during bluedroid deinit,
causing the controller to use a null pointer when calling callback.
2024-04-18 10:58:35 +08:00
Island
d1f549f670 Merge branch 'bugfix/fix_ble_appearance_v4.4' into 'release/v4.4'
Fixed BLE appearance category ranges (v4.4)

See merge request espressif/esp-idf!30288
2024-04-18 10:44:04 +08:00
zhanghaipeng
54205481df fix(ble/bluedroid): Fixed set BLE appearance value 2024-04-17 20:39:36 +08:00
zhangyanjiao
f7fe5728ce docs(wifi): update the docmentation for sniffer API
Closes https://github.com/espressif/esp-idf/issues/10740
2024-04-17 16:22:08 +08:00
zhangyanjiao
4d7478002d docs(wifi): change the magic varible from int to uint32_t on the receiving side
Closes https://github.com/espressif/esp-idf/issues/10912
2024-04-17 16:20:51 +08:00
Jiang Jiang Jian
6b60008e50 Merge branch 'feature/update_mbedtls_version_to_2.28.8' into 'release/v4.4'
feat(mbedtls): updated mbedtls version from 2.28.7 to 2.28.8

See merge request espressif/esp-idf!30018
2024-04-17 10:43:56 +08:00
Jiang Jiang Jian
c902eacbe9 Merge branch 'feature/update-openocd-to-v0.12.0-esp32-20240318_v4.4' into 'release/v4.4'
feat(tools): update openocd version to v0.12.0-esp32-20240318 (v4.4)

See merge request espressif/esp-idf!30048
2024-04-17 10:43:39 +08:00
morris
0036aaac89 Merge branch 'doc/auto_suspend_disabled_by_default_v4.4' into 'release/v4.4'
doc(flash): fix auto suspend enabled by default issue (v4.4)

See merge request espressif/esp-idf!30269
2024-04-17 10:05:49 +08:00
Xiao Xufeng
21ece5e0ed doc(flash): fix auto suspend enabled by default issue 2024-04-16 23:15:24 +08:00
Wang Meng Yang
5c8b63c773 Merge branch 'feature/add_api_to_send_vendor_hci_cmd_v4.4' into 'release/v4.4'
Feature/add api to send vendor hci cmd (backport v4.4)

See merge request espressif/esp-idf!30228
2024-04-16 17:45:44 +08:00
Guillaume Souchere
5c42c794d3 fix(console): Fsync not propagated to secondary output
Calls to fsync need to also be propagated to secondary
output when CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG
is enabled.

Closes https://github.com/espressif/esp-idf/issues/13162
2024-04-16 08:47:05 +02:00
Jiang Jiang Jian
309ffa5565 Merge branch 'bugfix/fix_coded_phy_s8_tx_issue_v4.4' into 'release/v4.4'
fix(esp_phy): fixed BLE coded phy s8 tx issue in coexistence scenarios (backport v4.4)

See merge request espressif/esp-idf!30192
2024-04-15 11:03:57 +08:00
Jiang Jiang Jian
7731658ec9 Merge branch 'feat/set_get_lpclk_src_v4.4' into 'release/v4.4'
feat(ble): Added API to get low power clock source(v4.4)

See merge request espressif/esp-idf!30110
2024-04-15 11:00:30 +08:00
Jiang Jiang Jian
5017ec08bb Merge branch 'bugfix/aud-5252_v4.4' into 'release/v4.4'
backport v4.4: fix the issue of modem hang caused by incorrect configuration of power and isolate signals

See merge request espressif/esp-idf!30097
2024-04-15 10:44:51 +08:00
zhiweijian
8d7c759e11 fix(ble/bluedroid): Fixed adv not restart due to disconnection reason 0x3e 2024-04-13 18:25:20 +08:00
zhiweijian
9a7b3f80b2 feat(bt/common): Add bluerooth hci layer data stream record 2024-04-13 18:25:08 +08:00
zhiweijian
db9ba9378f feat(bt/bluedroid): add api to setnd vendor hci command 2024-04-13 15:06:25 +08:00
zhiweijian
60d757c5a4 fix(ble/bluedroid): fixed bluedroid host DTM API 2024-04-13 15:06:11 +08:00
zhiweijian
f837394d59 feat(ble/bluedroid): Add APIs for BLE direct test mode on bluedroid host 2024-04-13 15:05:56 +08:00
Rahul Tank
96db015f7b Merge branch 'bugfix/fix_cccd_compilation_warning_v4.4' into 'release/v4.4'
fix(nimble): Fix compilation issues when CCCD is set to 0 (v4.4)

See merge request espressif/esp-idf!30214
2024-04-12 20:10:23 +08:00
Aditya Patwardhan
c70664772b Merge branch 'bugfix/howsmyssl_cert_update_v4.4' into 'release/v4.4'
fix(examples): update root certificate for howsmyssl endpoint (v4.4)

See merge request espressif/esp-idf!30206
2024-04-12 17:45:01 +08:00
Rahul Tank
fcc210d34e fix(nimble): Fix compilation issues when CCCD is set to 0 2024-04-12 12:38:51 +05:30
Rahul Tank
caa1e6339d Merge branch 'bugfix/fix_cve_2024_24746_v4.4' into 'release/v4.4'
fix(nimble): Fix for Vulnerability CVE_2024_24746 (v4.4)

See merge request espressif/esp-idf!30202
2024-04-12 13:17:35 +08:00
Mahavir Jain
db40be7a17 fix(examples): update root certificate for howsmyssl endpoint
This fixes CI failure seen because of cert migration of howsmyssl
endpoint from previous "DST Root CA X3" (cross-signed) to "ISRG Root X1".
2024-04-12 11:12:44 +08:00
Rahul Tank
31fd152cc6 fix(nimble): Fix for Vulnerability CVE_2024_24746 2024-04-11 20:03:56 +05:30
linruihao
ca7b269dc8 fix(esp_phy): update phylib for C3 and S3
- fixed BLE coded phy s8 tx issue in coexistence scenarios
- fixed ESP32-C3 and ESP32-S3 BLE RX issue
- optimized ESP32-C3 and ESP32-S3 light sleep current
2024-04-11 17:49:01 +08:00
morris
94dff9b23f Merge branch 'bugfix/fix_rtc_cntl_v4.4' into 'release/v4.4'
[S3]fix(rtc_cntl_reg.h): fix RTC_CNTL_SLAVE_PD_M

See merge request espressif/esp-idf!30168
2024-04-11 11:39:27 +08:00
zlq
8855a3d6c4 [S3]fix(rtc_cntl_reg.h): fix RTC_CNTL_SLAVE_PD_M 2024-04-10 19:39:59 +08:00
Island
ae5d8a6fae Merge branch 'bugfix/ble_mesh_heartbeat_filter_add_v4.4' into 'release/v4.4'
Fix(ble_mesh):fix error condition for heartbeat filter adding node address (v4.4)

See merge request espressif/esp-idf!29989
2024-04-09 16:12:10 +08:00
Marius Vikhammer
be6cf38b31 Merge branch 'fix/heap-calloc-fail-wrong-size_v4.4' into 'release/v4.4'
fix(heap): Wrong size propagated in alloc fail callback of heap_caps_calloc() (backport v4.4)

See merge request espressif/esp-idf!30093
2024-04-09 12:05:37 +08:00
Rahul Tank
fadb4082b0 Merge branch 'bugfix/set_correct_addr_type_v4.4' into 'release/v4.4'
fix(nimble): Set correct peer_addr during reattempt connection (v4.4)

See merge request espressif/esp-idf!30058
2024-04-08 20:58:25 +08:00
xiongweichao
d47b2e4612 feat(ble): Added API to get low power clock source 2024-04-08 20:02:43 +08:00
Li Shuai
0dea8d7df8 fix(esp_hw_support): fixed modem hang caused by incorrect configuration of power and isolate signals 2024-04-08 16:01:30 +08:00
jingli
01117ef986 soc/soc_caps: update soc caps for chips that support power-down of modem hardware
Closes WIFI-4424
2024-04-08 15:50:29 +08:00
Guillaume Souchere
98bd872f3c fix(heap): Wrong size propagated in alloc fail callback
Propagate `n * size` as the size of the failed allocation
instead of just `size` when heap_caps_calloc() fails since
`n * size` is the actual number of bytes that the heap
component tried to allocate.
2024-04-08 08:47:54 +02:00
luoxu
523cd6291b fix(ble_mesh): fix error condition for heartbeat filter adding node address 2024-04-08 14:28:39 +08:00
Jiang Jiang Jian
e83ed8b345 Merge branch 'bugfix/spp_crash_after_deint_v4.4' into 'release/v4.4'
fix(bt/bluedroid): Fixed SPP crash due to the connection not being disconnected before esp_spp_deinit was called(v4.4)

See merge request espressif/esp-idf!30084
2024-04-08 12:03:44 +08:00
Jiang Jiang Jian
fc56e0e008 Merge branch 'fix/log_buffer_4.4' into 'release/v4.4'
fix(log): Fixed incorrect argument type in hexdump log functions (v4.4)

See merge request espressif/esp-idf!29784
2024-04-08 10:31:35 +08:00
Jiang Jiang Jian
1e9c933b20 Merge branch 'fix/gcov_fault_v4.4' into 'release/v4.4'
fix(gcov): fix exceptions on gcov task_tick_hook (v4.4)

See merge request espressif/esp-idf!30028
2024-04-08 10:30:41 +08:00
Alexey Gerenkov
79f0dfeafa feat(tools): update openocd version to v0.12.0-esp32-20240318 2024-04-08 03:34:40 +08:00
xiongweichao
0c4fbbff02 fix(bt/bluedroid): Fix SPP crash after deinit
- The disconnection event comes up after spp disable is completed, so a null pointer is used.
2024-04-07 20:03:33 +08:00
Jiang Jiang Jian
204d181fad Merge branch 'bugfix/variable_length_rsnxe_v44' into 'release/v4.4'
Expands maximum size of RSNXE IE to 255(v4.4)

See merge request espressif/esp-idf!30052
2024-04-07 10:29:50 +08:00
Rahul Tank
4c00c5c29c fix(nimble): Remove extra code in reattempt connection 2024-04-06 20:32:33 +05:30
nilesh.kale
a5350112fb feat(mbedtls): updated mbedtls version from 2.28.7 to 2.28.8
This MR updated MbedTLS version to 2.28.8.
2024-04-05 15:17:03 +05:30
jgujarathi
eeedc3e00e fix(rsnxe): Expands maximum size of RSNXE IE to 255
- Allows for RSNXE IE to be processed as a variable length upto
255 bytes, changing the earlier max of 20.
2024-04-05 10:41:44 +05:30
Rahul Tank
ff9db0dc80 Merge branch 'feat/add_vendor_hci_cmd' into 'release/v4.4'
Nimble: Add APIs to handle vs HCI commands and events (v4.4)

See merge request espressif/esp-idf!29995
2024-04-03 21:52:06 +08:00
Alexey Lapshin
85f0a4c1a7 fix(gcov): fix exceptions on gcov task_tick_hook
Closes https://github.com/espressif/esp-idf/issues/13511
2024-04-03 15:30:25 +04:00
Jiang Jiang Jian
e1affdc8f7 Merge branch 'bugfix/dpp_auth_deinit_crash_v44' into 'release/v4.4'
Ensure dpp auth structure is deinited in dpp task context(v4.4)

See merge request espressif/esp-idf!29836
2024-04-03 17:29:00 +08:00
Rahul Tank
d9a1302095 Nimble: Add APIs to handle vs HCI commands and events 2024-04-03 10:46:13 +05:30
Jiang Jiang Jian
9dce0a4ac7 Merge branch 'bugfix/fix_some_wifi_coexist_issue_v4.4' into 'release/v4.4'
bugfix/fix some wifi coexist issue v4.4

See merge request espressif/esp-idf!29990
2024-04-03 11:29:08 +08:00
jgujarathi
15ba8fb5ab fix(wpa_supplicant): Cancel offchannel listen operations before sending dpp fail
- Ensure that offchannel listening operations are cancelled before sending dpp
  fail events
2024-04-03 11:10:34 +08:00
jgujarathi
69321d1dda fix(wpa_supplicant): Ensure dpp auth structure is deinited in dpp task context
- Ensure that the dpp auth data gets deinited only in DPP task context to ensure
  that there are no concurrency issues in usage of DPP auth data.
2024-04-03 11:10:34 +08:00
Jiang Jiang Jian
efcbfbefc2 Merge branch 'fix/rd_stored_link_key_error_v4.4' into 'release/v4.4'
fix(bt): fix some issues in bt controller(backport v4.4)

See merge request espressif/esp-idf!29974
2024-04-03 11:09:54 +08:00
Rahul Tank
b65ac342c0 Merge branch 'bugfix/revamp_reconn_scheme_v4.4' into 'release/v4.4'
fix(nimble): Cleanup code in connection reconnection implementation (v4.4)

See merge request espressif/esp-idf!29967
2024-04-02 15:30:09 +08:00
liuning
d0d1676fcc feat(coex): support to scan long time on channel, fix coexist sync issue 2024-04-02 12:01:58 +08:00
liuning
f13d02da8c example: add custom partition table for mesh manual networking 2024-04-02 11:55:34 +08:00
liuning
ac0e88403c feat(coex): improve Wi-Fi connecting compatibility at coexistence 2024-04-02 11:55:29 +08:00
Omar Chebib
976b847ca1 fix(i2c): fix issues related to timeout and alive interval tick
Fixes https://github.com/espressif/esp-idf/issues/4999

Former usage of I2C_CMD_ALIVE_INTERVAL_TICK macro overrode the ticks_to_wait
parameter when the latter was too big
2024-04-02 10:47:51 +08:00
gongyantao
b0a6609e7a fix(bt): fix some issues in bt controller
1: fixed the incorrect timeing in reporting HCI_Link_Key_Type_Changed.
2: fixed the incorrect iv value during resuming encryption.
3: fixed the incorrect return with hci command rd_stored_link_key.
2024-04-02 09:42:49 +08:00
Rahul Tank
5ff6298956 fix(nimble): Change reconnection scheme 2024-04-01 18:23:16 +05:30
Jiang Jiang Jian
718c649e06 Merge branch 'bugfix/fix_call_to_header_event_callback_v4.4' into 'release/v4.4'
fix: Fix call to event_handler on on_header state of HTTP Client (v4.4)

See merge request espressif/esp-idf!29957
2024-04-01 19:49:26 +08:00
Harshit Malpani
1451ec389b Revert "fix(esp_http_client): Call event_handler after header value is received"
This reverts commit 04ac8e43db.

Fixes https://github.com/espressif/esp-idf/issues/13497
Fixes https://github.com/espressif/esp-idf/issues/13097
2024-04-01 13:21:45 +05:30
Jiang Jiang Jian
e1f8314fd7 Merge branch 'change/add_convt_from_hci_state_to_esp_state_v4.4' into 'release/v4.4'
change(bt/bluedroid): Use BTC util to convert HCI status to ESP status (v4.4)

See merge request espressif/esp-idf!29924
2024-04-01 14:17:23 +08:00
Rahul Tank
31932039fc Merge branch 'bugfix/handle_missing_free_v4.4' into 'release/v4.4'
fix(nimble): Handle missing free in application (v4.4)

See merge request espressif/esp-idf!29890
2024-03-29 21:02:52 +08:00
Rahul Tank
c71bd1e681 fix(nimble): Handle missing free in application 2024-03-28 08:52:24 +05:30
Jin Cheng
9ce03290cc change(bt/bluedroid): Use BTC util to convert HCI status to ESP status 2024-03-28 11:06:22 +08:00
Island
1e1030e5ef Merge branch 'bugfix/BT-3491_v4.4' into 'release/v4.4'
bugfix(ble_mesh): Avoid provisioner handling messages from nodes that have...(v4.4)

See merge request espressif/esp-idf!28052
2024-03-25 12:11:15 +08:00
Rahul Tank
718cdd6c65 Merge branch 'bugfix/bonding_across_reboot_v4.4' into 'release/v4.4'
fix(nimble): Added support for deleting the oldest bonded device across reboot (v4.4)

See merge request espressif/esp-idf!29765
2024-03-21 16:49:26 +08:00
Jakob Hasse
5dbe8d3539 fix(log): Fixed incorrect argument type in hexdump log functions
Closes https://github.com/espressif/esp-idf/issues/13347
Thanks @matthew-8925
2024-03-21 16:18:37 +08:00
Darshan Dobariya
eabb77e9bc fix(nimble): Added support for deleting the oldest bonded device across reboot (v4.4) 2024-03-21 10:52:13 +05:30
Rahul Tank
6f4ff9b30f Merge branch 'bugfix/fix_dangling_pointer_compilation_warning_v4.4' into 'release/v4.4'
fix(nimble): Fix dangling pointer error during compilation (v4.4)

See merge request espressif/esp-idf!29743
2024-03-21 13:05:37 +08:00
wangjialiang
000bf3a365 update invalid links in the ble mesh example documentation 2024-03-21 11:13:37 +08:00
luoxu
ce36163317 bugfix(ble_mesh): Avoid provisioner handling messages from nodes that have already left the network. 2024-03-21 11:13:37 +08:00
Roland Dobai
2a4923faa6 Merge branch 'refactor/idf_tools_version_v4.4' into 'release/v4.4'
refactor(idf_tools): IDF version is acquired only from version or header file (backport v4.4)

See merge request espressif/esp-idf!29745
2024-03-20 21:33:30 +08:00
Jakub Kocka
dfe281bbf4 refactor(idf_tools): IDF version is acquired only from version or header file
Closes https://github.com/espressif/esp-idf/issues/13385
2024-03-20 13:42:27 +01:00
Jiang Jiang Jian
5452195e33 Merge branch 'bugfix/cve-2023-52160_v4.4' into 'release/v4.4'
fix(wpa_supplicant): (PEAP client) Update Phase 2 auth requirements (v4.4)

See merge request espressif/esp-idf!29752
2024-03-20 16:25:51 +08:00
Jiang Jiang Jian
8df220e6a4 Merge branch 'bugfix/fix_fastmem_slowmem_lost_data_bug_v4.4' into 'release/v4.4'
[C3/S3]Fix sleep fast_mem & slow_mem may lost bug (v4.4)

See merge request espressif/esp-idf!29643
2024-03-20 16:24:56 +08:00
Jiang Jiang Jian
894a0d54e5 Merge branch 'bugfix/fix_s3_bbpll_cali_fail_bug_v4.4' into 'release/v4.4'
fix: fix s3 bbpll calibration fail bug (v4.4)

See merge request espressif/esp-idf!29647
2024-03-20 16:21:22 +08:00
Kapil Gupta
4db2ef0f33 fix(wpa_supplicant): (PEAP client) Update Phase 2 auth requirements
The previous PEAP client behavior allowed the server to skip Phase 2
authentication with the expectation that the server was authenticated
during Phase 1 through TLS server certificate validation. Various PEAP
specifications are not exactly clear on what the behavior on this front
is supposed to be and as such, this ended up being more flexible than
the TTLS/FAST/TEAP cases. However, this is not really ideal when
unfortunately common misconfiguration of PEAP is used in deployed
devices where the server trust root (ca_cert) is not configured or the
user has an easy option for allowing this validation step to be skipped.

Change the default PEAP client behavior to be to require Phase 2
authentication to be successfully completed for cases where TLS session
resumption is not used and the client certificate has not been
configured. Those two exceptions are the main cases where a deployed
authentication server might skip Phase 2 and as such, where a more
strict default behavior could result in undesired interoperability
issues. Requiring Phase 2 authentication will end up disabling TLS
session resumption automatically to avoid interoperability issues.

Allow Phase 2 authentication behavior to be configured with a new phase1
configuration parameter option:
'phase2_auth' option can be used to control Phase 2 (i.e., within TLS
tunnel) behavior for PEAP:
 * 0 = do not require Phase 2 authentication
 * 1 = require Phase 2 authentication when client certificate
   (private_key/client_cert) is no used and TLS session resumption was
   not used (default)
 * 2 = require Phase 2 authentication in all cases
2024-03-20 09:42:14 +05:30
Marius Vikhammer
8643854656 Merge branch 'fix/console-build-error_v4.4' into 'release/v4.4'
console: Fix building issue when serial JTAG is set (v4.4)

See merge request espressif/esp-idf!23737
2024-03-20 10:35:53 +08:00
Rahul Tank
7489d8ff2d fix(nimble): Fix dangling pointer error during compilation 2024-03-19 19:32:56 +05:30
hongshuqing
fbe83d8738 fix: fix s3 bbpll cali fail bug 2024-03-19 14:22:56 +08:00
Jiang Jiang Jian
7bc11370e6 Merge branch 'doc/update_espnow_doc_v4.4' into 'release/v4.4'
docs(wifi): Updated the LMK description in ESP-NOW (v4.4)

See merge request espressif/esp-idf!29672
2024-03-19 14:22:02 +08:00
Jiang Jiang Jian
dc354527dc Merge branch 'bugfix/make_coexist_callback_safe_v4.4' into 'release/v4.4'
fix(bt/controller): Fixed some bugs in esp32 bt controller (v4.4)

See merge request espressif/esp-idf!29685
2024-03-19 14:21:34 +08:00
chaijie@espressif.com
30edfaeb06 fix: fix sleep fast_mem & slow_mem may lost bug 2024-03-15 20:02:29 +08:00
linruihao
24b5515d4f fix(bt/controller): Fixed some bugs in esp32 bt controller
1. fixed crash issue in coexist callback
2. fixed wrong LMP message send when expect peer device increase tx power to max
2024-03-15 19:09:07 +08:00
Roland Dobai
0b75989e37 Merge branch 'fix/fix_curses_py312_v4.4' into 'release/v4.4'
Fix Access Violation Error on Windows with Python 3.12 (v4.4)

See merge request espressif/esp-idf!29512
2024-03-15 16:20:14 +08:00
zhangyanjiao
457c7ed867 docs(wifi): Updated the LMK description in ESP-NOW
Closes https://github.com/espressif/esp-idf/issues/12976
2024-03-15 15:25:16 +08:00
Jiang Jiang Jian
d3a0f26c84 Merge branch 'feat/move_ag_cb_malloc_to_btc_v4.4' into 'release/v4.4'
feat(bt/bluedroid): Moved the memory allocation of HF AG control blocks to BTC module (v4.4)

See merge request espressif/esp-idf!29634
2024-03-14 16:22:56 +08:00
Jiang Jiang Jian
30f96ffe48 Merge branch 'bugfix/sdspi_acmd41_arg_v4.4' into 'release/v4.4'
fix(sdmmc): fixes for card initialization (ACMD41) (v4.4)

See merge request espressif/esp-idf!29379
2024-03-14 16:22:32 +08:00
Jin Cheng
9830b8bb22 feat(bt/bluedroid): Moved the memory allocation of HF AG control blocks to BTC module 2024-03-14 10:56:25 +08:00
Rahul Tank
f2d72feab8 Merge branch 'contrib/github_pr_13034_v4.4' into 'release/v4.4'
docs(nimble): Fixed typo in examples/bluetooth/nimble/blehr/README (GitHub PR) (v4.4)

See merge request espressif/esp-idf!29618
2024-03-14 03:30:47 +08:00
Martin Vychodil
d2bc43f543 Merge branch 'bugfix/nvs_lock_initi_and_multipage_blob_v4.4' into 'release/v4.4'
Bugfix/nvs Improved handling of BLOB during unreliable power environment and concurrent data access scenarios (v4.4)

See merge request espressif/esp-idf!29324
2024-03-13 23:04:32 +08:00
Alex Verschoot
60b9b7ef82 Update README.md
Fix typo
2024-03-13 17:09:53 +05:30
Rahul Tank
cfb86ecfc6 Merge branch 'bugfix/reconnect_host_based_v4.4' into 'release/v4.4'
fix(nimble): Added ble_host_rpa_enabled flag for address resoultion for esp32 (v4.4)

See merge request espressif/esp-idf!29573
2024-03-13 12:25:49 +08:00
radek.tandler
651102302a fix(nvs): CMakeLists.txt adopted for nvs_host_test v4.4 2024-03-12 13:36:15 +01:00
radek.tandler
156429b56a fix(nvs): Fixed Page::findItem performance degradation caused by wrong condition before hash map use
The condition enabling use of hash map when page is searched for Item was modified
to correct the bug introduced by commit addressing delete of any BLOB_INDEX Items.
This correction returns the performance of findItem to the state before previous change.
2024-03-12 13:34:51 +01:00
Roland Dobai
cebb1b3068 Merge branch 'feature/export_bat_exit_codes_v4.4' into 'release/v4.4'
feat(tools): produce correct err code in install/export .bat scripts (v4.4)

See merge request espressif/esp-idf!29547
2024-03-12 15:14:07 +08:00
Darshan Dobariya
1243dab84d fix(nimble): Added ble_host_rpa_enabled flag for address resoultion for esp32 (v4.4) 2024-03-12 12:30:25 +05:30
Jiang Jiang Jian
5bd00ecceb Merge branch 'bugfix/fix_some_ble_bugs_cjh_v4.4' into 'release/v4.4'
Fixed some BLE bugs 2403 (backport v4.4)

See merge request espressif/esp-idf!29468
2024-03-12 11:02:39 +08:00
Marek Fiala
d65e3c8f4e feat(tools): produce correct err code in export/install .bat scripts
Plus unify labels to begin with underscore
2024-03-11 10:11:40 +01:00
Jiang Jiang Jian
c4ce15b33d Merge branch 'bugfix/fix_some_ble_bugs_240310_v4.4' into 'release/v4.4'
Bugfix/fix some ble bugs 240310 v4.4(backport v4.4)

See merge request espressif/esp-idf!29520
2024-03-11 11:24:50 +08:00
zhanghaipeng
7eebebff0c fix(ble/bluedroid): Fixed BLE BLE periodic advertising parameter check 2024-03-10 20:08:51 +08:00
zhanghaipeng
4b40817158 fix(ble/bluedroid): Fixed BLE crash when repeatedly initialize and deinitialize host 2024-03-10 20:05:16 +08:00
Rahul Tank
c93a15c19d Merge branch 'bugfix/gap_connect_failed_with_0x0d_v4.4' into 'release/v4.4'
fix(nimble): Revise the help section for the Kconfig macro BLE_RPA_TIMEOUT (v4.4)

See merge request espressif/esp-idf!29495
2024-03-08 22:44:16 +08:00
Jan Beran
009d84cc8f fix(menuconfig): Prevent Access violation on Windows with Python 3.12
Closes https://github.com/espressif/esp-idf/issues/13232
2024-03-08 14:30:43 +01:00
Abhinav Kudnar
64b278f74e fix(nimble): Revise the help section for the Kconfig macro BLE_RPA_TIMEOUT 2024-03-08 11:31:36 +05:30
chenjianhua
285bffbffd feat(bt/bluedroid): Add ext adv and privacy status check 2024-03-07 14:25:35 +08:00
thekurtovic
a2cc7980e4 fix(bt/bluedroid): Fixed "reprot" typo in esp_ble_gap_ext_adv_reprot_t 2024-03-07 14:25:28 +08:00
Raghu Saxena
c6f12bdf29 fix(bt/example): Use correct struct type 2024-03-07 14:25:15 +08:00
Joshua
6ca03fc600 fix(bt/blufi): Fixed BluFi module link error(C++ hybrid compilation) 2024-03-07 14:22:42 +08:00
chenjianhua
8ada7f868b fix(bt/bluedroid): Fixed crash when calculating GATTS database hash 2024-03-07 14:19:00 +08:00
chenjianhua
17e3c69694 fix(bt): Update bt lib for ESP32(5ea2fca)
- Fixed HCI command status event sending for disconnect command
- Fixed LE transmitter test command param check
2024-03-07 14:18:18 +08:00
Jin Cheng
4734fb0044 fix(bt/controller): Fixed 3 esp32 bt controller bugs
update esp32 bt-lib (952debf4)

1. Increased the length of queue for coexist requestions
2. fix(bt/controller): Cleared BT SNIFF when no connections exists
3. fix(bt/controller): Corrected a typo in coex module
2024-03-07 14:18:13 +08:00
chenjianhua
e249971122 fix(bt): Update bt lib for ESP32(2de69f3)
- Fixed HCI command status event send when LLCP busy
2024-03-07 14:18:07 +08:00
Rahul Tank
407795da51 Merge branch 'bugfix/addr_resol_for_esp32_v4.4' into 'release/v4.4'
fix(nimble): Added the check to prevent address resolution in case of identity addr for esp32(v4.4)

See merge request espressif/esp-idf!29347
2024-03-06 20:17:55 +08:00
Abhinav Kudnar
4e73d06135 fix(nimble): Added the check to prevent address resolution in case of identity addr for esp32 2024-03-06 15:16:50 +05:30
Island
29efc9650d Merge branch 'bugfix/struct_init_order_blemesh_v4.4' into 'release/v4.4'
ble_mesh: example: fix the structure init order to meet C++ requirements(backport v4.4)

See merge request espressif/esp-idf!28929
2024-03-06 14:09:28 +08:00
Rahul Tank
0eb7ad2032 Merge branch 'feat/ble_gap_dev_auth_v4.4' into 'release/v4.4'
feat(nimble): Authorize or deauthorize a BLE device for a connection (v4.4)

See merge request espressif/esp-idf!29244
2024-03-05 20:50:29 +08:00
Darshan Dobariya
e79e35219e feat(nimble): Authorize or deauthorize a BLE device for a connection (v4.4) 2024-03-05 10:02:37 +05:30
Michael (XIAO Xufeng)
e374f8fd6a Merge branch 'feature/add_new_pkg_and_flash_psram_efuses_v4.4' into 'release/v4.4'
feat(efuse): Add flash&psram efuses for S3 (v4.4)

See merge request espressif/esp-idf!29145
2024-03-05 10:54:38 +08:00
Rahul Tank
7a00499cc9 Merge branch 'bugfix/move_count_v4.4' into 'release/v4.4'
fix(nimble): Fix compilation issue in nimble for -O2 flag (v4.4)

See merge request espressif/esp-idf!29076
2024-03-04 22:05:56 +08:00
Rahul Tank
29f92595bf Merge branch 'bugfix/increase_reattempt_conn_count_v4.4' into 'release/v4.4'
fix(nimble): Increase range of reattempt connection count (v4.4)

See merge request espressif/esp-idf!29343
2024-03-04 19:44:21 +08:00
Darshan Dobariya
0e9b28f7fb fix(nimble): Fix compilation issue in nimble for -O2 flag (v4.4) 2024-03-04 15:19:52 +05:30
Guillaume Souchere
f47d9432a0 console: Fix building issue when serial JTAG is set
Closes https://github.com/espressif/esp-idf/issues/10707
2024-03-04 14:29:39 +08:00
morris
0241b95b71 Merge branch 'bugfix/usb_host_usbh_callback_misses_action_v4.4' into 'release/v4.4'
fix(usb): Fix bug where usbh_process() misses an event (v4.4)

See merge request espressif/esp-idf!29367
2024-03-04 11:38:12 +08:00
Jiang Jiang Jian
6ec1935ccb Merge branch 'bugfix/fix_issues_in_mesh_and_scan_v4.4' into 'release/v4.4'
fix(wifi): fixed scan and mesh deinit issues (v4.4)

See merge request espressif/esp-idf!29203
2024-03-04 10:56:29 +08:00
Jiang Jiang Jian
093f04510f Merge branch 'bugfix/ip101_reset_timing_v4.4' into 'release/v4.4'
fix(esp_eth): ip101-specific reset_hw to match reset timings from datasheet (v4.4)

See merge request espressif/esp-idf!29015
2024-03-04 10:40:47 +08:00
Jiang Jiang Jian
fdfe99cdb2 Merge branch 'bugfix/improve_find_by_addr' into 'release/v4.4'
fix(nimble): Improve find conn by ble_addr_t (v4.4)

See merge request espressif/esp-idf!29134
2024-03-04 10:40:27 +08:00
Jiang Jiang Jian
6cb955e8e6 Merge branch 'bugfix/update_spp_doc_v4.4' into 'release/v4.4'
docs(bt/bluedroid): update API documents of SPP (v4.4)

See merge request espressif/esp-idf!29173
2024-03-04 10:40:05 +08:00
Jiang Jiang Jian
8247e0b058 Merge branch 'bugfix/fix_ble_max_reconnect_v4.4' into 'release/v4.4'
fix(ble/bluedroid): Update maximum BLE reconnection attempts configuration(backport v4.4)

See merge request espressif/esp-idf!29221
2024-03-04 10:38:03 +08:00
Jiang Jiang Jian
303ad716b6 Merge branch 'bugfix/bootloader_custom_rtc_data_crc' into 'release/v4.4'
fix(bootloader): add legacy retained memory CRC calculation (backport v4.4)

See merge request espressif/esp-idf!28142
2024-03-04 10:36:39 +08:00
Jiang Jiang Jian
5c5ab4b0c9 Merge branch 'change/reduce_usage_of_iram_when_bt_in_single_mode_v4.4' into 'release/v4.4'
change(bt/bluedroid): Redirect app functions in controller based on the bluetooth mode(backport v4.4)

See merge request espressif/esp-idf!29227
2024-03-04 10:35:29 +08:00
Jiang Jiang Jian
fac1a07248 Merge branch 'bugfix/fix_coex_lib_circular_dependency_v4.4' into 'release/v4.4'
fix(esp_coex): fix circular dependency issue on esp32 (v4.4)

See merge request espressif/esp-idf!29175
2024-03-04 10:34:18 +08:00
Roland Dobai
611a3735b5 Merge branch 'feature/add_esp_idf_version_env_var' into 'release/v4.4'
feat(tools): add ESP_IDF_VERSION env var to v4.4

See merge request espressif/esp-idf!29230
2024-03-01 21:55:19 +08:00
Roland Dobai
23ddb21992 Merge branch 'feat/bump_up_pre_commit_hook_v4.4' into 'release/v4.4'
fix: Bump up pre-commit hooks version (v4.4)

See merge request espressif/esp-idf!29255
2024-03-01 21:55:05 +08:00
Ivan Grokhotkov
6383fd550a fix(sdmmc): extend the maximum number of retries of ACMD41
According to the application note in SD Card Physical Specification:

> The host shall set ACMD41 timeout more than 1 second to abort repeat
of issuing ACMD41 when the card does not indicate ready. The timeout
count starts from the first ACMD41 which is set voltage window
in the argument.

Previously, the timeout was exactly one second, and this caused
certain larger-capacity cards to "time out", because they couldn't
finish initialization process in time.
2024-03-01 10:50:29 +01:00
Ivan Grokhotkov
dceec3fac0 fix(sdmmc): use correct argument for ACMD41 in SPI mode
ACMD41 argument is different between SD mode and SPI mode.
In SPI mode, the only non-zero bit may be the HCS bit. Unlike the SD
mode, the bits reflecting the host's OCR should be zero.
Previously, we used to set these bits the same way as for the SD mode.
This has caused certain cards to fail initializing, apparently their
controllers have checked the ACMD41 argument more strictly and refused
to finish initialization, resulting in an error such as

    sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107

(Note that this error may have other causes than the one fixed in
this commit. For example, if the card doesn't have a sufficient and
stable power supply, it may also fail to complete the internal
initialization process, and will never clear the busy flag in R1
response.)

Closes https://github.com/espressif/esp-idf/issues/6686
Closes https://github.com/espressif/esp-idf/issues/10542
2024-03-01 10:50:29 +01:00
Darian Leung
8f208fd0c0 fix(usb): Fix bug where usbh_process() misses an event
This commit fixes a bug where if multiple concurrent USBH API calls trigger
multiple events on the same device, some events will be lost. As a result,
those lost events don't get processed by the subsequent usbh_process() call.
2024-03-01 14:34:28 +08:00
Rahul Tank
1b249261f3 fix(nimble): Increase range of reattempt connection count 2024-02-29 15:58:33 +05:30
Roland Dobai
d9b9b76785 Merge branch 'fix/reachable_tag_v4.4' into 'release/v4.4'
CI: Make the v4.4.7 tag be reachable from release/v4.4

See merge request espressif/esp-idf!29316
2024-02-29 15:31:31 +08:00
radek.tandler
e6f5608739 fix(nvs): Improved lockig mechanism for initialization phase 2024-02-28 14:18:10 +01:00
radek.tandler
871534b64b fix(nvs): eraseMultiPageBlob to robustly delete all related BLOB_DATA records and respect VER_ANY 2024-02-28 12:44:09 +01:00
radek.tandler
62dc1fdf04 fix(nvs): corrected findItem to return BLOB_DATA when chunkIndex = CHUNK_ANY 2024-02-28 12:44:09 +01:00
radek.tandler
e818c42e1c fix(nvs): added check and erase of mismatched BLOB_DATA on init 2024-02-28 12:44:08 +01:00
Ivan Grokhotkov
5bd115a12e fix(nvs): prevent out of bounds write if blob data is inconsistent 2024-02-28 12:44:08 +01:00
Roland Dobai
2e21cf9cc7 Merge branch 'update/version_4_4_7' into 'release/v4.4'
Update version to 4.4.7

See merge request espressif/esp-idf!29284
2024-02-27 21:50:38 +08:00
Roland Dobai
38eeba213a change(version): Update version to 4.4.7 2024-02-27 09:07:40 +01:00
Roland Dobai
4bd9aae42b change(version): Update version to 4.4.7 2024-02-27 07:28:32 +01:00
Marek Fiala
b5b0b4d150 feat(tools): add ESP_IDF_VERSION env var to v4.4
Closes https://github.com/espressif/esp-idf/issues/10677
2024-02-26 10:59:19 +01:00
Jan Beran
c8ec6573bc fix: Bump up pre-commit hooks version 2024-02-26 10:35:26 +01:00
gongyantao
9fac48f089 change(bt/bluedroid): Redirect app functions in controller based on the bluetooth mode 2024-02-23 19:08:50 +08:00
zhanghaipeng
c73823095d fix(ble/bluedroid): Update maximum BLE reconnection attempts configuration 2024-02-23 15:49:30 +08: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
zhangyanjiao
989eb18f5d fix(wifi): fixed scan and mesh deinit issues
1. update scan ap number when clear scan ap records
2. wait for child disconnect when mesh deinit
2024-02-23 10:55:19 +08:00
Konstantin Kondrashov
d78b2b6af9 feat(efuse): Adds support for alternative efuse names 2024-02-22 11:57:17 +02:00
KonstantinKondrashov
9cb32917a5 feat(efuse): Add flash&psram efuses for S3 2024-02-22 11:49:28 +02:00
linruihao
2c62a152fb fix(esp_coex): fix circular dependency issue on esp32
Closes https://github.com/espressif/esp-idf/issues/13113
2024-02-22 16:54:58 +08:00
Rahul Tank
ead3022f5b fix(nimble): Improve find conn by ble_addr_t 2024-02-22 09:01:42 +05:30
Jin Cheng
5c8190f2ad docs(bt/bluedroid): update API documents of SPP 2024-02-22 10:01:19 +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
Bogdan Kolendovskyy
bf73313e42 fix(esp_eth): ip101-specific reset_hw to match reset timings from datasheet
IP101 requires 10ms reset assertion time and 10ms post-reset delay to properly initialize.
2024-02-09 15:22:02 +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
InfiniteYuan
6b3109d161 ble_mesh: example: fix the structure init order to meet C++ requirements
Closes https://github.com/espressif/esp-idf/issues/8110
2024-02-07 16:38:19 +08:00
InfiniteYuan
d3290e761b ble_mesh: stack: fix the structure init order to meet C++ requirements 2024-02-07 16:38:19 +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
Omar Chebib
dbe4d156fe fix(bootloader): add legacy retained memory CRC calculation
* Closes https://github.com/espressif/esp-idf/issues/12849

In former versions of ESP-IDF, the user custom memory data in the retained memory
was taken into account during the CRC calculation. This was changed in a later
commit, the custom memory was ignored, therefore this can seen as a breaking change.
This commit gives the possibility to choose between the former (legacy) or new way of calculating the CRC.
2023-12-28 11:01:33 +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
636 changed files with 19433 additions and 7493 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
@@ -327,6 +289,7 @@ build_component_ut_esp32c3:
needs:
- job: fast_template_app
artifacts: false
optional: true
script:
- ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
- rm -rf test_build_system
@@ -344,15 +307,27 @@ test_build_system_cmake:
variables:
SHELL_TEST_SCRIPT: test_build_system_cmake.sh
test_build_system_cmake_macos:
extends:
- .test_build_system_template
- .before_script_macos
- .rules:build:macos
tags:
- macos_shell
variables:
SHELL_TEST_SCRIPT: test_build_system_cmake.sh
#test_build_system_cmake_macos:
# extends:
# - .test_build_system_template
# - .before_script_macos
# - .rules:build:macos
# tags:
# - macos_shell
# variables:
# SHELL_TEST_SCRIPT: test_build_system_cmake.sh
# script:
# - ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
# - rm -rf test_build_system
# - mkdir test_build_system
# - cd test_build_system
# # copy-paste the script from .test_build_system_template
# # since `ESP_IDF_TEMPLATE_GIT` is a group variable and has higher precedence than job variable
# # export here to override the group variable
# #
# # Clone the template app from github for macos runners
# - export ESP_IDF_TEMPLATE_GIT="https://github.com/espressif/esp-idf-template.git"
# - ${IDF_PATH}/tools/ci/${SHELL_TEST_SCRIPT}
build_docker:
extends:

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,9 +1,11 @@
# 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
rev: v4.5.0
hooks:
- id: trailing-whitespace
# note: whitespace exclusions use multiline regex, see https://pre-commit.com/#regular-expressions
@@ -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

@@ -17,6 +17,7 @@
#include "esp_freertos_hooks.h"
#include "esp_private/dbg_stubs.h"
#include "esp_ipc.h"
#include "esp_attr.h"
#include "hal/wdt_hal.h"
#if CONFIG_IDF_TARGET_ESP32
#include "esp32/rom/libc_stubs.h"
@@ -80,6 +81,7 @@ void gcov_create_task(void *arg)
xTaskCreatePinnedToCore(&gcov_dump_task, "gcov_dump_task", 2048, (void *)&s_gcov_task_running, configMAX_PRIORITIES - 1, NULL, 0);
}
static IRAM_ATTR
void gcov_create_task_tick_hook(void)
{
extern esp_err_t esp_ipc_start_gcov_from_isr(uint32_t cpu_id, esp_ipc_func_t func, void* arg);

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"
@@ -383,6 +415,21 @@ menu "Bootloader config"
(The application and bootoloader must be compiled with the same option).
The RTC FAST memory has access only through PRO_CPU.
config BOOTLOADER_CUSTOM_RESERVE_RTC_IN_CRC
bool "Include custom memory in the CRC calculation"
depends on BOOTLOADER_CUSTOM_RESERVE_RTC
default n
help
This option allows the customer to use the legacy bootloader behavior when the
RTC FAST memory CRC calculation takes place. When this option is enabled, the
allocated user custom data will be taken into account in the CRC calculcation.
This means that any change to the custom data would need a CRC update to prevent
the bootloader from marking this data as corrupted.
If this option is disabled, the custom data will not be taken into account when
calculating the RTC FAST memory CRC. The user custom data can be changed freely,
without the need to update the CRC.
THIS OPTION MUST BE THE SAME FOR BOTH THE BOOTLOADER AND THE APPLICATION BUILDS.
config BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE
hex "Size in bytes for custom purposes"
default 0
@@ -393,14 +440,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

@@ -168,7 +168,7 @@ SOC_RESERVE_MEMORY_REGION(RTC_RETAIN_MEM_ADDR, RTC_RETAIN_MEM_ADDR + sizeof(rtc_
#endif
static uint32_t rtc_retain_mem_size(void) {
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
#if CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC && !CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_IN_CRC
/* A custom memory has been reserved by the user, do not consider this memory into CRC calculation as it may change without
* the have the user updating the CRC. Return the offset of the custom field, which is equivalent to size of the structure
* minus the size of everything after (including) `custom` */

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

@@ -25,10 +25,13 @@ if(CONFIG_BT_ENABLED)
list(APPEND include_dirs
common/api/include/api
common/btc/profile/esp/blufi/include
common/btc/profile/esp/include)
common/btc/profile/esp/include
common/hci_log/include)
list(APPEND srcs "common/btc/core/btc_alarm.c"
"common/api/esp_blufi_api.c"
"common/hci_log/bt_hci_log.c"
"common/btc/core/btc_manage.c"
"common/btc/core/btc_task.c"
"common/btc/profile/esp/blufi/blufi_prf.c"

View File

@@ -57,6 +57,37 @@ menu "Bluetooth"
source "$IDF_PATH/components/bt/host/nimble/Kconfig.in"
endmenu
config BT_HCI_LOG_DEBUG_EN
depends on BT_BLUEDROID_ENABLED || BT_NIMBLE_ENABLED
bool "Enable Bluetooth HCI debug mode"
default n
help
This option is used to enable bluetooth debug mode, which saves the hci layer data stream.
config BT_HCI_LOG_DATA_BUFFER_SIZE
depends on BT_HCI_LOG_DEBUG_EN
int "Size of the cache used for HCI data in Bluetooth HCI debug mode (N*1024 bytes)"
range 1 100
default 5
help
This option is to configure the buffer size of the hci data steam cache in hci debug mode.
This is a ring buffer, the new data will overwrite the oldest data if the buffer is full.
config BT_HCI_LOG_ADV_BUFFER_SIZE
depends on BT_HCI_LOG_DEBUG_EN
int "Size of the cache used for adv report in Bluetooth HCI debug mode (N*1024 bytes)"
range 1 100
default 8
help
This option is to configure the buffer size of the hci adv report cache in hci debug mode.
This is a ring buffer, the new data will overwrite the oldest data if the buffer is full.
menu "Common Options"
visible if (BT_BLUEDROID_ENABLED || BT_NIMBLE_ENABLED)
source "$IDF_PATH/components/bt/common/Kconfig.in"
endmenu
endmenu
menuconfig BLE_MESH

View File

@@ -0,0 +1,6 @@
config BT_ALARM_MAX_NUM
int "Maximum number of Bluetooth alarms"
default 50
help
This option decides the maximum number of alarms which
could be used by Bluetooth host.

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-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdlib.h>
#include <string.h>
@@ -331,6 +323,13 @@ static void btc_deinit_mem(void) {
#endif
#endif
#if BTC_HF_INCLUDED == TRUE && HFP_DYNAMIC_MEMORY == TRUE
if (hf_local_param_ptr) {
osi_free(hf_local_param_ptr);
hf_local_param_ptr = NULL;
}
#endif
#if BTC_HF_CLIENT_INCLUDED == TRUE && HFP_DYNAMIC_MEMORY == TRUE
if (hf_client_local_param_ptr) {
osi_free(hf_client_local_param_ptr);
@@ -386,6 +385,13 @@ static bt_status_t btc_init_mem(void) {
#endif
#endif
#if BTC_HF_INCLUDED == TRUE && HFP_DYNAMIC_MEMORY == TRUE
if ((hf_local_param_ptr = (hf_local_param_t *)osi_malloc(BTC_HF_NUM_CB * sizeof(hf_local_param_t))) == NULL) {
goto error_exit;
}
memset((void *)hf_local_param_ptr, 0, BTC_HF_NUM_CB * sizeof(hf_local_param_t));
#endif
#if BTC_HF_CLIENT_INCLUDED == TRUE && HFP_DYNAMIC_MEMORY == TRUE
if ((hf_client_local_param_ptr = (hf_client_local_param_t *)osi_malloc(sizeof(hf_client_local_param_t))) == NULL) {
goto error_exit;

View File

@@ -1,22 +1,19 @@
// 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-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __BLUFI_INT_H__
#define __BLUFI_INT_H__
#include "btc/btc_task.h"
#include "esp_blufi_api.h"
#ifdef __cplusplus
extern "C" {
#endif
#if (BLUFI_INCLUDED == TRUE)
#define BTC_BLUFI_GREAT_VER 0x01 //Version + Subversion
@@ -201,5 +198,10 @@ void btc_blufi_cb_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
void btc_blufi_cb_deep_free(btc_msg_t *msg);
#endif /* __BLUFI_INT_H__ */
#endif ///BLUFI_INCLUDED == TRUE
#endif ///BLUFI_INCLUDED == TRUE
#ifdef __cplusplus
}
#endif
#endif /* __BLUFI_INT_H__ */

View File

@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __ESP_BLUFI_H__
#define __ESP_BLUFI_H__
@@ -13,6 +19,10 @@
#include "esp_gap_ble_api.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define BLUFI_APP_UUID 0xFFFF
#define BLUFI_DEVICE_NAME "BLUFI_DEVICE"
@@ -74,4 +84,7 @@ void esp_blufi_adv_start(void);
void esp_blufi_send_encap(void *arg);
#ifdef __cplusplus
}
#endif
#endif/* _ESP_BLUFI_ */

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-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __BTC_BLUFI_PRF_H__
#define __BTC_BLUFI_PRF_H__
@@ -29,6 +21,11 @@
#define ESP_BLUFI_SUCCESS 0x00
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define BT_BD_ADDR_STR "%02x:%02x:%02x:%02x:%02x:%02x"
#define BT_BD_ADDR_HEX(addr) addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]
@@ -108,4 +105,7 @@ void btc_blufi_call_deep_free(btc_msg_t *msg);
uint16_t btc_blufi_get_version(void);
#ifdef __cplusplus
}
#endif
#endif /* __BTC_BLUFI_PRF_H__ */

View File

@@ -0,0 +1,334 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "hci_log/bt_hci_log.h"
#include "bt_common.h"
#include "osi/mutex.h"
#include "esp_attr.h"
#if (BT_HCI_LOG_INCLUDED == TRUE)
#define BT_HCI_LOG_PRINT_TAG (1)
#define BT_HCI_LOG_DATA_BUF_SIZE (1024 * HCI_LOG_DATA_BUFFER_SIZE)
#define BT_HCI_LOG_ADV_BUF_SIZE (1024 * HCI_LOG_ADV_BUFFER_SIZE)
typedef struct {
osi_mutex_t mutex_lock;
uint64_t log_record_in;
uint64_t log_record_out;
uint64_t buf_size;
uint8_t *p_hci_log_buffer;
uint8_t index;
bool overflow;
} bt_hci_log_t;
static const char s_hex_to_char_mapping[16] = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
};
bt_hci_log_t g_bt_hci_log_data_ctl = {0};
bt_hci_log_t g_bt_hci_log_adv_ctl = {0};
esp_err_t bt_hci_log_init(void)
{
uint8_t *g_bt_hci_log_data_buffer = NULL;
uint8_t *g_bt_hci_log_adv_buffer = NULL;
g_bt_hci_log_data_buffer = malloc(BT_HCI_LOG_DATA_BUF_SIZE);
if (!g_bt_hci_log_data_buffer) {
return ESP_ERR_NO_MEM;
}
g_bt_hci_log_adv_buffer = malloc(BT_HCI_LOG_ADV_BUF_SIZE);
if (!g_bt_hci_log_adv_buffer) {
if (g_bt_hci_log_data_buffer) {
free(g_bt_hci_log_data_buffer);
g_bt_hci_log_data_buffer = NULL;
}
return ESP_ERR_NO_MEM;
}
memset(g_bt_hci_log_data_buffer, 0, BT_HCI_LOG_DATA_BUF_SIZE);
memset(g_bt_hci_log_adv_buffer, 0, BT_HCI_LOG_ADV_BUF_SIZE);
memset(&g_bt_hci_log_data_ctl, 0, sizeof(bt_hci_log_t));
g_bt_hci_log_data_ctl.buf_size = BT_HCI_LOG_DATA_BUF_SIZE;
g_bt_hci_log_data_ctl.p_hci_log_buffer = g_bt_hci_log_data_buffer;
memset(&g_bt_hci_log_adv_ctl, 0, sizeof(bt_hci_log_t));
g_bt_hci_log_adv_ctl.buf_size = BT_HCI_LOG_ADV_BUF_SIZE;
g_bt_hci_log_adv_ctl.p_hci_log_buffer = g_bt_hci_log_adv_buffer;
osi_mutex_new((osi_mutex_t *)&g_bt_hci_log_data_ctl.mutex_lock);
osi_mutex_new((osi_mutex_t *)&g_bt_hci_log_adv_ctl.mutex_lock);
return ESP_OK;
}
esp_err_t bt_hci_log_deinit(void)
{
if (g_bt_hci_log_data_ctl.p_hci_log_buffer) {
free(g_bt_hci_log_data_ctl.p_hci_log_buffer);
g_bt_hci_log_data_ctl.p_hci_log_buffer = NULL;
}
if (g_bt_hci_log_adv_ctl.p_hci_log_buffer) {
free(g_bt_hci_log_adv_ctl.p_hci_log_buffer);
g_bt_hci_log_adv_ctl.p_hci_log_buffer = NULL;
}
osi_mutex_free((osi_mutex_t *)&g_bt_hci_log_data_ctl.mutex_lock);
osi_mutex_free((osi_mutex_t *)&g_bt_hci_log_adv_ctl.mutex_lock);
memset(&g_bt_hci_log_data_ctl, 0, sizeof(bt_hci_log_t));
memset(&g_bt_hci_log_adv_ctl, 0, sizeof(bt_hci_log_t));
return ESP_OK;
}
#if (BT_HCI_LOG_PRINT_TAG)
static char IRAM_ATTR *bt_data_type_to_str(uint8_t data_type)
{
char *tag = NULL;
switch (data_type)
{
case HCI_LOG_DATA_TYPE_COMMAND:
// hci cmd data
tag = "CMD";
break;
case HCI_LOG_DATA_TYPE_H2C_ACL:
// host to controller hci acl data
tag = "HAL";
break;
case HCI_LOG_DATA_TYPE_SCO:
// hci sco data
tag = "SCO";
break;
case HCI_LOG_DATA_TYPE_EVENT:
// hci event
tag = "EVT";
break;
case HCI_LOG_DATA_TYPE_ADV:
// controller adv report data
tag = "ADV";
break;
case HCI_LOG_DATA_TYPE_C2H_ACL:
// controller to host hci acl data
tag = "CAL";
break;
case HCI_LOG_DATA_TYPE_SELF_DEFINE:
// self-defining data
tag = "ST";
break;
default:
// unknown data type
tag = "UK";
break;
}
return tag;
}
#endif
void bt_hci_log_record_hex(bt_hci_log_t *p_hci_log_ctl, uint8_t *hex, uint8_t hex_len)
{
uint8_t hci_log_char;
uint8_t *g_hci_log_buffer;
g_hci_log_buffer = p_hci_log_ctl->p_hci_log_buffer;
while (hex_len--)
{
hci_log_char = ((*hex) >> 4);
g_hci_log_buffer[p_hci_log_ctl->log_record_in] = s_hex_to_char_mapping [hci_log_char];
if (++ p_hci_log_ctl->log_record_in >= p_hci_log_ctl->buf_size) {
p_hci_log_ctl->log_record_in = 0;
}
if (p_hci_log_ctl->log_record_in == p_hci_log_ctl->log_record_out) {
p_hci_log_ctl->overflow = true;
}
hci_log_char = ((*hex) & 0x0f);
g_hci_log_buffer[p_hci_log_ctl->log_record_in] = s_hex_to_char_mapping [hci_log_char];
if (++p_hci_log_ctl->log_record_in >= p_hci_log_ctl->buf_size) {
p_hci_log_ctl->log_record_in = 0;
}
if (p_hci_log_ctl->log_record_in == p_hci_log_ctl->log_record_out) {
p_hci_log_ctl->overflow = true;
}
g_hci_log_buffer[p_hci_log_ctl->log_record_in] = ' ';
if (++ p_hci_log_ctl->log_record_in >= p_hci_log_ctl->buf_size) {
p_hci_log_ctl->log_record_in = 0;
}
if (p_hci_log_ctl->log_record_in == p_hci_log_ctl->log_record_out) {
p_hci_log_ctl->overflow = true;
}
++ hex;
}
}
void bt_hci_log_record_string(bt_hci_log_t *p_hci_log_ctl, char *string)
{
uint8_t *g_hci_log_buffer;
g_hci_log_buffer = p_hci_log_ctl->p_hci_log_buffer;
while (*string != '\0') {
g_hci_log_buffer[p_hci_log_ctl->log_record_in] = *string;
++string;
if (++p_hci_log_ctl->log_record_in >= p_hci_log_ctl->buf_size) {
p_hci_log_ctl->log_record_in = 0;
}
if (p_hci_log_ctl->log_record_in == p_hci_log_ctl->log_record_out) {
p_hci_log_ctl->overflow = true;
}
}
}
esp_err_t IRAM_ATTR bt_hci_log_record_data(bt_hci_log_t *p_hci_log_ctl, char *str, uint8_t data_type, uint8_t *data, uint8_t data_len)
{
osi_mutex_t mutex_lock;
uint8_t *g_hci_log_buffer;
if (!p_hci_log_ctl->p_hci_log_buffer) {
return ESP_FAIL;
}
g_hci_log_buffer = p_hci_log_ctl->p_hci_log_buffer;
if (!g_hci_log_buffer) {
return ESP_FAIL;
}
mutex_lock = p_hci_log_ctl->mutex_lock;
osi_mutex_lock(&mutex_lock, OSI_MUTEX_MAX_TIMEOUT);
#if (1)
// Add hci data index
bt_hci_log_record_hex(p_hci_log_ctl, &p_hci_log_ctl->index, 1);
#endif
#if (BT_HCI_LOG_PRINT_TAG)
char *tag = NULL;
tag = bt_data_type_to_str(data_type);
if (tag) {
bt_hci_log_record_string(p_hci_log_ctl, tag);
g_hci_log_buffer[p_hci_log_ctl->log_record_in] = ':';
if (++p_hci_log_ctl->log_record_in >= p_hci_log_ctl->buf_size) {
p_hci_log_ctl->log_record_in = 0;
}
if (p_hci_log_ctl->log_record_in == p_hci_log_ctl->log_record_out) {
p_hci_log_ctl->overflow = true;
}
}
#endif
if (str) {
bt_hci_log_record_string(p_hci_log_ctl, str);
}
bt_hci_log_record_hex(p_hci_log_ctl, data, data_len);
g_hci_log_buffer[p_hci_log_ctl->log_record_in] = '\n';
if (++p_hci_log_ctl->log_record_in >= p_hci_log_ctl->buf_size) {
p_hci_log_ctl->log_record_in = 0;
}
if (p_hci_log_ctl->log_record_in == p_hci_log_ctl->log_record_out) {
p_hci_log_ctl->overflow = true;
}
p_hci_log_ctl->index ++;
osi_mutex_unlock(&mutex_lock);
return ESP_OK;
}
void bt_hci_log_data_show(bt_hci_log_t *p_hci_log_ctl)
{
volatile uint64_t log_record_in,log_record_out;
uint8_t *g_hci_log_buffer;
if (!p_hci_log_ctl->p_hci_log_buffer) {
return;
}
osi_mutex_t mutex_lock = p_hci_log_ctl->mutex_lock;
osi_mutex_lock(&mutex_lock, OSI_MUTEX_MAX_TIMEOUT);
log_record_in = p_hci_log_ctl->log_record_in;
log_record_out = p_hci_log_ctl->log_record_out;
g_hci_log_buffer = p_hci_log_ctl->p_hci_log_buffer;
if (p_hci_log_ctl->overflow) {
log_record_out = log_record_in;
printf("%c",g_hci_log_buffer[log_record_out]);
if (++log_record_out >= p_hci_log_ctl->buf_size) {
log_record_out = 0;
}
}
while (log_record_in != log_record_out)
{
printf("%c",g_hci_log_buffer[log_record_out]);
if (++log_record_out >= p_hci_log_ctl->buf_size) {
log_record_out = 0;
}
}
p_hci_log_ctl->log_record_out = log_record_out;
p_hci_log_ctl->overflow = false;
osi_mutex_unlock(&mutex_lock);
}
esp_err_t IRAM_ATTR bt_hci_log_record_hci_data(uint8_t data_type, uint8_t *data, uint8_t data_len)
{
return bt_hci_log_record_data(&g_bt_hci_log_data_ctl, NULL, data_type, data, data_len);
}
esp_err_t IRAM_ATTR bt_hci_log_record_custom_data(char *string, uint8_t *data, uint8_t data_len)
{
return bt_hci_log_record_data(&g_bt_hci_log_data_ctl, string, HCI_LOG_DATA_TYPE_SELF_DEFINE, data, data_len);
}
esp_err_t IRAM_ATTR bt_hci_log_record_hci_adv(uint8_t data_type, uint8_t *data, uint8_t data_len)
{
return bt_hci_log_record_data(&g_bt_hci_log_adv_ctl, NULL, data_type, data, data_len);
}
void bt_hci_log_hci_data_show(void)
{
bt_hci_log_data_show(&g_bt_hci_log_data_ctl);
}
void bt_hci_log_hci_adv_show(void)
{
bt_hci_log_data_show(&g_bt_hci_log_adv_ctl);
}
#endif // (BT_HCI_LOG_INCLUDED == TRUE)

View File

@@ -0,0 +1,108 @@
/*
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __ESP_BT_HCI_LOG_H__
#define __ESP_BT_HCI_LOG_H__
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
#define HCI_LOG_DATA_TYPE_COMMAND (1)
#define HCI_LOG_DATA_TYPE_H2C_ACL (2)
#define HCI_LOG_DATA_TYPE_SCO (3)
#define HCI_LOG_DATA_TYPE_EVENT (4)
#define HCI_LOG_DATA_TYPE_ADV (5)
#define HCI_LOG_DATA_TYPE_SELF_DEFINE (6)
#define HCI_LOG_DATA_TYPE_C2H_ACL (7)
/**
*
* @brief This function is called to record self-defining data
* @param string : data identification
* @param data : data
* @param data_len : the length of data
*
* @return ESP_OK - success, other - failed
*
*/
esp_err_t bt_hci_log_record_custom_data(char *string, uint8_t *data, uint8_t data_len);
/**
*
* @brief This function is called to print all hci data record
*
*
* @return None
*
*/
void bt_hci_log_hci_data_show(void);
/**
*
* @brief This function is called to print all adv report
*
*
* @return None
*
*/
void bt_hci_log_hci_adv_show(void);
/**
*
* @brief This function is called to init hci log env
*
*
* @return ESP_OK - success, other - failed
*
*/
esp_err_t bt_hci_log_init(void);
/**
*
* @brief This function is called to deinit hci debug mode,
* and can only be called internally by Bluetooth
*
*
* @return ESP_OK - success, other - failed
*
*/
esp_err_t bt_hci_log_deinit(void);
/**
*
* @brief This function is called to record hci data without adv report event,
* and can only be called internally by Bluetooth
*
* @param str : data type, define in bt_data_type_to_str()
* @param data : data
* @param data_len : the length of data
*
* @return ESP_OK - success, other - failed
*
*/
esp_err_t bt_hci_log_record_hci_data(uint8_t data_type, uint8_t *data, uint8_t data_len);
/**
*
* @brief This function is called to record hci adv report event only
* and can only be called internally by Bluetooth
*
* @param str : data type, define in bt_data_type_to_str()
* @param data : data
* @param data_len : the length of data
* @return ESP_OK - success, other - failed
*
*/
esp_err_t bt_hci_log_record_hci_adv(uint8_t data_type, uint8_t *data, uint8_t data_len);
#ifdef __cplusplus
}
#endif
#endif /* _ESP_BT_HCI_LOG_H__ */

View File

@@ -72,6 +72,24 @@
#define BT_BLE_DYNAMIC_ENV_MEMORY FALSE
#endif
#if UC_BT_HCI_LOG_DEBUG_EN
#define BT_HCI_LOG_INCLUDED UC_BT_HCI_LOG_DEBUG_EN
#else
#define BT_HCI_LOG_INCLUDED FALSE
#endif
#if UC_BT_HCI_LOG_DATA_BUFFER_SIZE
#define HCI_LOG_DATA_BUFFER_SIZE UC_BT_HCI_LOG_DATA_BUFFER_SIZE
#else
#define HCI_BUFFER_SIZE (5)
#endif
#if UC_BT_HCI_ADV_BUFFER_SIZE
#define HCI_LOG_ADV_BUFFER_SIZE UC_BT_HCI_LOG_ADV_BUFFER_SIZE
#else
#define HCI_LOG_ADV_BUFFER_SIZE (5)
#endif
/* OS Configuration from User config (eg: sdkconfig) */
#define TASK_PINNED_TO_CORE UC_TASK_PINNED_TO_CORE
#define BT_TASK_MAX_PRIORITIES configMAX_PRIORITIES

View File

@@ -52,6 +52,15 @@
#define UC_BTC_TASK_STACK_SIZE 4096
#endif
/**********************************************************
* Alarm reference
**********************************************************/
#ifdef CONFIG_BT_ALARM_MAX_NUM
#define UC_ALARM_MAX_NUM CONFIG_BT_ALARM_MAX_NUM
#else
#define UC_ALARM_MAX_NUM 50
#endif
/**********************************************************
* Trace reference
**********************************************************/
@@ -100,4 +109,22 @@
#define UC_BT_BLUEDROID_MEM_DEBUG FALSE
#endif
#ifdef CONFIG_BT_HCI_LOG_DEBUG_EN
#define UC_BT_HCI_LOG_DEBUG_EN TRUE
#else
#define UC_BT_HCI_LOG_DEBUG_EN FALSE
#endif
#ifdef CONFIG_BT_HCI_LOG_DATA_BUFFER_SIZE
#define UC_BT_HCI_LOG_DATA_BUFFER_SIZE CONFIG_BT_HCI_LOG_DATA_BUFFER_SIZE
#else
#define UC_BT_HCI_LOG_DATA_BUFFER_SIZE (5)
#endif
#ifdef CONFIG_BT_HCI_LOG_ADV_BUFFER_SIZE
#define UC_BT_HCI_LOG_ADV_BUFFER_SIZE CONFIG_BT_HCI_LOG_ADV_BUFFER_SIZE
#else
#define UC_BT_HCI_LOG_ADV_BUFFER_SIZE (5)
#endif
#endif /* __BT_USER_CONFIG_H__ */

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

@@ -21,6 +21,7 @@
#include <stdint.h>
#include "esp_timer.h"
#include "bt_user_config.h"
typedef struct alarm_t osi_alarm_t;
typedef uint64_t period_ms_t;
@@ -33,7 +34,7 @@ typedef enum {
OSI_ALARM_ERR_INVALID_STATE = -3,
} osi_alarm_err_t;
#define ALARM_CBS_NUM 50
#define ALARM_CBS_NUM UC_ALARM_MAX_NUM
#define ALARM_ID_BASE 1000
int osi_alarm_create_mux(void);

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

@@ -172,7 +172,7 @@ config BTDM_CTRL_PINNED_TO_CORE
choice BTDM_CTRL_HCI_MODE_CHOICE
prompt "HCI mode"
help
Speicify HCI mode as VHCI or UART(H4)
Specify HCI mode as VHCI or UART(H4)
config BTDM_CTRL_HCI_MODE_VHCI
bool "VHCI"
@@ -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)"
@@ -393,6 +398,14 @@ config BTDM_CTRL_FULL_SCAN_SUPPORTED
The full scan function is mainly used to provide BLE scan performance.
This is required for scenes with high scan performance requirements, such as BLE Mesh scenes.
config BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
bool "Disable active scan backoff"
default n
help
Disable active scan backoff. The bluetooth spec requires that scanners should run a backoff procedure to
minimize collision of scan request PDUs from nultiple scanners. If scan backoff is disabled, in active
scanning, scan request PDU will be sent every time when HW receives scannable ADV PDU.
config BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
bool "BLE adv report flow control supported"
depends on (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY)

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
*/
@@ -88,7 +88,7 @@ do{\
} while(0)
#define OSI_FUNCS_TIME_BLOCKING 0xffffffff
#define OSI_VERSION 0x00010004
#define OSI_VERSION 0x00010005
#define OSI_MAGIC_VALUE 0xFADEBEAD
/* Types definition
@@ -176,6 +176,7 @@ struct osi_funcs_t {
void (*_interrupt_l3_restore)(void);
void *(* _customer_queue_create)(uint32_t queue_len, uint32_t item_size);
int (* _coex_version_get)(unsigned int *major, unsigned int *minor, unsigned int *patch);
void (* _patch_apply)(void);
uint32_t _magic;
};
@@ -234,6 +235,8 @@ extern int coex_wifi_channel_get(uint8_t *primary, uint8_t *secondary);
extern int coex_register_wifi_channel_change_callback(void *cb);
/* Shutdown */
extern void esp_bt_controller_shutdown(void);
extern void sdk_config_set_bt_pll_track_enable(bool enable);
extern void sdk_config_set_uart_flow_ctrl_enable(bool enable);
extern char _bss_start_btdm;
extern char _bss_end_btdm;
@@ -244,16 +247,16 @@ extern uint32_t _data_end_btdm_rom;
extern uint32_t _bt_bss_start;
extern uint32_t _bt_bss_end;
extern uint32_t _nimble_bss_start;
extern uint32_t _nimble_bss_end;
extern uint32_t _btdm_bss_start;
extern uint32_t _btdm_bss_end;
extern uint32_t _bt_controller_bss_start;
extern uint32_t _bt_controller_bss_end;
extern uint32_t _bt_data_start;
extern uint32_t _bt_data_end;
extern uint32_t _nimble_data_start;
extern uint32_t _nimble_data_end;
extern uint32_t _btdm_data_start;
extern uint32_t _btdm_data_end;
extern uint32_t _bt_controller_data_start;
extern uint32_t _bt_controller_data_end;
extern void config_bt_funcs_reset(void);
extern void config_ble_funcs_reset(void);
extern void config_btdm_funcs_reset(void);
/* Local Function Declare
*********************************************************************
@@ -327,6 +330,7 @@ static void *customer_queue_create_hlevel_wrapper(uint32_t queue_len, uint32_t i
static void IRAM_ATTR interrupt_l3_disable(void);
static void IRAM_ATTR interrupt_l3_restore(void);
static void bt_controller_deinit_internal(void);
static void patch_apply(void);
/* Local variable definition
***************************************************************************
@@ -414,6 +418,7 @@ static const struct osi_funcs_t osi_funcs_ro = {
._customer_queue_create = NULL,
#endif /* CONFIG_BTDM_CTRL_HLI */
._coex_version_get = coex_version_get_wrapper,
._patch_apply = patch_apply,
._magic = OSI_MAGIC_VALUE,
};
@@ -795,7 +800,7 @@ static int32_t queue_send_hlevel_wrapper(void *queue, void *item, uint32_t block
* @param item The message which will be send
* @param hptw need do task yield or not
* @return send success or not
* There is an issue here: When the queue is full, it may reture true but it send fail to the queue, sometimes.
* There is an issue here: When the queue is full, it may return true but it send fail to the queue, sometimes.
* But in Bluetooth controller's isr, We don't care about the return value.
* It only required tp send success when the queue is empty all the time.
* So, this function meets the requirement.
@@ -1327,7 +1332,45 @@ static esp_err_t try_heap_caps_add_region(intptr_t start, intptr_t end)
return ret;
}
esp_err_t esp_bt_controller_mem_release(esp_bt_mode_t mode)
typedef struct {
intptr_t start;
intptr_t end;
const char* name;
} bt_area_t;
static esp_err_t esp_bt_mem_release_area(const bt_area_t *area)
{
esp_err_t ret = ESP_OK;
intptr_t mem_start = area->start;
intptr_t mem_end = area->end;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release %s [0x%08x] - [0x%08x], len %d", area->name, mem_start, mem_end, mem_end - mem_start);
ret = try_heap_caps_add_region(mem_start, mem_end);
}
return ret;
}
static esp_err_t esp_bt_mem_release_areas(const bt_area_t *area1, const bt_area_t *area2)
{
esp_err_t ret = ESP_OK;
if (area1->end == area2->start) {
bt_area_t merged_area = {
.start = area1->start,
.end = area2->end,
.name = area1->name
};
ret = esp_bt_mem_release_area(&merged_area);
} else {
esp_bt_mem_release_area(area1);
ret = esp_bt_mem_release_area(area2);
}
return ret;
}
static esp_err_t esp_bt_controller_rom_mem_release(esp_bt_mode_t mode)
{
bool update = true;
intptr_t mem_start=(intptr_t) NULL, mem_end=(intptr_t) NULL;
@@ -1378,61 +1421,86 @@ esp_err_t esp_bt_controller_mem_release(esp_bt_mode_t mode)
}
}
if (mode == ESP_BT_MODE_BTDM) {
mem_start = (intptr_t)&_btdm_bss_start;
mem_end = (intptr_t)&_btdm_bss_end;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release BTDM BSS [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_btdm_data_start;
mem_end = (intptr_t)&_btdm_data_end;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release BTDM Data [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
}
return ESP_OK;
}
esp_err_t esp_bt_controller_mem_release(esp_bt_mode_t mode)
{
esp_err_t ret = ESP_OK;
if (btdm_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
return ESP_ERR_INVALID_STATE;
}
if (mode == ESP_BT_MODE_BTDM) {
bt_area_t cont_bss = {
.start = (intptr_t)&_bt_controller_bss_start,
.end = (intptr_t)&_bt_controller_bss_end,
.name = "BT Controller BSS",
};
bt_area_t cont_data = {
.start = (intptr_t)&_bt_controller_data_start,
.end = (intptr_t)&_bt_controller_data_end,
.name = "BT Controller Data"
};
ret = esp_bt_mem_release_areas(&cont_data, &cont_bss);
}
if (ret == ESP_OK) {
ret = esp_bt_controller_rom_mem_release(mode);
}
return ret;
}
esp_err_t esp_bt_mem_release(esp_bt_mode_t mode)
{
int ret;
intptr_t mem_start, mem_end;
esp_err_t ret = ESP_OK;
ret = esp_bt_controller_mem_release(mode);
if (ret != ESP_OK) {
return ret;
if (btdm_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
return ESP_ERR_INVALID_STATE;
}
bt_area_t bss = {
.start = (intptr_t)&_bt_bss_start,
.end = (intptr_t)&_bt_bss_end,
.name = "BT BSS",
};
bt_area_t cont_bss = {
.start = (intptr_t)&_bt_controller_bss_start,
.end = (intptr_t)&_bt_controller_bss_end,
.name = "BT Controller BSS",
};
bt_area_t data = {
.start = (intptr_t)&_bt_data_start,
.end = (intptr_t)&_bt_data_end,
.name = "BT Data",
};
bt_area_t cont_data = {
.start = (intptr_t)&_bt_controller_data_start,
.end = (intptr_t)&_bt_controller_data_end,
.name = "BT Controller Data"
};
if (mode == ESP_BT_MODE_BTDM) {
mem_start = (intptr_t)&_bt_bss_start;
mem_end = (intptr_t)&_bt_bss_end;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release BT BSS [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_bt_data_start;
mem_end = (intptr_t)&_bt_data_end;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release BT Data [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
/* Start by freeing Bluetooth BSS section */
if (ret == ESP_OK) {
ret = esp_bt_mem_release_areas(&bss, &cont_bss);
}
mem_start = (intptr_t)&_nimble_bss_start;
mem_end = (intptr_t)&_nimble_bss_end;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release NimBLE BSS [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_nimble_data_start;
mem_end = (intptr_t)&_nimble_data_end;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release NimBLE Data [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
/* Do the same thing with the Bluetooth data section */
if (ret == ESP_OK) {
ret = esp_bt_mem_release_areas(&data, &cont_data);
}
}
return ESP_OK;
/* free data and BSS section for Bluetooth controller ROM code */
if (ret == ESP_OK) {
ret = esp_bt_controller_rom_mem_release(mode);
}
return ret;
}
#if CONFIG_BTDM_CTRL_HLI
@@ -1570,6 +1638,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) {
@@ -1690,6 +1764,18 @@ static void bt_shutdown(void)
return;
}
static void patch_apply(void)
{
config_btdm_funcs_reset();
#ifndef CONFIG_BTDM_CTRL_MODE_BLE_ONLY
config_bt_funcs_reset();
#endif
#ifndef CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY
config_ble_funcs_reset();
#endif
}
esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
{
@@ -1721,7 +1807,9 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
btdm_controller_enable_sleep(true);
}
// inititalize bluetooth baseband
sdk_config_set_bt_pll_track_enable(true);
// initialize bluetooth baseband
btdm_check_and_init_bb();
ret = btdm_controller_enable(mode);
@@ -1884,7 +1972,7 @@ esp_err_t esp_ble_scan_dupilcate_list_flush(void)
/**
* This function re-write controller's function,
* As coredump can not show paramerters in function which is in a .a file.
* As coredump can not show parameters in function which is in a .a file.
*
* After coredump fixing this issue, just delete this function.
*/

View File

@@ -23,7 +23,7 @@ config BT_CTRL_BLE_STATIC_ACL_TX_BUF_NB
default 0
help
BLE ACL buffer have two methods to be allocated. One is persistent allocating
(alloate when controller initialise, never free until controller de-initialise)
(allocate when controller initialise, never free until controller de-initialise)
another is dynamically allocating (allocate before TX and free after TX).
choice BT_CTRL_PINNED_TO_CORE_CHOICE
@@ -72,11 +72,11 @@ config BT_CTRL_HCI_TL
HCI mode as VHCI or UART(H4)
config BT_CTRL_ADV_DUP_FILT_MAX
int "The maxinum number of 5.0 extend duplicate scan filter"
int "The maximum number of 5.0 extend duplicate scan filter"
range 1 500
default 30
help
The maxinum number of suplicate scan filter
The maximum number of suplicate scan filter
choice BT_BLE_CCA_MODE
prompt "BLE CCA mode"
@@ -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,25 @@ 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.
config BT_CTRL_CHAN_ASS_EN
bool "Enable channel assessment"
default y
help
If this option is enabled, The Controller will records the communication quality
for each channel and then start a timer to check and update the channel map every 4 seconds.
config BT_CTRL_LE_PING_EN
bool "Enable LE Ping procedure"
default y
help
If this option is disabled, The Controller will not start the LE authenticated payload timer.
This option is used for some compatibility problems related to LE ping procedure.

File diff suppressed because it is too large Load Diff

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

@@ -15,7 +15,7 @@ The ESP-BLE-MESH networking enables many-to-many (m:m) device communications and
- [FAQ](https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/esp_ble_mesh/ble_mesh_faq.html)
- [API Reference](https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/bluetooth/ble_mesh.html)
### [ESP-BLE-MESH Examples](https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/esp_ble_mesh)
### [ESP-BLE-MESH Examples](../../../examples/bluetooth/esp_ble_mesh)
- Refer to **ESP-BLE-MESH Examples** of [Getting Started](https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/esp_ble_mesh/index.html##getting-started-with-ble-mesh) for the tutorials of ESP BLE Mesh examples.

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

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -569,9 +569,9 @@ esp_err_t esp_ble_mesh_provisioner_set_heartbeat_filter_info(uint8_t op, esp_ble
return ESP_ERR_INVALID_ARG;
}
if (!ESP_BLE_MESH_ADDR_IS_UNICAST(info->hb_src) &&
!ESP_BLE_MESH_ADDR_IS_UNICAST(info->hb_dst) &&
!ESP_BLE_MESH_ADDR_IS_GROUP(info->hb_dst)) {
if (!(ESP_BLE_MESH_ADDR_IS_UNICAST(info->hb_src) &&
(ESP_BLE_MESH_ADDR_IS_UNICAST(info->hb_dst) ||
ESP_BLE_MESH_ADDR_IS_GROUP(info->hb_dst)))) {
return ESP_ERR_INVALID_ARG;
}

View File

@@ -68,6 +68,14 @@ typedef uint8_t esp_ble_mesh_octet8_t[ESP_BLE_MESH_OCTET8_LEN];
#define ESP_BLE_MESH_KEY_PRIMARY 0x0000
#define ESP_BLE_MESH_KEY_ANY 0xFFFF
/*!< Internal macros used to initialize array members */
#define ESP_BLE_MESH_KEY_UNUSED_ELT_(IDX, _) ESP_BLE_MESH_KEY_UNUSED
#define ESP_BLE_MESH_ADDR_UNASSIGNED_ELT_(IDX, _) ESP_BLE_MESH_ADDR_UNASSIGNED
#define ESP_BLE_MESH_MODEL_KEYS_UNUSED \
{ LISTIFY(CONFIG_BLE_MESH_MODEL_KEY_COUNT, ESP_BLE_MESH_KEY_UNUSED_ELT_, (,)) }
#define ESP_BLE_MESH_MODEL_GROUPS_UNASSIGNED \
{ LISTIFY(CONFIG_BLE_MESH_MODEL_GROUP_COUNT, ESP_BLE_MESH_ADDR_UNASSIGNED_ELT_, (,)) }
/*!< Primary Network Key index */
#define ESP_BLE_MESH_NET_PRIMARY 0x000
@@ -264,26 +272,24 @@ typedef enum {
#define ESP_BLE_MESH_SIG_MODEL(_id, _op, _pub, _user_data) \
{ \
.model_id = (_id), \
.op = _op, \
.keys = { [0 ... (CONFIG_BLE_MESH_MODEL_KEY_COUNT - 1)] = \
ESP_BLE_MESH_KEY_UNUSED }, \
.pub = _pub, \
.groups = { [0 ... (CONFIG_BLE_MESH_MODEL_GROUP_COUNT - 1)] = \
ESP_BLE_MESH_ADDR_UNASSIGNED }, \
.keys = ESP_BLE_MESH_MODEL_KEYS_UNUSED, \
.groups = ESP_BLE_MESH_MODEL_GROUPS_UNASSIGNED, \
.op = _op, \
.user_data = _user_data, \
}
/*!< This macro is associated with BLE_MESH_MODEL_VND_CB in mesh_access.h */
#define ESP_BLE_MESH_VENDOR_MODEL(_company, _id, _op, _pub, _user_data) \
{ \
.vnd.company_id = (_company), \
.vnd.model_id = (_id), \
.op = _op, \
.vnd = { \
.company_id = (_company), \
.model_id = (_id), \
}, \
.pub = _pub, \
.keys = { [0 ... (CONFIG_BLE_MESH_MODEL_KEY_COUNT - 1)] = \
ESP_BLE_MESH_KEY_UNUSED }, \
.groups = { [0 ... (CONFIG_BLE_MESH_MODEL_GROUP_COUNT - 1)] = \
ESP_BLE_MESH_ADDR_UNASSIGNED }, \
.keys = ESP_BLE_MESH_MODEL_KEYS_UNUSED, \
.groups = ESP_BLE_MESH_MODEL_GROUPS_UNASSIGNED, \
.op = _op, \
.user_data = _user_data, \
}
@@ -302,8 +308,8 @@ typedef enum {
{ \
.location = (_loc), \
.sig_model_count = ARRAY_SIZE(_mods), \
.sig_models = (_mods), \
.vnd_model_count = ARRAY_SIZE(_vnd_mods), \
.sig_models = (_mods), \
.vnd_models = (_vnd_mods), \
}
@@ -416,8 +422,8 @@ typedef struct {
#define ESP_BLE_MESH_MODEL_PUB_DEFINE(_name, _msg_len, _role) \
NET_BUF_SIMPLE_DEFINE_STATIC(bt_mesh_pub_msg_##_name, _msg_len); \
static esp_ble_mesh_model_pub_t _name = { \
.update = (uint32_t)NULL, \
.msg = &bt_mesh_pub_msg_##_name, \
.update = (uint32_t)NULL, \
.dev_role = _role, \
}

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

@@ -840,22 +840,22 @@ struct net_buf_pool {
#if defined(CONFIG_BLE_MESH_NET_BUF_POOL_USAGE)
#define NET_BUF_POOL_INITIALIZER(_pool, _alloc, _bufs, _count, _destroy) \
{ \
.alloc = _alloc, \
.__bufs = (struct net_buf *)_bufs, \
.buf_count = _count, \
.uninit_count = _count, \
.avail_count = _count, \
.destroy = _destroy, \
.name = STRINGIFY(_pool), \
.destroy = _destroy, \
.alloc = _alloc, \
.__bufs = (struct net_buf *)_bufs, \
}
#else
#define NET_BUF_POOL_INITIALIZER(_pool, _alloc, _bufs, _count, _destroy) \
{ \
.alloc = _alloc, \
.__bufs = (struct net_buf *)_bufs, \
.buf_count = _count, \
.uninit_count = _count, \
.destroy = _destroy, \
.alloc = _alloc, \
.__bufs = (struct net_buf *)_bufs, \
}
#endif /* CONFIG_BLE_MESH_NET_BUF_POOL_USAGE */

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

@@ -17,6 +17,7 @@
#include <stddef.h>
#include "esp_bit_defs.h"
#include "mesh_types.h"
#include "mesh_utils_loops.h"
#ifdef __cplusplus
extern "C" {
@@ -180,6 +181,40 @@ extern "C" {
*/
#define Z_IS_ENABLED3(ignore_this, val, ...) val
/* Used to remove brackets from around a single argument. */
#define __DEBRACKET(...) __VA_ARGS__
#define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
#define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
/**
* @brief Generates a sequence of code with configurable separator.
*
* Example:
*
* #define FOO(i, _) MY_PWM ## i
* { LISTIFY(PWM_COUNT, FOO, (,)) }
*
* The above two lines expand to:
*
* { MY_PWM0 , MY_PWM1 }
*
* @param LEN The length of the sequence. Must be an integer literal less
* than 255.
* @param F A macro function that accepts at least two arguments:
* <tt>F(i, ...)</tt>. @p F is called repeatedly in the expansion.
* Its first argument @p i is the index in the sequence, and
* the variable list of arguments passed to LISTIFY are passed
* through to @p F.
*
* @param sep Separator (e.g. comma or semicolon). Must be in parentheses;
* this is required to enable providing a comma as separator.
*
* @note Calling LISTIFY with undefined arguments has undefined
* behavior.
*/
#define LISTIFY(LEN, F, sep, ...) UTIL_CAT(Z_UTIL_LISTIFY_, LEN)(F, sep, __VA_ARGS__)
const char *bt_hex(const void *buf, size_t len);
void mem_rcopy(uint8_t *dst, uint8_t const *src, uint16_t len);

File diff suppressed because it is too large Load Diff

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

@@ -67,7 +67,7 @@ static struct bt_mesh_conn_cb *bt_mesh_gatts_conn_cb;
static tBTA_GATTS_IF bt_mesh_gatts_if;
static BD_ADDR bt_mesh_gatts_addr;
static uint16_t svc_handle, char_handle;
static future_t *future_mesh;
static future_t *gatts_future_mesh;
/* Static Functions */
static struct bt_mesh_gatt_attr *bt_mesh_gatts_find_attr_by_handle(uint16_t handle);
@@ -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());
@@ -518,6 +539,9 @@ static void bt_mesh_bta_gatts_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
case BTA_GATTS_REG_EVT:
if (p_data->reg_oper.status == BTA_GATT_OK) {
bt_mesh_gatts_if = p_data->reg_oper.server_if;
future_ready(gatts_future_mesh, FUTURE_SUCCESS);
} else {
future_ready(gatts_future_mesh, FUTURE_FAIL);
}
break;
case BTA_GATTS_READ_EVT: {
@@ -575,27 +599,27 @@ static void bt_mesh_bta_gatts_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
break;
case BTA_GATTS_CREATE_EVT:
svc_handle = p_data->create.service_id;
BT_DBG("svc_handle %d, future_mesh %p", svc_handle, future_mesh);
if (future_mesh != NULL) {
future_ready(future_mesh, FUTURE_SUCCESS);
BT_DBG("svc_handle %d, gatts_future_mesh %p", svc_handle, gatts_future_mesh);
if (gatts_future_mesh != NULL) {
future_ready(gatts_future_mesh, FUTURE_SUCCESS);
}
break;
case BTA_GATTS_ADD_INCL_SRVC_EVT:
svc_handle = p_data->add_result.attr_id;
if (future_mesh != NULL) {
future_ready(future_mesh, FUTURE_SUCCESS);
if (gatts_future_mesh != NULL) {
future_ready(gatts_future_mesh, FUTURE_SUCCESS);
}
break;
case BTA_GATTS_ADD_CHAR_EVT:
char_handle = p_data->add_result.attr_id;
if (future_mesh != NULL) {
future_ready(future_mesh, FUTURE_SUCCESS);
if (gatts_future_mesh != NULL) {
future_ready(gatts_future_mesh, FUTURE_SUCCESS);
}
break;
case BTA_GATTS_ADD_CHAR_DESCR_EVT:
char_handle = p_data->add_result.attr_id;
if (future_mesh != NULL) {
future_ready(future_mesh, FUTURE_SUCCESS);
if (gatts_future_mesh != NULL) {
future_ready(gatts_future_mesh, FUTURE_SUCCESS);
}
break;
case BTA_GATTS_DELELTE_EVT:
@@ -921,11 +945,11 @@ int bt_mesh_gatts_service_register(struct bt_mesh_gatt_service *svc)
if (svc->attrs[i].uuid->type == BLE_MESH_UUID_TYPE_16) {
switch (BLE_MESH_UUID_16(svc->attrs[i].uuid)->val) {
case BLE_MESH_UUID_GATT_PRIMARY_VAL: {
future_mesh = future_new();
gatts_future_mesh = future_new();
bta_uuid_to_bt_mesh_uuid(&bta_uuid, (struct bt_mesh_uuid *)svc->attrs[i].user_data);
BTA_GATTS_CreateService(bt_mesh_gatts_if,
&bta_uuid, 0, svc->attr_count, true);
if (future_await(future_mesh) == FUTURE_FAIL) {
if (future_await(gatts_future_mesh) == FUTURE_FAIL) {
BT_ERR("Failed to add primary service");
return ESP_FAIL;
}
@@ -935,11 +959,11 @@ int bt_mesh_gatts_service_register(struct bt_mesh_gatt_service *svc)
break;
}
case BLE_MESH_UUID_GATT_SECONDARY_VAL: {
future_mesh = future_new();
gatts_future_mesh = future_new();
bta_uuid_to_bt_mesh_uuid(&bta_uuid, (struct bt_mesh_uuid *)svc->attrs[i].user_data);
BTA_GATTS_CreateService(bt_mesh_gatts_if,
&bta_uuid, 0, svc->attr_count, false);
if (future_await(future_mesh) == FUTURE_FAIL) {
if (future_await(gatts_future_mesh) == FUTURE_FAIL) {
BT_ERR("Failed to add secondary service");
return ESP_FAIL;
}
@@ -952,11 +976,11 @@ int bt_mesh_gatts_service_register(struct bt_mesh_gatt_service *svc)
break;
}
case BLE_MESH_UUID_GATT_CHRC_VAL: {
future_mesh = future_new();
gatts_future_mesh = future_new();
struct bt_mesh_gatt_char *gatts_chrc = (struct bt_mesh_gatt_char *)svc->attrs[i].user_data;
bta_uuid_to_bt_mesh_uuid(&bta_uuid, gatts_chrc->uuid);
BTA_GATTS_AddCharacteristic(svc_handle, &bta_uuid, bt_mesh_perm_to_bta_perm(svc->attrs[i + 1].perm), gatts_chrc->properties, NULL, NULL);
if (future_await(future_mesh) == FUTURE_FAIL) {
if (future_await(gatts_future_mesh) == FUTURE_FAIL) {
BT_ERR("Failed to add characteristic");
return ESP_FAIL;
}
@@ -978,10 +1002,10 @@ int bt_mesh_gatts_service_register(struct bt_mesh_gatt_service *svc)
case BLE_MESH_UUID_ES_CONFIGURATION_VAL:
case BLE_MESH_UUID_ES_MEASUREMENT_VAL:
case BLE_MESH_UUID_ES_TRIGGER_SETTING_VAL: {
future_mesh = future_new();
gatts_future_mesh = future_new();
bta_uuid_to_bt_mesh_uuid(&bta_uuid, svc->attrs[i].uuid);
BTA_GATTS_AddCharDescriptor(svc_handle, bt_mesh_perm_to_bta_perm(svc->attrs[i].perm), &bta_uuid, NULL, NULL);
if (future_await(future_mesh) == FUTURE_FAIL) {
if (future_await(gatts_future_mesh) == FUTURE_FAIL) {
BT_ERR("Failed to add descriptor");
return ESP_FAIL;
}
@@ -1724,7 +1748,19 @@ void bt_mesh_gatt_init(void)
CONFIG_BLE_MESH_GATT_PROXY_SERVER
tBT_UUID gatts_app_uuid = {LEN_UUID_128, {0}};
memset(&gatts_app_uuid.uu.uuid128, BLE_MESH_GATTS_APP_UUID_BYTE, LEN_UUID_128);
gatts_future_mesh = future_new();
if (!gatts_future_mesh) {
BT_ERR("Mesh gatts sync lock alloc failed");
return;
}
BTA_GATTS_AppRegister(&gatts_app_uuid, bt_mesh_bta_gatts_cb);
if (future_await(gatts_future_mesh) == FUTURE_FAIL) {
BT_ERR("Mesh gatts app register failed");
return;
}
#endif
#if (CONFIG_BLE_MESH_PROVISIONER && CONFIG_BLE_MESH_PB_GATT) || \

View File

@@ -50,8 +50,8 @@ extern "C" {
{ \
.loc = (_loc), \
.model_count = ARRAY_SIZE(_mods), \
.models = (_mods), \
.vnd_model_count = ARRAY_SIZE(_vnd_mods), \
.models = (_mods), \
.vnd_models = (_vnd_mods), \
}
@@ -255,14 +255,12 @@ struct bt_mesh_model_op {
#define BLE_MESH_MODEL_CB(_id, _op, _pub, _user_data, _cb) \
{ \
.id = (_id), \
.op = (_op), \
.keys = { [0 ... (CONFIG_BLE_MESH_MODEL_KEY_COUNT - 1)] = \
BLE_MESH_KEY_UNUSED }, \
.pub = (_pub), \
.groups = { [0 ... (CONFIG_BLE_MESH_MODEL_GROUP_COUNT - 1)] = \
BLE_MESH_ADDR_UNASSIGNED }, \
.user_data = (_user_data), \
.keys = ESP_BLE_MESH_MODEL_KEYS_UNUSED, \
.groups = ESP_BLE_MESH_MODEL_GROUPS_UNASSIGNED, \
.op = (_op), \
.cb = (_cb), \
.user_data = (_user_data), \
}
/** @def BLE_MESH_MODEL_VND_CB
@@ -280,14 +278,12 @@ struct bt_mesh_model_op {
{ \
.vnd.company = (_company), \
.vnd.id = (_id), \
.op = (_op), \
.pub = (_pub), \
.keys = { [0 ... (CONFIG_BLE_MESH_MODEL_KEY_COUNT - 1)] = \
BLE_MESH_KEY_UNUSED }, \
.groups = { [0 ... (CONFIG_BLE_MESH_MODEL_GROUP_COUNT - 1)] = \
BLE_MESH_ADDR_UNASSIGNED }, \
.user_data = (_user_data), \
.keys = ESP_BLE_MESH_MODEL_KEYS_UNUSED, \
.groups = ESP_BLE_MESH_MODEL_GROUPS_UNASSIGNED, \
.op = (_op), \
.cb = (_cb), \
.user_data = (_user_data), \
}
/** @def BLE_MESH_TRANSMIT
@@ -419,8 +415,8 @@ struct bt_mesh_model_pub {
#define BLE_MESH_MODEL_PUB_DEFINE(_name, _update, _msg_len) \
NET_BUF_SIMPLE_DEFINE_STATIC(bt_mesh_pub_msg_##_name, _msg_len); \
static struct bt_mesh_model_pub _name = { \
.update = _update, \
.msg = &bt_mesh_pub_msg_##_name, \
.update = _update, \
}
/** Model callback functions. */

View File

@@ -573,9 +573,9 @@ struct bt_mesh_gatt_attr {
#define BLE_MESH_GATT_PRIMARY_SERVICE(_service) \
{ \
.uuid = BLE_MESH_UUID_GATT_PRIMARY, \
.perm = BLE_MESH_GATT_PERM_READ, \
.read = bt_mesh_gatts_attr_read_service, \
.user_data = _service, \
.perm = BLE_MESH_GATT_PERM_READ, \
}
/** @def BLE_MESH_GATT_SECONDARY_SERVICE
@@ -588,9 +588,9 @@ struct bt_mesh_gatt_attr {
#define BLE_MESH_GATT_SECONDARY_SERVICE(_service) \
{ \
.uuid = BLE_MESH_UUID_GATT_SECONDARY, \
.perm = BLE_MESH_GATT_PERM_READ, \
.read = bt_mesh_gatts_attr_read_service, \
.user_data = _service, \
.perm = BLE_MESH_GATT_PERM_READ, \
}
/** @def BLE_MESH_GATT_INCLUDE_SERVICE
@@ -603,9 +603,9 @@ struct bt_mesh_gatt_attr {
#define BLE_MESH_GATT_INCLUDE_SERVICE(_service_incl) \
{ \
.uuid = BLE_MESH_UUID_GATT_INCLUDE, \
.perm = BLE_MESH_GATT_PERM_READ, \
.read = bt_mesh_gatts_attr_read_included, \
.user_data = _service_incl, \
.perm = BLE_MESH_GATT_PERM_READ, \
}
/** @def BLE_MESH_GATT_CHARACTERISTIC
@@ -619,10 +619,10 @@ struct bt_mesh_gatt_attr {
#define BLE_MESH_GATT_CHARACTERISTIC(_uuid, _props) \
{ \
.uuid = BLE_MESH_UUID_GATT_CHRC, \
.perm = BLE_MESH_GATT_PERM_READ, \
.read = bt_mesh_gatts_attr_read_chrc, \
.user_data = (&(struct bt_mesh_gatt_char) { .uuid = _uuid, \
.properties = _props, }), \
.perm = BLE_MESH_GATT_PERM_READ, \
}
/** @def BLE_MESH_GATT_DESCRIPTOR
@@ -639,10 +639,10 @@ struct bt_mesh_gatt_attr {
#define BLE_MESH_GATT_DESCRIPTOR(_uuid, _perm, _read, _write, _value) \
{ \
.uuid = _uuid, \
.perm = _perm, \
.read = _read, \
.write = _write, \
.user_data = _value, \
.perm = _perm, \
}
/** @def BLE_MESH_GATT_SERVICE
@@ -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;
}
@@ -1432,9 +1432,7 @@ static bool ignore_net_msg(uint16_t src, uint16_t dst)
}
if (IS_ENABLED(CONFIG_BLE_MESH_PROVISIONER) &&
bt_mesh_is_provisioner_en() &&
BLE_MESH_ADDR_IS_UNICAST(dst) &&
bt_mesh_elem_find(dst)) {
bt_mesh_is_provisioner_en()) {
/* If the destination address of the message is the element
* address of Provisioner, but Provisioner fails to find the
* node in its provisioning database, then this message will
@@ -1509,7 +1507,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,
@@ -597,7 +599,7 @@ static int provisioner_start_prov_pb_adv(const uint8_t uuid[16], const bt_mesh_a
if (is_unprov_dev_being_provision(uuid)) {
bt_mesh_pb_adv_unlock();
return -EALREADY;
return 0;
}
for (i = 0; i < CONFIG_BLE_MESH_PBA_SAME_TIME; i++) {
@@ -658,7 +660,7 @@ static int provisioner_start_prov_pb_gatt(const uint8_t uuid[16], const bt_mesh_
if (is_unprov_dev_being_provision(uuid)) {
bt_mesh_pb_gatt_unlock();
return -EALREADY;
return 0;
}
for (i = CONFIG_BLE_MESH_PBA_SAME_TIME; i < BLE_MESH_PROV_SAME_TIME; i++) {
@@ -1700,7 +1702,7 @@ static void prov_capabilities(const uint8_t idx, const uint8_t *data)
algorithms = sys_get_be16(&data[1]);
BT_INFO("Algorithms: 0x%04x", algorithms);
if (algorithms != BIT(PROV_ALG_P256)) {
if (!(algorithms & BIT(PROV_ALG_P256))) {
BT_ERR("Invalid algorithms 0x%04x", algorithms);
goto fail;
}
@@ -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
@@ -246,7 +259,7 @@ config BT_GATTC_CACHE_NVS_FLASH
config BT_GATTC_CONNECT_RETRY_COUNT
int "The number of attempts to reconnect if the connection establishment failed"
depends on BT_GATTC_ENABLE
range 0 7
range 0 255
default 3
help
The number of attempts to reconnect if the connection establishment failed
@@ -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

@@ -19,6 +19,10 @@
#include "esp_bt.h"
#include "osi/future.h"
#include "osi/allocator.h"
#include "bt_common.h"
#if (BT_HCI_LOG_INCLUDED == TRUE)
#include "hci_log/bt_hci_log.h"
#endif
static bool bd_already_enable = false;
static bool bd_already_init = false;
@@ -165,6 +169,10 @@ esp_err_t esp_bluedroid_init(void)
bd_already_init = true;
#if (BT_HCI_LOG_INCLUDED == TRUE)
bt_hci_log_init();
#endif // (BT_HCI_LOG_INCLUDED == TRUE)
return ESP_OK;
}
@@ -207,6 +215,10 @@ esp_err_t esp_bluedroid_deinit(void)
btc_deinit();
#if (BT_HCI_LOG_INCLUDED == TRUE)
bt_hci_log_deinit();
#endif // (BT_HCI_LOG_INCLUDED == TRUE)
bd_already_init = false;
return ESP_OK;

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
*/
@@ -13,7 +13,7 @@
#include "btc/btc_manage.h"
#include "btc_gap_ble.h"
#include "btc/btc_ble_storage.h"
#include "esp_random.h"
esp_err_t esp_ble_gap_register_callback(esp_gap_ble_cb_t callback)
{
@@ -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)
@@ -170,6 +188,25 @@ esp_err_t esp_ble_gap_set_pkt_data_len(esp_bd_addr_t remote_device, uint16_t tx_
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gap_addr_create_static(esp_bd_addr_t rand_addr)
{
// Static device address: First two bits are '11', rest is random
rand_addr[0] = 0xC0 | (esp_random() & 0x3F);
for (int i = 1; i < 6; i++) {
rand_addr[i] = esp_random() & 0xFF; // Randomize remaining bits
}
return ESP_OK;
}
esp_err_t esp_ble_gap_addr_create_nrpa(esp_bd_addr_t rand_addr)
{
// Non-resolvable private address: First two bits are '00', rest is random
rand_addr[0] = (esp_random() & 0x3F);
for (int i = 1; i < 6; i++) {
rand_addr[i] = esp_random() & 0xFF; // Randomize remaining bits
}
return ESP_OK;
}
esp_err_t esp_ble_gap_set_rand_addr(esp_bd_addr_t rand_addr)
{
@@ -186,6 +223,48 @@ esp_err_t esp_ble_gap_set_rand_addr(esp_bd_addr_t rand_addr)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gap_set_resolvable_private_address_timeout(uint16_t rpa_timeout)
{
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
if (rpa_timeout < 0x0001 || rpa_timeout > 0x0E10) {
return ESP_ERR_INVALID_ARG;
}
btc_msg_t msg = {0};
btc_ble_gap_args_t arg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_ACT_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT;
arg.set_rpa_timeout.rpa_timeout = rpa_timeout;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gap_add_device_to_resolving_list(esp_bd_addr_t peer_addr, uint8_t addr_type, uint8_t *peer_irk)
{
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
if (addr_type > BLE_ADDR_TYPE_RANDOM ||!peer_addr || (addr_type && ((peer_addr[0] & 0xC0) != 0xC0))) {
return ESP_ERR_INVALID_ARG;
}
btc_msg_t msg = {0};
btc_ble_gap_args_t arg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_ACT_ADD_DEVICE_TO_RESOLVING_LIST;
memcpy(arg.add_dev_to_resolving_list.addr, peer_addr, ESP_BD_ADDR_LEN);
arg.add_dev_to_resolving_list.addr_type = addr_type;
memcpy(arg.add_dev_to_resolving_list.irk, peer_irk, ESP_PEER_IRK_LEN);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gap_clear_rand_addr(void)
{
btc_msg_t msg;
@@ -281,6 +360,7 @@ esp_err_t esp_ble_gap_config_local_icon (uint16_t icon)
case ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV:
case ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD:
case ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV:
case ESP_BLE_APPEARANCE_STANDALONE_SPEAKER:
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_ACT_CONFIG_LOCAL_ICON;
@@ -470,8 +550,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 +656,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;
@@ -818,6 +901,122 @@ esp_err_t esp_gap_ble_set_authorization(esp_bd_addr_t bd_addr, bool authorize)
return ESP_FAIL;
}
#if (BLE_42_FEATURE_SUPPORT == TRUE)
esp_err_t esp_ble_dtm_tx_start(const esp_ble_dtm_tx_t *tx_params)
{
btc_msg_t msg = {0};
btc_ble_gap_args_t arg;
if (!tx_params) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_DTM_TX_START;
memcpy(&arg.dtm_tx_start, tx_params, sizeof(esp_ble_dtm_tx_t));
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_dtm_rx_start(const esp_ble_dtm_rx_t *rx_params)
{
btc_msg_t msg = {0};
btc_ble_gap_args_t arg;
if (!rx_params) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_DTM_RX_START;
memcpy(&arg.dtm_rx_start, rx_params, sizeof(esp_ble_dtm_rx_t));
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
#if (BLE_50_FEATURE_SUPPORT == TRUE)
esp_err_t esp_ble_dtm_enh_tx_start(const esp_ble_dtm_enh_tx_t *tx_params)
{
btc_msg_t msg = {0};
btc_ble_5_gap_args_t arg;
if (!tx_params) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_DTM_ENH_TX_START;
memcpy(&arg.dtm_enh_tx_start, tx_params, sizeof(esp_ble_dtm_enh_tx_t));
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_dtm_enh_rx_start(const esp_ble_dtm_enh_rx_t *rx_params)
{
btc_msg_t msg = {0};
btc_ble_5_gap_args_t arg;
if (!rx_params) {
return ESP_ERR_INVALID_ARG;
}
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_DTM_ENH_RX_START;
memcpy(&arg.dtm_enh_rx_start, rx_params, sizeof(esp_ble_dtm_enh_rx_t));
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
esp_err_t esp_ble_dtm_stop(void)
{
btc_msg_t msg = {0};
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_DTM_STOP;
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gap_set_privacy_mode(esp_ble_addr_type_t addr_type, esp_bd_addr_t addr, esp_ble_privacy_mode_t mode)
{
btc_msg_t msg;
btc_ble_gap_args_t arg;
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_SET_PRIVACY_MODE;
arg.set_privacy_mode.addr_type = addr_type;
memcpy(arg.set_privacy_mode.addr, addr, sizeof(esp_bd_addr_t));
arg.set_privacy_mode.privacy_mode = mode;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#if (BLE_50_FEATURE_SUPPORT == TRUE)
esp_err_t esp_ble_gap_read_phy(esp_bd_addr_t bd_addr)
@@ -1481,3 +1680,31 @@ esp_err_t esp_ble_gap_set_periodic_adv_sync_trans_params(esp_bd_addr_t addr, con
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif //#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
esp_err_t esp_ble_gap_vendor_command_send(esp_ble_vendor_cmd_params_t *vendor_cmd_param)
{
btc_msg_t msg = {0};
btc_ble_gap_args_t arg;
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
return ESP_ERR_INVALID_STATE;
}
if (!vendor_cmd_param || !vendor_cmd_param->p_param_buf || !vendor_cmd_param->param_len) {
return ESP_ERR_INVALID_ARG;
}
// If command is not a VSC, return error
if ((vendor_cmd_param->opcode & VENDOR_HCI_CMD_MASK) != VENDOR_HCI_CMD_MASK) {
return ESP_ERR_INVALID_ARG;
}
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_ACT_VENDOR_HCI_CMD_EVT;
arg.vendor_cmd_send.opcode = vendor_cmd_param->opcode;
arg.vendor_cmd_send.param_len = vendor_cmd_param->param_len;
arg.vendor_cmd_send.p_param_buf = vendor_cmd_param->p_param_buf;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), btc_gap_ble_arg_deep_copy, btc_gap_ble_arg_deep_free)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}

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
*/
#include <string.h>
@@ -97,8 +89,11 @@ esp_err_t esp_spp_connect(esp_spp_sec_t sec_mask,
btc_spp_args_t arg;
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
if (sec_mask != ESP_SPP_SEC_NONE && sec_mask != ESP_SPP_SEC_AUTHORIZE && sec_mask != ESP_SPP_SEC_AUTHENTICATE) {
LOG_WARN("Suggest to use ESP_SPP_SEC_NONE, ESP_SPP_SEC_AUTHORIZE or ESP_SPP_SEC_AUTHENTICATE only\n");
if (sec_mask != ESP_SPP_SEC_NONE &&
sec_mask != ESP_SPP_SEC_AUTHENTICATE &&
sec_mask != (ESP_SPP_SEC_AUTHENTICATE | ESP_SPP_SEC_ENCRYPT)) {
LOG_WARN("Suggest to use ESP_SPP_SEC_NONE, ESP_SPP_SEC_AUTHENTICATE"
"or (ESP_SPP_SEC_AUTHENTICATE | ESP_SPP_SEC_ENCRYPT) only\n");
}
msg.sig = BTC_SIG_API_CALL;
@@ -140,8 +135,16 @@ esp_err_t esp_spp_start_srv(esp_spp_sec_t sec_mask,
return ESP_ERR_INVALID_ARG;
}
if (sec_mask != ESP_SPP_SEC_NONE && sec_mask != ESP_SPP_SEC_AUTHORIZE && sec_mask != ESP_SPP_SEC_AUTHENTICATE) {
LOG_WARN("Suggest to use ESP_SPP_SEC_NONE, ESP_SPP_SEC_AUTHORIZE or ESP_SPP_SEC_AUTHENTICATE only\n");
if (sec_mask != ESP_SPP_SEC_NONE &&
sec_mask != ESP_SPP_SEC_AUTHENTICATE &&
sec_mask != (ESP_SPP_SEC_AUTHENTICATE | ESP_SPP_SEC_ENCRYPT) &&
sec_mask != ESP_SPP_SEC_IN_16_DIGITS &&
sec_mask != (ESP_SPP_SEC_IN_16_DIGITS | ESP_SPP_SEC_AUTHENTICATE) &&
sec_mask != (ESP_SPP_SEC_IN_16_DIGITS | ESP_SPP_SEC_AUTHENTICATE | ESP_SPP_SEC_ENCRYPT)) {
LOG_WARN("Suggest to use ESP_SPP_SEC_NONE, ESP_SPP_SEC_AUTHENTICATE,"
"(ESP_SPP_SEC_AUTHENTICATE | ESP_SPP_SEC_ENCRYPT),"
"ESP_SPP_SEC_IN_16_DIGITS, (ESP_SPP_SEC_IN_16_DIGITS | ESP_SPP_SEC_AUTHENTICATE), or"
"(ESP_SPP_SEC_IN_16_DIGITS | ESP_SPP_SEC_AUTHENTICATE | ESP_SPP_SEC_ENCRYPT) only\n");
}
msg.sig = BTC_SIG_API_CALL;

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,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-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __ESP_BT_DEFS_H__
#define __ESP_BT_DEFS_H__
@@ -27,7 +19,7 @@ extern "C" {
return ESP_ERR_INVALID_STATE; \
}
#define ESP_BT_STATUS_BASE_FOR_HCI_ERR 0X0100 /* base for coverting HCI error code to ESP status */
#define ESP_BT_STATUS_BASE_FOR_HCI_ERR 0X0100 /* base for converting HCI error code to ESP status */
/* relate to BT_STATUS_xxx in bt_def.h */
/// Status Return Value
@@ -171,6 +163,9 @@ typedef enum {
/// Bluetooth address length
#define ESP_BD_ADDR_LEN 6
/// Bluetooth peer irk
#define ESP_PEER_IRK_LEN 16
/// Bluetooth device address
typedef uint8_t esp_bd_addr_t[ESP_BD_ADDR_LEN];

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
*/
@@ -104,6 +104,7 @@ typedef uint8_t esp_ble_auth_req_t; /*!< combination of the above bit
#define ESP_BLE_APPEARANCE_CYCLING_CADENCE 0x0483 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_CADENCE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_CYCLING_POWER 0x0484 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_POWER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_SPEED_CADENCE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_STANDALONE_SPEAKER 0x0841 /*!< relate to BTM_BLE_APPEARANCE_STANDALONE_SPEAKER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41 /*!< relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42 /*!< relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_WRIST in stack/btm_ble_api.h */
@@ -125,6 +126,18 @@ typedef uint8_t esp_ble_auth_req_t; /*!< combination of the above bit
typedef uint8_t esp_ble_io_cap_t; /*!< combination of the io capability */
#define BLE_DTM_PKT_PAYLOAD_0x00 0x00 /*!< PRBS9 sequence 11111111100000111101... (in transmission order) as described in [Vol 6] Part F, Section 4.1.5 */
#define BLE_DTM_PKT_PAYLOAD_0x01 0x01 /*!< Repeated 11110000 (in transmission order) sequence as described in [Vol 6] Part F, Section 4.1.5 */
#define BLE_DTM_PKT_PAYLOAD_0x02 0x02 /*!< Repeated 10101010 (in transmission order) sequence as described in [Vol 6] Part F, Section 4.1.5 */
#define BLE_DTM_PKT_PAYLOAD_0x03 0x03 /*!< PRBS15 sequence as described in [Vol 6] Part F, Section 4.1.5 */
#define BLE_DTM_PKT_PAYLOAD_0x04 0x04 /*!< Repeated 11111111 (in transmission order) sequence */
#define BLE_DTM_PKT_PAYLOAD_0x05 0x05 /*!< Repeated 00000000 (in transmission order) sequence */
#define BLE_DTM_PKT_PAYLOAD_0x06 0x06 /*!< Repeated 00001111 (in transmission order) sequence */
#define BLE_DTM_PKT_PAYLOAD_0x07 0x07 /*!< Repeated 01010101 (in transmission order) sequence */
#define BLE_DTM_PKT_PAYLOAD_MAX 0x08 /*!< 0x08 ~ 0xFF, Reserved for future use */
typedef uint8_t esp_ble_dtm_pkt_payload_t;
/// GAP BLE callback event type
typedef enum {
//BLE_42_FEATURE_SUPPORT
@@ -144,7 +157,7 @@ typedef enum {
ESP_GAP_BLE_PASSKEY_REQ_EVT, /*!< passkey request event */
ESP_GAP_BLE_OOB_REQ_EVT, /*!< OOB request event */
ESP_GAP_BLE_LOCAL_IR_EVT, /*!< BLE local IR (identity Root 128-bit random static value used to generate Long Term Key) event */
ESP_GAP_BLE_LOCAL_ER_EVT, /*!< BLE local ER (Encryption Root vakue used to genrate identity resolving key) event */
ESP_GAP_BLE_LOCAL_ER_EVT, /*!< BLE local ER (Encryption Root value used to generate identity resolving key) event */
ESP_GAP_BLE_NC_REQ_EVT, /*!< Numeric Comparison request event */
//BLE_42_FEATURE_SUPPORT
ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT, /*!< When stop adv complete, the event comes */
@@ -208,6 +221,14 @@ 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 */
// DTM
ESP_GAP_BLE_DTM_TEST_UPDATE_EVT, /*!< when direct test mode state changes, the event comes */
// BLE_INCLUDED
ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT, /*!< When clear advertising complete, the event comes */
ESP_GAP_BLE_SET_RPA_TIMEOUT_COMPLETE_EVT, /*!< When set the Resolvable Private Address (RPA) timeout completes, the event comes */
ESP_GAP_BLE_ADD_DEV_TO_RESOLVING_LIST_COMPLETE_EVT, /*!< when add a device to the resolving list completes, the event comes*/
ESP_GAP_BLE_VENDOR_CMD_COMPLETE_EVT, /*!< When vendor hci command complete, the event comes */
ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT, /*!< When set privacy mode complete, the event comes */
ESP_GAP_BLE_EVT_MAX, /*!< when maximum advertising event complete, the event comes */
} esp_gap_ble_cb_event_t;
@@ -222,6 +243,8 @@ typedef uint8_t esp_gap_ble_channels[ESP_GAP_BLE_CHANNELS_LEN];
/// Scan response data maximum length
#define ESP_BLE_SCAN_RSP_DATA_LEN_MAX 31
#define VENDOR_HCI_CMD_MASK (0x3F << 10) /**!< 0xFC00 */
/* relate to BTM_BLE_AD_TYPE_xxx in stack/btm_ble_api.h */
/// The type of advertising data(not adv_type)
typedef enum {
@@ -339,7 +362,42 @@ typedef enum {
ESP_BLE_SM_MAX_PARAM,
} esp_ble_sm_param_t;
typedef enum {
/// DTM TX start event
DTM_TX_START_EVT = 0x00,
///DTM RX start event
DTM_RX_START_EVT,
///DTM test end event
DTM_TEST_STOP_EVT,
} esp_ble_dtm_update_evt_t;
/**
* @brief Vendor HCI command parameters
*/
typedef struct {
uint16_t opcode; /*!< vendor hci command opcode */
uint8_t param_len; /*!< the length of parameter */
uint8_t *p_param_buf; /*!< the point of parameter buffer */
} esp_ble_vendor_cmd_params_t;
#if (BLE_42_FEATURE_SUPPORT == TRUE)
/**
* @brief DTM TX parameters
*/
typedef struct
{
uint8_t tx_channel; /*!< channel for sending test data, tx_channel = (Frequency -2402)/2, tx_channel range:0x00-0x27, Frequency range: 2402 MHz to 2480 MHz */
uint8_t len_of_data; /*!< length in bytes of payload data in each packet */
esp_ble_dtm_pkt_payload_t pkt_payload; /*!< packet payload type. value range: 0x00-0x07 */
} esp_ble_dtm_tx_t;
/**
* @brief DTM RX parameters
*/
typedef struct
{
uint8_t rx_channel; /*!< channel for test data reception, rx_channel = (Frequency -2402)/2, tx_channel range:0x00-0x27, Frequency range: 2402 MHz to 2480 MHz */
} esp_ble_dtm_rx_t;
/// Advertising parameters
typedef struct {
uint16_t adv_int_min; /*!< Minimum advertising interval for
@@ -417,7 +475,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 +736,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 +745,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;
@@ -738,9 +803,9 @@ typedef uint8_t esp_ble_gap_all_phys_t;
#define ESP_BLE_GAP_PRI_PHY_CODED ESP_BLE_GAP_PHY_CODED /*!< Primary Phy is LE CODED */
typedef uint8_t esp_ble_gap_pri_phy_t; // primary phy
#define ESP_BLE_GAP_PHY_1M_PREF_MASK (1 << 0) /*!< The Host prefers use the LE1M transmitter or reciever PHY */
#define ESP_BLE_GAP_PHY_2M_PREF_MASK (1 << 1) /*!< The Host prefers use the LE2M transmitter or reciever PHY */
#define ESP_BLE_GAP_PHY_CODED_PREF_MASK (1 << 2) /*!< The Host prefers use the LE CODED transmitter or reciever PHY */
#define ESP_BLE_GAP_PHY_1M_PREF_MASK (1 << 0) /*!< The Host prefers use the LE1M transmitter or receiver PHY */
#define ESP_BLE_GAP_PHY_2M_PREF_MASK (1 << 1) /*!< The Host prefers use the LE2M transmitter or receiver PHY */
#define ESP_BLE_GAP_PHY_CODED_PREF_MASK (1 << 2) /*!< The Host prefers use the LE CODED transmitter or receiver PHY */
typedef uint8_t esp_ble_gap_phy_mask_t;
#define ESP_BLE_GAP_PHY_OPTIONS_NO_PREF 0 /*!< The Host has no preferred coding when transmitting on the LE Coded PHY */
@@ -887,7 +952,7 @@ typedef struct {
esp_ble_gap_ext_adv_data_status_t data_status; /*!< data type */
uint8_t adv_data_len; /*!< extend advertising data length */
uint8_t adv_data[251]; /*!< extend advertising data */
} esp_ble_gap_ext_adv_reprot_t;
} esp_ble_gap_ext_adv_report_t;
/**
* @brief periodic adv report parameters
@@ -915,6 +980,27 @@ typedef struct {
uint8_t adv_clk_accuracy; /*!< periodic advertising clock accuracy */
} esp_ble_gap_periodic_adv_sync_estab_t;
/**
* @brief DTM TX parameters
*/
typedef struct
{
uint8_t tx_channel; /*!< channel for sending test data, tx_channel = (Frequency -2402)/2, tx_channel range:0x00-0x27, Frequency range: 2402 MHz to 2480 MHz */
uint8_t len_of_data; /*!< length in bytes of payload data in each packet */
esp_ble_dtm_pkt_payload_t pkt_payload; /*!< packet payload type. value range: 0x00-0x07 */
esp_ble_gap_phy_t phy; /*!< the phy type used by the transmitter, coded phy with S=2:0x04 */
} esp_ble_dtm_enh_tx_t;
/**
* @brief DTM RX parameters
*/
typedef struct
{
uint8_t rx_channel; /*!< channel for test data reception, rx_channel = (Frequency -2402)/2, tx_channel range:0x00-0x27, Frequency range: 2402 MHz to 2480 MHz */
esp_ble_gap_phy_t phy; /*!< the phy type used by the receiver, 1M phy: 0x01, 2M phy:0x02, coded phy:0x03 */
uint8_t modulation_idx; /*!< modulation index, 0x00:standard modulation index, 0x01:stable modulation index */
} esp_ble_dtm_enh_rx_t;
#endif //#if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
@@ -936,6 +1022,11 @@ typedef struct {
} esp_ble_gap_past_params_t;
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
typedef enum{
ESP_BLE_NETWORK_PRIVACY_MODE = 0X00, /*!< Network Privacy Mode for peer device (default) */
ESP_BLE_DEVICE_PRIVACY_MODE = 0X01, /*!< Device Privacy Mode for peer device */
} esp_ble_privacy_mode_t;
/**
* @brief Gap callback parameters union
*/
@@ -1022,6 +1113,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
@@ -1055,6 +1152,19 @@ typedef union {
struct ble_local_privacy_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate the set local privacy operation success status */
} local_privacy_cmpl; /*!< Event parameter of ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_SET_RPA_TIMEOUT_COMPLETE_EVT
*/
struct ble_rpa_timeout_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate the set RPA timeout operation success status */
} set_rpa_timeout_cmpl; /*!< Event parameter of ESP_GAP_BLE_SET_RPA_TIMEOUT_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_ADD_DEV_TO_RESOLVING_LIST_COMPLETE_EVT
*/
struct ble_add_dev_to_resolving_list_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicates the success status of adding a device to the resolving list */
} add_dev_to_resolving_list_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADD_DEV_TO_RESOLVING_LIST_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT
*/
@@ -1325,7 +1435,7 @@ typedef union {
* @brief ESP_GAP_BLE_EXT_ADV_REPORT_EVT
*/
struct ble_ext_adv_report_param {
esp_ble_gap_ext_adv_reprot_t params; /*!< extend advertising report parameters */
esp_ble_gap_ext_adv_report_t params; /*!< extend advertising report parameters */
} ext_adv_report; /*!< Event parameter of ESP_GAP_BLE_EXT_ADV_REPORT_EVT */
/**
* @brief ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT
@@ -1378,6 +1488,28 @@ typedef union {
uint8_t adv_clk_accuracy; /*!< Periodic advertising clock accuracy */
} past_received; /*!< Event parameter of ESP_GAP_BLE_PERIODIC_ADV_SYNC_TRANS_RECV_EVT */
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
/**
* @brief ESP_GAP_BLE_DTM_TEST_UPDATE_EVT
*/
struct ble_dtm_state_update_evt_param {
esp_bt_status_t status; /*!< Indicate DTM operation success status */
esp_ble_dtm_update_evt_t update_evt; /*!< DTM state change event, 0x00: DTM TX start, 0x01: DTM RX start, 0x02:DTM end */
uint16_t num_of_pkt; /*!< number of packets received, only valid if update_evt is DTM_TEST_STOP_EVT and shall be reported as 0 for a transmitter */
} dtm_state_update; /*!< Event parameter of ESP_GAP_BLE_DTM_TEST_UPDATE_EVT */
/**
* @brief ESP_GAP_BLE_VENDOR_CMD_COMPLETE_EVT
*/
struct vendor_cmd_cmpl_evt_param {
uint16_t opcode; /*!< vendor hci command opcode */
uint16_t param_len; /*!< The length of parameter buffer */
uint8_t *p_param_buf; /*!< The point of parameter buffer */
} vendor_cmd_cmpl; /*!< Event parameter of ESP_GAP_BLE_VENDOR_CMD_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT
*/
struct ble_set_privacy_mode_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate privacy mode set operation success status */
} set_privacy_mode_cmpl; /*!< Event parameter of ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT */
} esp_ble_gap_cb_param_t;
/**
@@ -1399,6 +1531,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.
@@ -1506,13 +1647,13 @@ esp_err_t esp_ble_gap_set_pkt_data_len(esp_bd_addr_t remote_device, uint16_t tx_
*
* @param[in] rand_addr: The address to be configured. Refer to the table below for possible address subtypes:
*
* | address [47:46] | Address Type |
* |-----------------|--------------------------|
* | 0b00 | Non-Resolvable Private |
* | | Address |
* |-----------------|--------------------------|
* | 0b11 | Static Random Address |
* |-----------------|--------------------------|
* | address [47:46] | Address Type | Corresponding API |
* |-----------------|-----------------------------|----------------------------------------|
* | 0b00 | Non-Resolvable Private | esp_ble_gap_addr_create_nrpa |
* | | Address (NRPA) | |
* |-----------------|-----------------------------|----------------------------------------|
* | 0b11 | Static Random Address | esp_ble_gap_addr_create_static |
* |-----------------|-----------------------------|----------------------------------------|
*
* @return
* - ESP_OK : success
@@ -1521,6 +1662,60 @@ esp_err_t esp_ble_gap_set_pkt_data_len(esp_bd_addr_t remote_device, uint16_t tx_
*/
esp_err_t esp_ble_gap_set_rand_addr(esp_bd_addr_t rand_addr);
/**
* @brief Create a static device address
* @param[out] rand_addr: Pointer to the buffer where the static device address will be stored.
* @return - ESP_OK : Success
* - Other : Failed
*/
esp_err_t esp_ble_gap_addr_create_static(esp_bd_addr_t rand_addr);
/**
* @brief Create a non-resolvable private address (NRPA)
* @param[out] rand_addr: Pointer to the buffer where the NRPA will be stored.
* @return - ESP_OK : Success
* - Other : Failed
*/
esp_err_t esp_ble_gap_addr_create_nrpa(esp_bd_addr_t rand_addr);
/**
* @brief This function sets the length of time the Controller uses a Resolvable Private Address
* before generating and starting to use a new resolvable private address.
*
* @note Note: This function is currently not supported on the ESP32 but will be enabled in a future update.
*
* @param[in] rpa_timeout: The timeout duration in seconds for how long a Resolvable Private Address
* is used before a new one is generated. The value must be within the range specified by
* the Bluetooth specification (0x0001 to 0x0E10), which corresponds to a time range of
* 1 second to 1 hour. The default value is 0x0384 (900 seconds or 15 minutes).
* @return
* - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_gap_set_resolvable_private_address_timeout(uint16_t rpa_timeout);
/**
* @brief This function adds a device to the resolving list used to generate and resolve Resolvable Private Addresses
* in the Controller.
*
* @note Note: This function shall not be used when address resolution is enabled in the Controller and:
* - Advertising (other than periodic advertising) is enabled,
* - Scanning is enabled, or
* - an HCI_LE_Create_Connection, HCI_LE_Extended_Create_Connection, or HCI_LE_Periodic_Advertising_Create_Sync command is pending.
* This command may be used at any time when address resolution is disabled in the Controller.
* The added device shall be set to Network Privacy mode.
*
* @param[in] peer_addr: The peer identity address of the device to be added to the resolving list.
* @param[in] addr_type: The address type of the peer identity address (BLE_ADDR_TYPE_PUBLIC or BLE_ADDR_TYPE_RANDOM).
* @param[in] peer_irk: The Identity Resolving Key (IRK) of the device.
* @return
* - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_gap_add_device_to_resolving_list(esp_bd_addr_t peer_addr, uint8_t addr_type, uint8_t *peer_irk);
/**
* @brief This function clears the random address for the application
*
@@ -1531,8 +1726,6 @@ esp_err_t esp_ble_gap_set_rand_addr(esp_bd_addr_t rand_addr);
*/
esp_err_t esp_ble_gap_clear_rand_addr(void);
/**
* @brief Enable/disable privacy (including address resolution) on the local device
*
@@ -1847,7 +2040,6 @@ esp_err_t esp_ble_remove_bond_device(esp_bd_addr_t bd_addr);
*/
int esp_ble_get_bond_device_num(void);
/**
* @brief Get the device from the security database list of peer device.
* It will return the device bonded information immediately.
@@ -2198,8 +2390,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 +2556,108 @@ 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)
#if (BLE_42_FEATURE_SUPPORT == TRUE)
/**
* @brief This function is used to start a test where the DUT generates reference packets
* at a fixed interval.
*
* @param[in] tx_params : DTM Transmitter parameters
*
* @return - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_dtm_tx_start(const esp_ble_dtm_tx_t *tx_params);
/**
* @brief This function is used to start a test where the DUT receives test reference packets
* at a fixed interval.
*
* @param[in] rx_params : DTM Receiver parameters
*
* @return - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_dtm_rx_start(const esp_ble_dtm_rx_t *rx_params);
#endif //#if (BLE_42_FEATURE_SUPPORT == TRUE)
#if (BLE_50_FEATURE_SUPPORT == TRUE)
/**
* @brief This function is used to start a test where the DUT generates reference packets
* at a fixed interval.
*
* @param[in] tx_params : DTM Transmitter parameters
*
* @return - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_dtm_enh_tx_start(const esp_ble_dtm_enh_tx_t *tx_params);
/**
* @brief This function is used to start a test where the DUT receives test reference packets
* at a fixed interval.
*
* @param[in] rx_params : DTM Receiver parameters
*
* @return - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_dtm_enh_rx_start(const esp_ble_dtm_enh_rx_t *rx_params);
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
/**
* @brief This function is used to stop any test which is in progress
*
*
* @return - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_dtm_stop(void);
/**
* @brief This function is used to clear legacy advertising
*
*
* @return - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_gap_clear_advertising(void);
/**
* @brief This function is called to send vendor hci command.
*
*
*
* @param[in] vendor_cmd_param: vendor hci command parameters
*
* @return
* - ESP_OK : success
* - other : failed
*/
esp_err_t esp_ble_gap_vendor_command_send(esp_ble_vendor_cmd_params_t *vendor_cmd_param);
/**
* @brief This function set the privacy mode of the device in resolving list.
*
* @note This feature is not supported on ESP32.
*
* @param[in] addr_type: The address type of the peer identity address (BLE_ADDR_TYPE_PUBLIC or BLE_ADDR_TYPE_RANDOM).
* @param[in] addr: The peer identity address of the device.
* @param[in] mode: The privacy mode of the device.
*
* @return
* - ESP_OK : success
* - other : failed
*/
esp_err_t esp_ble_gap_set_privacy_mode(esp_ble_addr_type_t addr_type, esp_bd_addr_t addr, esp_ble_privacy_mode_t mode);
#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

@@ -1,345 +1,552 @@
// 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.
#ifndef __ESP_GATT_DEFS_H__
#define __ESP_GATT_DEFS_H__
/*
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "esp_bt_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
/// GATT INVALID UUID
/** @brief GATT INVALID UUID. */
#define ESP_GATT_ILLEGAL_UUID 0
/// GATT INVALID HANDLE
/** @brief GATT INVALID HANDLE. */
#define ESP_GATT_ILLEGAL_HANDLE 0
/// GATT attribute max handle
/** @brief GATT attribute max handle. */
#define ESP_GATT_ATTR_HANDLE_MAX UC_CONFIG_BT_GATT_MAX_SR_ATTRIBUTES
#define ESP_GATT_MAX_READ_MULTI_HANDLES 10 /* Max attributes to read in one request */
/** @brief Maximum number of attributes to read in one request. */
#define ESP_GATT_MAX_READ_MULTI_HANDLES 10
/**@{
* All "ESP_GATT_UUID_xxx" is attribute types
/**
* @defgroup GATT_UUIDs GATT Service UUIDs
* @brief Definitions of GATT Service UUIDs.
*
* This module contains the definitions of standard GATT service UUIDs. These UUIDs
* identify the type of GATT service.
* @{
*/
#define ESP_GATT_UUID_IMMEDIATE_ALERT_SVC 0x1802 /* Immediate alert Service*/
#define ESP_GATT_UUID_LINK_LOSS_SVC 0x1803 /* Link Loss Service*/
#define ESP_GATT_UUID_TX_POWER_SVC 0x1804 /* TX Power Service*/
#define ESP_GATT_UUID_CURRENT_TIME_SVC 0x1805 /* Current Time Service Service*/
#define ESP_GATT_UUID_REF_TIME_UPDATE_SVC 0x1806 /* Reference Time Update Service*/
#define ESP_GATT_UUID_NEXT_DST_CHANGE_SVC 0x1807 /* Next DST Change Service*/
#define ESP_GATT_UUID_GLUCOSE_SVC 0x1808 /* Glucose Service*/
#define ESP_GATT_UUID_HEALTH_THERMOM_SVC 0x1809 /* Health Thermometer Service*/
#define ESP_GATT_UUID_DEVICE_INFO_SVC 0x180A /* Device Information Service*/
#define ESP_GATT_UUID_HEART_RATE_SVC 0x180D /* Heart Rate Service*/
#define ESP_GATT_UUID_PHONE_ALERT_STATUS_SVC 0x180E /* Phone Alert Status Service*/
#define ESP_GATT_UUID_BATTERY_SERVICE_SVC 0x180F /* Battery Service*/
#define ESP_GATT_UUID_BLOOD_PRESSURE_SVC 0x1810 /* Blood Pressure Service*/
#define ESP_GATT_UUID_ALERT_NTF_SVC 0x1811 /* Alert Notification Service*/
#define ESP_GATT_UUID_HID_SVC 0x1812 /* HID Service*/
#define ESP_GATT_UUID_SCAN_PARAMETERS_SVC 0x1813 /* Scan Parameters Service*/
#define ESP_GATT_UUID_RUNNING_SPEED_CADENCE_SVC 0x1814 /* Running Speed and Cadence Service*/
#define ESP_GATT_UUID_Automation_IO_SVC 0x1815 /* Automation IO Service*/
#define ESP_GATT_UUID_CYCLING_SPEED_CADENCE_SVC 0x1816 /* Cycling Speed and Cadence Service*/
#define ESP_GATT_UUID_CYCLING_POWER_SVC 0x1818 /* Cycling Power Service*/
#define ESP_GATT_UUID_LOCATION_AND_NAVIGATION_SVC 0x1819 /* Location and Navigation Service*/
#define ESP_GATT_UUID_ENVIRONMENTAL_SENSING_SVC 0x181A /* Environmental Sensing Service*/
#define ESP_GATT_UUID_BODY_COMPOSITION 0x181B /* Body Composition Service*/
#define ESP_GATT_UUID_USER_DATA_SVC 0x181C /* User Data Service*/
#define ESP_GATT_UUID_WEIGHT_SCALE_SVC 0x181D /* Weight Scale Service*/
#define ESP_GATT_UUID_BOND_MANAGEMENT_SVC 0x181E /* Bond Management Service*/
#define ESP_GATT_UUID_CONT_GLUCOSE_MONITOR_SVC 0x181F /* Continuous Glucose Monitoring Service*/
/** @brief Immediate Alert Service UUID. */
#define ESP_GATT_UUID_IMMEDIATE_ALERT_SVC 0x1802
/** @brief Link Loss Service UUID. */
#define ESP_GATT_UUID_LINK_LOSS_SVC 0x1803
/** @brief TX Power Service UUID. */
#define ESP_GATT_UUID_TX_POWER_SVC 0x1804
/** @brief Current Time Service UUID. */
#define ESP_GATT_UUID_CURRENT_TIME_SVC 0x1805
/** @brief Reference Time Update Service UUID. */
#define ESP_GATT_UUID_REF_TIME_UPDATE_SVC 0x1806
/** @brief Next DST Change Service UUID. */
#define ESP_GATT_UUID_NEXT_DST_CHANGE_SVC 0x1807
/** @brief Glucose Service UUID. */
#define ESP_GATT_UUID_GLUCOSE_SVC 0x1808
/** @brief Health Thermometer Service UUID. */
#define ESP_GATT_UUID_HEALTH_THERMOM_SVC 0x1809
/** @brief Device Information Service UUID. */
#define ESP_GATT_UUID_DEVICE_INFO_SVC 0x180A
/** @brief Heart Rate Service UUID. */
#define ESP_GATT_UUID_HEART_RATE_SVC 0x180D
/** @brief Phone Alert Status Service UUID. */
#define ESP_GATT_UUID_PHONE_ALERT_STATUS_SVC 0x180E
/** @brief Battery Service UUID. */
#define ESP_GATT_UUID_BATTERY_SERVICE_SVC 0x180F
/** @brief Blood Pressure Service UUID. */
#define ESP_GATT_UUID_BLOOD_PRESSURE_SVC 0x1810
/** @brief Alert Notification Service UUID. */
#define ESP_GATT_UUID_ALERT_NTF_SVC 0x1811
/** @brief HID Service UUID. */
#define ESP_GATT_UUID_HID_SVC 0x1812
/** @brief Scan Parameters Service UUID. */
#define ESP_GATT_UUID_SCAN_PARAMETERS_SVC 0x1813
/** @brief Running Speed and Cadence Service UUID. */
#define ESP_GATT_UUID_RUNNING_SPEED_CADENCE_SVC 0x1814
/** @brief Automation IO Service UUID. */
#define ESP_GATT_UUID_Automation_IO_SVC 0x1815
/** @brief Cycling Speed and Cadence Service UUID. */
#define ESP_GATT_UUID_CYCLING_SPEED_CADENCE_SVC 0x1816
/** @brief Cycling Power Service UUID. */
#define ESP_GATT_UUID_CYCLING_POWER_SVC 0x1818
/** @brief Location and Navigation Service UUID. */
#define ESP_GATT_UUID_LOCATION_AND_NAVIGATION_SVC 0x1819
/** @brief Environmental Sensing Service UUID. */
#define ESP_GATT_UUID_ENVIRONMENTAL_SENSING_SVC 0x181A
/** @brief Body Composition Service UUID. */
#define ESP_GATT_UUID_BODY_COMPOSITION 0x181B
/** @brief User Data Service UUID. */
#define ESP_GATT_UUID_USER_DATA_SVC 0x181C
/** @brief Weight Scale Service UUID. */
#define ESP_GATT_UUID_WEIGHT_SCALE_SVC 0x181D
/** @brief Bond Management Service UUID. */
#define ESP_GATT_UUID_BOND_MANAGEMENT_SVC 0x181E
/** @brief Continuous Glucose Monitoring Service UUID. */
#define ESP_GATT_UUID_CONT_GLUCOSE_MONITOR_SVC 0x181F
/** @brief Primary Service UUID. */
#define ESP_GATT_UUID_PRI_SERVICE 0x2800
/** @brief Secondary Service UUID. */
#define ESP_GATT_UUID_SEC_SERVICE 0x2801
/** @brief Include Service UUID. */
#define ESP_GATT_UUID_INCLUDE_SERVICE 0x2802
#define ESP_GATT_UUID_CHAR_DECLARE 0x2803 /* Characteristic Declaration*/
#define ESP_GATT_UUID_CHAR_EXT_PROP 0x2900 /* Characteristic Extended Properties */
#define ESP_GATT_UUID_CHAR_DESCRIPTION 0x2901 /* Characteristic User Description*/
#define ESP_GATT_UUID_CHAR_CLIENT_CONFIG 0x2902 /* Client Characteristic Configuration */
#define ESP_GATT_UUID_CHAR_SRVR_CONFIG 0x2903 /* Server Characteristic Configuration */
#define ESP_GATT_UUID_CHAR_PRESENT_FORMAT 0x2904 /* Characteristic Presentation Format*/
#define ESP_GATT_UUID_CHAR_AGG_FORMAT 0x2905 /* Characteristic Aggregate Format*/
#define ESP_GATT_UUID_CHAR_VALID_RANGE 0x2906 /* Characteristic Valid Range */
#define ESP_GATT_UUID_EXT_RPT_REF_DESCR 0x2907 /* External Report Reference */
#define ESP_GATT_UUID_RPT_REF_DESCR 0x2908 /* Report Reference */
#define ESP_GATT_UUID_NUM_DIGITALS_DESCR 0x2909 /* Number of Digitals */
#define ESP_GATT_UUID_VALUE_TRIGGER_DESCR 0x290A /* Value Trigger Setting */
#define ESP_GATT_UUID_ENV_SENSING_CONFIG_DESCR 0x290B /* Environmental Sensing Configuration */
#define ESP_GATT_UUID_ENV_SENSING_MEASUREMENT_DESCR 0x290C /* Environmental Sensing Measurement */
#define ESP_GATT_UUID_ENV_SENSING_TRIGGER_DESCR 0x290D /* Environmental Sensing Trigger Setting */
#define ESP_GATT_UUID_TIME_TRIGGER_DESCR 0x290E /* Time Trigger Setting */
/** @brief Characteristic Declaration UUID. */
#define ESP_GATT_UUID_CHAR_DECLARE 0x2803
/** @brief Characteristic Extended Properties UUID. */
#define ESP_GATT_UUID_CHAR_EXT_PROP 0x2900
/** @brief Characteristic User Description UUID. */
#define ESP_GATT_UUID_CHAR_DESCRIPTION 0x2901
/** @brief Client Characteristic Configuration UUID. */
#define ESP_GATT_UUID_CHAR_CLIENT_CONFIG 0x2902
/** @brief Server Characteristic Configuration UUID. */
#define ESP_GATT_UUID_CHAR_SRVR_CONFIG 0x2903
/** @brief Characteristic Presentation Format UUID. */
#define ESP_GATT_UUID_CHAR_PRESENT_FORMAT 0x2904
/** @brief Characteristic Aggregate Format UUID. */
#define ESP_GATT_UUID_CHAR_AGG_FORMAT 0x2905
/** @brief Characteristic Valid Range UUID. */
#define ESP_GATT_UUID_CHAR_VALID_RANGE 0x2906
/** @brief External Report Reference Descriptor UUID. */
#define ESP_GATT_UUID_EXT_RPT_REF_DESCR 0x2907
/** @brief Report Reference Descriptor UUID. */
#define ESP_GATT_UUID_RPT_REF_DESCR 0x2908
/** @brief Number of Digitals Descriptor UUID. */
#define ESP_GATT_UUID_NUM_DIGITALS_DESCR 0x2909
/** @brief Value Trigger Setting Descriptor UUID. */
#define ESP_GATT_UUID_VALUE_TRIGGER_DESCR 0x290A
/** @brief Environmental Sensing Configuration Descriptor UUID. */
#define ESP_GATT_UUID_ENV_SENSING_CONFIG_DESCR 0x290B
/** @brief Environmental Sensing Measurement Descriptor UUID. */
#define ESP_GATT_UUID_ENV_SENSING_MEASUREMENT_DESCR 0x290C
/** @brief Environmental Sensing Trigger Setting Descriptor UUID. */
#define ESP_GATT_UUID_ENV_SENSING_TRIGGER_DESCR 0x290D
/** @brief Time Trigger Setting Descriptor UUID. */
#define ESP_GATT_UUID_TIME_TRIGGER_DESCR 0x290E
/* GAP Profile Attributes */
/** @brief GAP Device Name UUID. */
#define ESP_GATT_UUID_GAP_DEVICE_NAME 0x2A00
/** @brief GAP Icon UUID. */
#define ESP_GATT_UUID_GAP_ICON 0x2A01
/** @brief GAP Preferred Connection Parameters UUID. */
#define ESP_GATT_UUID_GAP_PREF_CONN_PARAM 0x2A04
/** @brief GAP Central Address Resolution UUID. */
#define ESP_GATT_UUID_GAP_CENTRAL_ADDR_RESOL 0x2AA6
/* Attribute Profile Attribute UUID */
/** @brief GATT Service Changed UUID. */
#define ESP_GATT_UUID_GATT_SRV_CHGD 0x2A05
/* Link ESP_Loss Service */
#define ESP_GATT_UUID_ALERT_LEVEL 0x2A06 /* Alert Level */
#define ESP_GATT_UUID_TX_POWER_LEVEL 0x2A07 /* TX power level */
/* Link Loss Service */
/** @brief Alert Level UUID. */
#define ESP_GATT_UUID_ALERT_LEVEL 0x2A06
/** @brief TX Power Level UUID. */
#define ESP_GATT_UUID_TX_POWER_LEVEL 0x2A07
/* Current Time Service */
#define ESP_GATT_UUID_CURRENT_TIME 0x2A2B /* Current Time */
#define ESP_GATT_UUID_LOCAL_TIME_INFO 0x2A0F /* Local time info */
#define ESP_GATT_UUID_REF_TIME_INFO 0x2A14 /* reference time information */
/** @brief Current Time UUID. */
#define ESP_GATT_UUID_CURRENT_TIME 0x2A2B
/** @brief Local Time Info UUID. */
#define ESP_GATT_UUID_LOCAL_TIME_INFO 0x2A0F
/** @brief Reference Time Information UUID. */
#define ESP_GATT_UUID_REF_TIME_INFO 0x2A14
/* Network availability Profile */
#define ESP_GATT_UUID_NW_STATUS 0x2A18 /* network availability status */
#define ESP_GATT_UUID_NW_TRIGGER 0x2A1A /* Network availability trigger */
/* Network Availability Service */
/** @brief Network Availability Status UUID. */
#define ESP_GATT_UUID_NW_STATUS 0x2A18
/** @brief Network Availability Trigger UUID. */
#define ESP_GATT_UUID_NW_TRIGGER 0x2A1A
/* Phone alert */
#define ESP_GATT_UUID_ALERT_STATUS 0x2A3F /* alert status */
#define ESP_GATT_UUID_RINGER_CP 0x2A40 /* ringer control point */
#define ESP_GATT_UUID_RINGER_SETTING 0x2A41 /* ringer setting */
/* Phone Alert Status Service */
/** @brief Alert Status UUID. */
#define ESP_GATT_UUID_ALERT_STATUS 0x2A3F
/** @brief Ringer Control Point UUID. */
#define ESP_GATT_UUID_RINGER_CP 0x2A40
/** @brief Ringer Setting UUID. */
#define ESP_GATT_UUID_RINGER_SETTING 0x2A41
/* Glucose Service */
/** @brief Glucose Measurement Characteristic UUID. */
#define ESP_GATT_UUID_GM_MEASUREMENT 0x2A18
/** @brief Glucose Measurement Context Characteristic UUID. */
#define ESP_GATT_UUID_GM_CONTEXT 0x2A34
/** @brief Glucose Control Point Characteristic UUID. */
#define ESP_GATT_UUID_GM_CONTROL_POINT 0x2A52
/** @brief Glucose Feature Characteristic UUID. */
#define ESP_GATT_UUID_GM_FEATURE 0x2A51
/* device information characteristic */
/* Device Information Service Characteristics */
/** @brief System ID Characteristic UUID. */
#define ESP_GATT_UUID_SYSTEM_ID 0x2A23
/** @brief Model Number String Characteristic UUID. */
#define ESP_GATT_UUID_MODEL_NUMBER_STR 0x2A24
/** @brief Serial Number String Characteristic UUID. */
#define ESP_GATT_UUID_SERIAL_NUMBER_STR 0x2A25
/** @brief Firmware Revision String Characteristic UUID. */
#define ESP_GATT_UUID_FW_VERSION_STR 0x2A26
/** @brief Hardware Revision String Characteristic UUID. */
#define ESP_GATT_UUID_HW_VERSION_STR 0x2A27
/** @brief Software Revision String Characteristic UUID. */
#define ESP_GATT_UUID_SW_VERSION_STR 0x2A28
/** @brief Manufacturer Name String Characteristic UUID. */
#define ESP_GATT_UUID_MANU_NAME 0x2A29
/** @brief IEEE 11073-20601 Regulatory Certification Data List Characteristic UUID. */
#define ESP_GATT_UUID_IEEE_DATA 0x2A2A
/** @brief PnP ID Characteristic UUID. */
#define ESP_GATT_UUID_PNP_ID 0x2A50
/* HID characteristics */
/* HID Service Characteristics */
/** @brief HID Information Characteristic UUID. */
#define ESP_GATT_UUID_HID_INFORMATION 0x2A4A
/** @brief HID Report Map Characteristic UUID. */
#define ESP_GATT_UUID_HID_REPORT_MAP 0x2A4B
/** @brief HID Control Point Characteristic UUID. */
#define ESP_GATT_UUID_HID_CONTROL_POINT 0x2A4C
/** @brief HID Report Characteristic UUID. */
#define ESP_GATT_UUID_HID_REPORT 0x2A4D
/** @brief HID Protocol Mode Characteristic UUID. */
#define ESP_GATT_UUID_HID_PROTO_MODE 0x2A4E
/** @brief HID Bluetooth Keyboard Input Characteristic UUID. */
#define ESP_GATT_UUID_HID_BT_KB_INPUT 0x2A22
/** @brief HID Bluetooth Keyboard Output Characteristic UUID. */
#define ESP_GATT_UUID_HID_BT_KB_OUTPUT 0x2A32
/** @brief HID Bluetooth Mouse Input Characteristic UUID. */
#define ESP_GATT_UUID_HID_BT_MOUSE_INPUT 0x2A33
/// Heart Rate Measurement
#define ESP_GATT_HEART_RATE_MEAS 0x2A37
/// Body Sensor Location
#define ESP_GATT_BODY_SENSOR_LOCATION 0x2A38
/// Heart Rate Control Point
#define ESP_GATT_HEART_RATE_CNTL_POINT 0x2A39
/* Heart Rate Service Characteristics */
/** @brief Heart Rate Measurement Characteristic UUID. */
#define ESP_GATT_HEART_RATE_MEAS 0x2A37
/** @brief Body Sensor Location Characteristic UUID. */
#define ESP_GATT_BODY_SENSOR_LOCATION 0x2A38
/** @brief Heart Rate Control Point Characteristic UUID. */
#define ESP_GATT_HEART_RATE_CNTL_POINT 0x2A39
/* Battery Service characteristics */
/* Battery Service Characteristics */
/** @brief Battery Level Characteristic UUID. */
#define ESP_GATT_UUID_BATTERY_LEVEL 0x2A19
/* Sensor Service */
/* Sensor Service Characteristics */
/** @brief Sensor Control Point Characteristic UUID. */
#define ESP_GATT_UUID_SC_CONTROL_POINT 0x2A55
/** @brief Sensor Location Characteristic UUID. */
#define ESP_GATT_UUID_SENSOR_LOCATION 0x2A5D
/* Runners speed and cadence service */
/* Running Speed and Cadence Service Characteristics */
/** @brief RSC Measurement Characteristic UUID. */
#define ESP_GATT_UUID_RSC_MEASUREMENT 0x2A53
/** @brief RSC Feature Characteristic UUID. */
#define ESP_GATT_UUID_RSC_FEATURE 0x2A54
/* Cycling speed and cadence service */
/* Cycling Speed and Cadence Service Characteristics */
/** @brief CSC Measurement Characteristic UUID. */
#define ESP_GATT_UUID_CSC_MEASUREMENT 0x2A5B
/** @brief CSC Feature Characteristic UUID. */
#define ESP_GATT_UUID_CSC_FEATURE 0x2A5C
/* Scan ESP_Parameter characteristics */
/* Scan Parameters Service Characteristics */
/** @brief Scan Interval Window Characteristic UUID. */
#define ESP_GATT_UUID_SCAN_INT_WINDOW 0x2A4F
/** @brief Scan Refresh UUID. */
#define ESP_GATT_UUID_SCAN_REFRESH 0x2A31
/**
* @}
*/
/* Additional GATT Services not covered yet */
/** @} */ // End of group GATT_UUIDs
/* relate to BTA_GATT_PREP_WRITE_xxx in bta/bta_gatt_api.h */
/// Attribute write data type from the client
/**
* @brief Defines the attribute write operation types from the client.
*
* These values are used to specify the type of write operation in a prepare write sequence.
* relate to BTA_GATT_PREP_WRITE_xxx in bta/bta_gatt_api.h.
*/
typedef enum {
ESP_GATT_PREP_WRITE_CANCEL = 0x00, /*!< Prepare write cancel */ /* relate to BTA_GATT_PREP_WRITE_CANCEL in bta/bta_gatt_api.h */
ESP_GATT_PREP_WRITE_EXEC = 0x01, /*!< Prepare write execute */ /* relate to BTA_GATT_PREP_WRITE_EXEC in bta/bta_gatt_api.h */
ESP_GATT_PREP_WRITE_CANCEL = 0x00, /*!< Prepare write cancel. Corresponds to BTA_GATT_PREP_WRITE_CANCEL. */
ESP_GATT_PREP_WRITE_EXEC = 0x01, /*!< Prepare write execute. Corresponds to BTA_GATT_PREP_WRITE_EXEC. */
} esp_gatt_prep_write_type;
/* relate to BTA_GATT_xxx in bta/bta_gatt_api.h */
/**
* @brief GATT success code and error codes
* @brief GATT operation status codes.
*
* These status codes are used to indicate the result of various GATT operations.
* relate to BTA_GATT_xxx in bta/bta_gatt_api.h .
*/
typedef enum {
ESP_GATT_OK = 0x0, /* relate to BTA_GATT_OK in bta/bta_gatt_api.h */
ESP_GATT_INVALID_HANDLE = 0x01, /* 0x0001 */ /* relate to BTA_GATT_INVALID_HANDLE in bta/bta_gatt_api.h */
ESP_GATT_READ_NOT_PERMIT = 0x02, /* 0x0002 */ /* relate to BTA_GATT_READ_NOT_PERMIT in bta/bta_gatt_api.h */
ESP_GATT_WRITE_NOT_PERMIT = 0x03, /* 0x0003 */ /* relate to BTA_GATT_WRITE_NOT_PERMIT in bta/bta_gatt_api.h */
ESP_GATT_INVALID_PDU = 0x04, /* 0x0004 */ /* relate to BTA_GATT_INVALID_PDU in bta/bta_gatt_api.h */
ESP_GATT_INSUF_AUTHENTICATION = 0x05, /* 0x0005 */ /* relate to BTA_GATT_INSUF_AUTHENTICATION in bta/bta_gatt_api.h */
ESP_GATT_REQ_NOT_SUPPORTED = 0x06, /* 0x0006 */ /* relate to BTA_GATT_REQ_NOT_SUPPORTED in bta/bta_gatt_api.h */
ESP_GATT_INVALID_OFFSET = 0x07, /* 0x0007 */ /* relate to BTA_GATT_INVALID_OFFSET in bta/bta_gatt_api.h */
ESP_GATT_INSUF_AUTHORIZATION = 0x08, /* 0x0008 */ /* relate to BTA_GATT_INSUF_AUTHORIZATION in bta/bta_gatt_api.h */
ESP_GATT_PREPARE_Q_FULL = 0x09, /* 0x0009 */ /* relate to BTA_GATT_PREPARE_Q_FULL in bta/bta_gatt_api.h */
ESP_GATT_NOT_FOUND = 0x0a, /* 0x000a */ /* relate to BTA_GATT_NOT_FOUND in bta/bta_gatt_api.h */
ESP_GATT_NOT_LONG = 0x0b, /* 0x000b */ /* relate to BTA_GATT_NOT_LONG in bta/bta_gatt_api.h */
ESP_GATT_INSUF_KEY_SIZE = 0x0c, /* 0x000c */ /* relate to BTA_GATT_INSUF_KEY_SIZE in bta/bta_gatt_api.h */
ESP_GATT_INVALID_ATTR_LEN = 0x0d, /* 0x000d */ /* relate to BTA_GATT_INVALID_ATTR_LEN in bta/bta_gatt_api.h */
ESP_GATT_ERR_UNLIKELY = 0x0e, /* 0x000e */ /* relate to BTA_GATT_ERR_UNLIKELY in bta/bta_gatt_api.h */
ESP_GATT_INSUF_ENCRYPTION = 0x0f, /* 0x000f */ /* relate to BTA_GATT_INSUF_ENCRYPTION in bta/bta_gatt_api.h */
ESP_GATT_UNSUPPORT_GRP_TYPE = 0x10, /* 0x0010 */ /* relate to BTA_GATT_UNSUPPORT_GRP_TYPE in bta/bta_gatt_api.h */
ESP_GATT_INSUF_RESOURCE = 0x11, /* 0x0011 */ /* relate to BTA_GATT_INSUF_RESOURCE in bta/bta_gatt_api.h */
ESP_GATT_OK = 0x0, /*!< 0x0, Operation successful. Corresponds to BTA_GATT_OK. */
ESP_GATT_INVALID_HANDLE = 0x01, /*!< 0x01, Invalid handle. Corresponds to BTA_GATT_INVALID_HANDLE. */
ESP_GATT_READ_NOT_PERMIT = 0x02, /*!< 0x02, Read operation not permitted. Corresponds to BTA_GATT_READ_NOT_PERMIT. */
ESP_GATT_WRITE_NOT_PERMIT = 0x03, /*!< 0x03, Write operation not permitted. Corresponds to BTA_GATT_WRITE_NOT_PERMIT. */
ESP_GATT_INVALID_PDU = 0x04, /*!< 0x04, Invalid PDU. Corresponds to BTA_GATT_INVALID_PDU. */
ESP_GATT_INSUF_AUTHENTICATION = 0x05, /*!< 0x05, Insufficient authentication. Corresponds to BTA_GATT_INSUF_AUTHENTICATION. */
ESP_GATT_REQ_NOT_SUPPORTED = 0x06, /*!< 0x06, Request not supported. Corresponds to BTA_GATT_REQ_NOT_SUPPORTED. */
ESP_GATT_INVALID_OFFSET = 0x07, /*!< 0x07, Invalid offset. Corresponds to BTA_GATT_INVALID_OFFSET. */
ESP_GATT_INSUF_AUTHORIZATION = 0x08, /*!< 0x08, Insufficient authorization. Corresponds to BTA_GATT_INSUF_AUTHORIZATION. */
ESP_GATT_PREPARE_Q_FULL = 0x09, /*!< 0x09, Prepare queue full. Corresponds to BTA_GATT_PREPARE_Q_FULL. */
ESP_GATT_NOT_FOUND = 0x0a, /*!< 0x0a, Not found. Corresponds to BTA_GATT_NOT_FOUND. */
ESP_GATT_NOT_LONG = 0x0b, /*!< 0x0b, Not long. Corresponds to BTA_GATT_NOT_LONG. */
ESP_GATT_INSUF_KEY_SIZE = 0x0c, /*!< 0x0c, Insufficient key size. Corresponds to BTA_GATT_INSUF_KEY_SIZE. */
ESP_GATT_INVALID_ATTR_LEN = 0x0d, /*!< 0x0d, Invalid attribute length. Corresponds to BTA_GATT_INVALID_ATTR_LEN. */
ESP_GATT_ERR_UNLIKELY = 0x0e, /*!< 0x0e, Unlikely error. Corresponds to BTA_GATT_ERR_UNLIKELY. */
ESP_GATT_INSUF_ENCRYPTION = 0x0f, /*!< 0x0f, Insufficient encryption. Corresponds to BTA_GATT_INSUF_ENCRYPTION. */
ESP_GATT_UNSUPPORT_GRP_TYPE = 0x10, /*!< 0x10, Unsupported group type. Corresponds to BTA_GATT_UNSUPPORT_GRP_TYPE. */
ESP_GATT_INSUF_RESOURCE = 0x11, /*!< 0x11, Insufficient resource. Corresponds to BTA_GATT_INSUF_RESOURCE. */
ESP_GATT_NO_RESOURCES = 0x80, /* 0x80 */ /* relate to BTA_GATT_NO_RESOURCES in bta/bta_gatt_api.h */
ESP_GATT_INTERNAL_ERROR = 0x81, /* 0x81 */ /* relate to BTA_GATT_INTERNAL_ERROR in bta/bta_gatt_api.h */
ESP_GATT_WRONG_STATE = 0x82, /* 0x82 */ /* relate to BTA_GATT_WRONG_STATE in bta/bta_gatt_api.h */
ESP_GATT_DB_FULL = 0x83, /* 0x83 */ /* relate to BTA_GATT_DB_FULL in bta/bta_gatt_api.h */
ESP_GATT_BUSY = 0x84, /* 0x84 */ /* relate to BTA_GATT_BUSY in bta/bta_gatt_api.h */
ESP_GATT_ERROR = 0x85, /* 0x85 */ /* relate to BTA_GATT_ERROR in bta/bta_gatt_api.h */
ESP_GATT_CMD_STARTED = 0x86, /* 0x86 */ /* relate to BTA_GATT_CMD_STARTED in bta/bta_gatt_api.h */
ESP_GATT_ILLEGAL_PARAMETER = 0x87, /* 0x87 */ /* relate to BTA_GATT_ILLEGAL_PARAMETER in bta/bta_gatt_api.h */
ESP_GATT_PENDING = 0x88, /* 0x88 */ /* relate to BTA_GATT_PENDING in bta/bta_gatt_api.h */
ESP_GATT_AUTH_FAIL = 0x89, /* 0x89 */ /* relate to BTA_GATT_AUTH_FAIL in bta/bta_gatt_api.h */
ESP_GATT_MORE = 0x8a, /* 0x8a */ /* relate to BTA_GATT_MORE in bta/bta_gatt_api.h */
ESP_GATT_INVALID_CFG = 0x8b, /* 0x8b */ /* relate to BTA_GATT_INVALID_CFG in bta/bta_gatt_api.h */
ESP_GATT_SERVICE_STARTED = 0x8c, /* 0x8c */ /* relate to BTA_GATT_SERVICE_STARTED in bta/bta_gatt_api.h */
ESP_GATT_ENCRYPED_MITM = ESP_GATT_OK, /* relate to BTA_GATT_ENCRYPED_MITM in bta/bta_gatt_api.h */
ESP_GATT_ENCRYPED_NO_MITM = 0x8d, /* 0x8d */ /* relate to BTA_GATT_ENCRYPED_NO_MITM in bta/bta_gatt_api.h */
ESP_GATT_NOT_ENCRYPTED = 0x8e, /* 0x8e */ /* relate to BTA_GATT_NOT_ENCRYPTED in bta/bta_gatt_api.h */
ESP_GATT_CONGESTED = 0x8f, /* 0x8f */ /* relate to BTA_GATT_CONGESTED in bta/bta_gatt_api.h */
ESP_GATT_DUP_REG = 0x90, /* 0x90 */ /* relate to BTA_GATT_DUP_REG in bta/bta_gatt_api.h */
ESP_GATT_ALREADY_OPEN = 0x91, /* 0x91 */ /* relate to BTA_GATT_ALREADY_OPEN in bta/bta_gatt_api.h */
ESP_GATT_CANCEL = 0x92, /* 0x92 */ /* relate to BTA_GATT_CANCEL in bta/bta_gatt_api.h */
/* Additional error codes specific to implementation or future use */
ESP_GATT_NO_RESOURCES = 0x80, /*!< 0x80, No resources. Corresponds to BTA_GATT_NO_RESOURCES. */
ESP_GATT_INTERNAL_ERROR = 0x81, /*!< 0x81, Internal error. Corresponds to BTA_GATT_INTERNAL_ERROR. */
ESP_GATT_WRONG_STATE = 0x82, /*!< 0x82, Wrong state. Corresponds to BTA_GATT_WRONG_STATE. */
ESP_GATT_DB_FULL = 0x83, /*!< 0x83, Database full. Corresponds to BTA_GATT_DB_FULL. */
ESP_GATT_BUSY = 0x84, /*!< 0x84, Busy. Corresponds to BTA_GATT_BUSY. */
ESP_GATT_ERROR = 0x85, /*!< 0x85, Generic error. Corresponds to BTA_GATT_ERROR. */
ESP_GATT_CMD_STARTED = 0x86, /*!< 0x86, Command started. Corresponds to BTA_GATT_CMD_STARTED. */
ESP_GATT_ILLEGAL_PARAMETER = 0x87, /*!< 0x87, Illegal parameter. Corresponds to BTA_GATT_ILLEGAL_PARAMETER. */
ESP_GATT_PENDING = 0x88, /*!< 0x88, Operation pending. Corresponds to BTA_GATT_PENDING. */
ESP_GATT_AUTH_FAIL = 0x89, /*!< 0x89, Authentication failed. Corresponds to BTA_GATT_AUTH_FAIL. */
ESP_GATT_MORE = 0x8a, /*!< 0x8a, More data available. Corresponds to BTA_GATT_MORE. */
ESP_GATT_INVALID_CFG = 0x8b, /*!< 0x8b, Invalid configuration. Corresponds to BTA_GATT_INVALID_CFG. */
ESP_GATT_SERVICE_STARTED = 0x8c, /*!< 0x8c, Service started. Corresponds to BTA_GATT_SERVICE_STARTED. */
ESP_GATT_ENCRYPTED_MITM = ESP_GATT_OK, /*!< 0x0, Encrypted, with MITM protection. Corresponds to BTA_GATT_ENCRYPTED_MITM. */
ESP_GATT_ENCRYPTED_NO_MITM = 0x8d, /*!< 0x8d, Encrypted, without MITM protection. Corresponds to BTA_GATT_ENCRYPTED_NO_MITM. */
ESP_GATT_NOT_ENCRYPTED = 0x8e, /*!< 0x8e, Not encrypted. Corresponds to BTA_GATT_NOT_ENCRYPTED. */
ESP_GATT_CONGESTED = 0x8f, /*!< 0x8f, Congested. Corresponds to BTA_GATT_CONGESTED. */
ESP_GATT_DUP_REG = 0x90, /*!< 0x90, Duplicate registration. Corresponds to BTA_GATT_DUP_REG. */
ESP_GATT_ALREADY_OPEN = 0x91, /*!< 0x91, Already open. Corresponds to BTA_GATT_ALREADY_OPEN. */
ESP_GATT_CANCEL = 0x92, /*!< 0x92, Operation cancelled. Corresponds to BTA_GATT_CANCEL. */
/* 0xE0 ~ 0xFC reserved for future use */
ESP_GATT_STACK_RSP = 0xe0, /* 0xe0 */ /* relate to BTA_GATT_STACK_RSP in bta/bta_gatt_api.h */
ESP_GATT_APP_RSP = 0xe1, /* 0xe1 */ /* relate to BTA_GATT_APP_RSP in bta/bta_gatt_api.h */
//Error caused by customer application or stack bug
ESP_GATT_UNKNOWN_ERROR = 0xef, /* 0xef */ /* relate to BTA_GATT_UNKNOWN_ERROR in bta/bta_gatt_api.h */
ESP_GATT_CCC_CFG_ERR = 0xfd, /* 0xFD Client Characteristic Configuration Descriptor Improperly Configured */ /* relate to BTA_GATT_CCC_CFG_ERR in bta/bta_gatt_api.h */
ESP_GATT_PRC_IN_PROGRESS = 0xfe, /* 0xFE Procedure Already in progress */ /* relate to BTA_GATT_PRC_IN_PROGRESS in bta/bta_gatt_api.h */
ESP_GATT_OUT_OF_RANGE = 0xff, /* 0xFFAttribute value out of range */ /* relate to BTA_GATT_OUT_OF_RANGE in bta/bta_gatt_api.h */
ESP_GATT_STACK_RSP = 0xe0, /*!< 0xe0, Stack response. Corresponds to BTA_GATT_STACK_RSP. */
ESP_GATT_APP_RSP = 0xe1, /*!< 0xe1, Application response. Corresponds to BTA_GATT_APP_RSP. */
/* Error caused by customer application or stack bug */
ESP_GATT_UNKNOWN_ERROR = 0xef, /*!< 0xef, Unknown error. Corresponds to BTA_GATT_UNKNOWN_ERROR. */
ESP_GATT_CCC_CFG_ERR = 0xfd, /*!< 0xfd, Client Characteristic Configuration Descriptor improperly configured. Corresponds to BTA_GATT_CCC_CFG_ERR. */
ESP_GATT_PRC_IN_PROGRESS = 0xfe, /*!< 0xfe, Procedure already in progress. Corresponds to BTA_GATT_PRC_IN_PROGRESS. */
ESP_GATT_OUT_OF_RANGE = 0xff /*!< 0xff, Attribute value out of range. Corresponds to BTA_GATT_OUT_OF_RANGE. */
} esp_gatt_status_t;
/* relate to BTA_GATT_CONN_xxx in bta/bta_gatt_api.h */
/**
* @brief Gatt Connection reason enum
* @brief Enumerates reasons for GATT connection.
*/
typedef enum {
ESP_GATT_CONN_UNKNOWN = 0, /*!< Gatt connection unknown */ /* relate to BTA_GATT_CONN_UNKNOWN in bta/bta_gatt_api.h */
ESP_GATT_CONN_L2C_FAILURE = 1, /*!< General L2cap failure */ /* relate to BTA_GATT_CONN_L2C_FAILURE in bta/bta_gatt_api.h */
ESP_GATT_CONN_TIMEOUT = 0x08, /*!< Connection timeout */ /* relate to BTA_GATT_CONN_TIMEOUT in bta/bta_gatt_api.h */
ESP_GATT_CONN_TERMINATE_PEER_USER = 0x13, /*!< Connection terminate by peer user */ /* relate to BTA_GATT_CONN_TERMINATE_PEER_USER in bta/bta_gatt_api.h */
ESP_GATT_CONN_TERMINATE_LOCAL_HOST = 0x16, /*!< Connection terminated by local host */ /* relate to BTA_GATT_CONN_TERMINATE_LOCAL_HOST in bta/bta_gatt_api.h */
ESP_GATT_CONN_FAIL_ESTABLISH = 0x3e, /*!< Connection fail to establish */ /* relate to BTA_GATT_CONN_FAIL_ESTABLISH in bta/bta_gatt_api.h */
ESP_GATT_CONN_LMP_TIMEOUT = 0x22, /*!< Connection fail for LMP response tout */ /* relate to BTA_GATT_CONN_LMP_TIMEOUT in bta/bta_gatt_api.h */
ESP_GATT_CONN_CONN_CANCEL = 0x0100, /*!< L2CAP connection cancelled */ /* relate to BTA_GATT_CONN_CONN_CANCEL in bta/bta_gatt_api.h */
ESP_GATT_CONN_NONE = 0x0101 /*!< No connection to cancel */ /* relate to BTA_GATT_CONN_NONE in bta/bta_gatt_api.h */
ESP_GATT_CONN_UNKNOWN = 0, /*!< Unknown connection reason. Corresponds to BTA_GATT_CONN_UNKNOWN in bta/bta_gatt_api.h */
ESP_GATT_CONN_L2C_FAILURE = 1, /*!< General L2CAP failure. Corresponds to BTA_GATT_CONN_L2C_FAILURE in bta/bta_gatt_api.h */
ESP_GATT_CONN_TIMEOUT = 0x08, /*!< Connection timeout. Corresponds to BTA_GATT_CONN_TIMEOUT in bta/bta_gatt_api.h */
ESP_GATT_CONN_TERMINATE_PEER_USER = 0x13, /*!< Connection terminated by peer user. Corresponds to BTA_GATT_CONN_TERMINATE_PEER_USER in bta/bta_gatt_api.h */
ESP_GATT_CONN_TERMINATE_LOCAL_HOST = 0x16, /*!< Connection terminated by local host. Corresponds to BTA_GATT_CONN_TERMINATE_LOCAL_HOST in bta/bta_gatt_api.h */
ESP_GATT_CONN_FAIL_ESTABLISH = 0x3e, /*!< Failure to establish connection. Corresponds to BTA_GATT_CONN_FAIL_ESTABLISH in bta/bta_gatt_api.h */
ESP_GATT_CONN_LMP_TIMEOUT = 0x22, /*!< Connection failed due to LMP response timeout. Corresponds to BTA_GATT_CONN_LMP_TIMEOUT in bta/bta_gatt_api.h */
ESP_GATT_CONN_CONN_CANCEL = 0x0100, /*!< L2CAP connection cancelled. Corresponds to BTA_GATT_CONN_CONN_CANCEL in bta/bta_gatt_api.h */
ESP_GATT_CONN_NONE = 0x0101 /*!< No connection to cancel. Corresponds to BTA_GATT_CONN_NONE in bta/bta_gatt_api.h */
} esp_gatt_conn_reason_t;
/**
* @brief Gatt id, include uuid and instance id
* @brief Represents a GATT identifier.
*/
typedef struct {
esp_bt_uuid_t uuid; /*!< UUID */
uint8_t inst_id; /*!< Instance id */
esp_bt_uuid_t uuid; /*!< @brief The UUID component of the GATT ID. */
uint8_t inst_id; /*!< @brief The instance ID component of the GATT ID, providing further differentiation of the GATT ID. */
} __attribute__((packed)) esp_gatt_id_t;
/**
* @brief Gatt service id, include id
* (uuid and instance id) and primary flag
* @brief Represents a GATT service identifier.
*/
typedef struct {
esp_gatt_id_t id; /*!< Gatt id, include uuid and instance */
bool is_primary; /*!< This service is primary or not */
esp_gatt_id_t id; /*!< @brief Encapsulates the UUID and instance ID of the GATT service. */
bool is_primary; /*!< @brief Indicates if the service is primary. A value of true means it is a primary service, false indicates a secondary service. */
} __attribute__((packed)) esp_gatt_srvc_id_t;
/* relate to BTA_GATT_AUTH_REQ_xxx in bta/bta_gatt_api.h */
/**
* @brief Gatt authentication request type
* @brief Defines the GATT authentication request types.
*
* This enumeration lists the types of authentication requests that can be made.
* It corresponds to the `BTA_GATT_AUTH_REQ_xxx` values defined in `bta/bta_gatt_api.h`.
* The types include options for no authentication, unauthenticated encryption, authenticated encryption,
* and both signed versions with and without MITM (Man-In-The-Middle) protection.
*/
typedef enum {
ESP_GATT_AUTH_REQ_NONE = 0, /* relate to BTA_GATT_AUTH_REQ_NONE in bta/bta_gatt_api.h */
ESP_GATT_AUTH_REQ_NO_MITM = 1, /* unauthenticated encryption */ /* relate to BTA_GATT_AUTH_REQ_NO_MITM in bta/bta_gatt_api.h */
ESP_GATT_AUTH_REQ_MITM = 2, /* authenticated encryption */ /* relate to BTA_GATT_AUTH_REQ_MITM in bta/bta_gatt_api.h */
ESP_GATT_AUTH_REQ_SIGNED_NO_MITM = 3, /* relate to BTA_GATT_AUTH_REQ_SIGNED_NO_MITM in bta/bta_gatt_api.h */
ESP_GATT_AUTH_REQ_SIGNED_MITM = 4, /* relate to BTA_GATT_AUTH_REQ_SIGNED_MITM in bta/bta_gatt_api.h */
ESP_GATT_AUTH_REQ_NONE = 0, /*!< No authentication required. Corresponds to BTA_GATT_AUTH_REQ_NONE. */
ESP_GATT_AUTH_REQ_NO_MITM = 1, /*!< Unauthenticated encryption. Corresponds to BTA_GATT_AUTH_REQ_NO_MITM. */
ESP_GATT_AUTH_REQ_MITM = 2, /*!< Authenticated encryption (MITM protection). Corresponds to BTA_GATT_AUTH_REQ_MITM. */
ESP_GATT_AUTH_REQ_SIGNED_NO_MITM = 3, /*!< Signed data, no MITM protection. Corresponds to BTA_GATT_AUTH_REQ_SIGNED_NO_MITM. */
ESP_GATT_AUTH_REQ_SIGNED_MITM = 4, /*!< Signed data with MITM protection. Corresponds to BTA_GATT_AUTH_REQ_SIGNED_MITM. */
} esp_gatt_auth_req_t;
/* relate to BTA_GATT_PERM_xxx in bta/bta_gatt_api.h */
/**
* @brief Attribute permissions
*/
#define ESP_GATT_PERM_READ (1 << 0) /* bit 0 - 0x0001 */ /* relate to BTA_GATT_PERM_READ in bta/bta_gatt_api.h */
#define ESP_GATT_PERM_READ_ENCRYPTED (1 << 1) /* bit 1 - 0x0002 */ /* relate to BTA_GATT_PERM_READ_ENCRYPTED in bta/bta_gatt_api.h */
#define ESP_GATT_PERM_READ_ENC_MITM (1 << 2) /* bit 2 - 0x0004 */ /* relate to BTA_GATT_PERM_READ_ENC_MITM in bta/bta_gatt_api.h */
#define ESP_GATT_PERM_WRITE (1 << 4) /* bit 4 - 0x0010 */ /* relate to BTA_GATT_PERM_WRITE in bta/bta_gatt_api.h */
#define ESP_GATT_PERM_WRITE_ENCRYPTED (1 << 5) /* bit 5 - 0x0020 */ /* relate to BTA_GATT_PERM_WRITE_ENCRYPTED in bta/bta_gatt_api.h */
#define ESP_GATT_PERM_WRITE_ENC_MITM (1 << 6) /* bit 6 - 0x0040 */ /* relate to BTA_GATT_PERM_WRITE_ENC_MITM in bta/bta_gatt_api.h */
#define ESP_GATT_PERM_WRITE_SIGNED (1 << 7) /* bit 7 - 0x0080 */ /* relate to BTA_GATT_PERM_WRITE_SIGNED in bta/bta_gatt_api.h */
#define ESP_GATT_PERM_WRITE_SIGNED_MITM (1 << 8) /* bit 8 - 0x0100 */ /* relate to BTA_GATT_PERM_WRITE_SIGNED_MITM in bta/bta_gatt_api.h */
#define ESP_GATT_PERM_READ_AUTHORIZATION (1 << 9) /* bit 9 - 0x0200 */
#define ESP_GATT_PERM_WRITE_AUTHORIZATION (1 << 10) /* bit 10 - 0x0400 */
#define ESP_GATT_PERM_ENCRYPT_KEY_SIZE(keysize) (((keysize - 6) & 0xF) << 12) /* bit 12:15 - 0xF000 */
typedef uint16_t esp_gatt_perm_t;
/* relate to BTA_GATT_CHAR_PROP_BIT_xxx in bta/bta_gatt_api.h */
/* definition of characteristic properties */
#define ESP_GATT_CHAR_PROP_BIT_BROADCAST (1 << 0) /* 0x01 */ /* relate to BTA_GATT_CHAR_PROP_BIT_BROADCAST in bta/bta_gatt_api.h */
#define ESP_GATT_CHAR_PROP_BIT_READ (1 << 1) /* 0x02 */ /* relate to BTA_GATT_CHAR_PROP_BIT_READ in bta/bta_gatt_api.h */
#define ESP_GATT_CHAR_PROP_BIT_WRITE_NR (1 << 2) /* 0x04 */ /* relate to BTA_GATT_CHAR_PROP_BIT_WRITE_NR in bta/bta_gatt_api.h */
#define ESP_GATT_CHAR_PROP_BIT_WRITE (1 << 3) /* 0x08 */ /* relate to BTA_GATT_CHAR_PROP_BIT_WRITE in bta/bta_gatt_api.h */
#define ESP_GATT_CHAR_PROP_BIT_NOTIFY (1 << 4) /* 0x10 */ /* relate to BTA_GATT_CHAR_PROP_BIT_NOTIFY in bta/bta_gatt_api.h */
#define ESP_GATT_CHAR_PROP_BIT_INDICATE (1 << 5) /* 0x20 */ /* relate to BTA_GATT_CHAR_PROP_BIT_INDICATE in bta/bta_gatt_api.h */
#define ESP_GATT_CHAR_PROP_BIT_AUTH (1 << 6) /* 0x40 */ /* relate to BTA_GATT_CHAR_PROP_BIT_AUTH in bta/bta_gatt_api.h */
#define ESP_GATT_CHAR_PROP_BIT_EXT_PROP (1 << 7) /* 0x80 */ /* relate to BTA_GATT_CHAR_PROP_BIT_EXT_PROP in bta/bta_gatt_api.h */
/**
* @brief Defines GATT attribute permission flags.
*
* These permission flags are used to specify the security requirements for GATT attributes.
* They correlate directly with the BTA_GATT_PERM_xxx definitions found in bta/bta_gatt_api.h.
*/
/** @defgroup GATT_PERMS GATT Attribute Permissions
* @brief Definitions of permission flags for GATT attributes.
* @{
*/
/** @brief Permission to read the attribute. Corresponds to BTA_GATT_PERM_READ. */
#define ESP_GATT_PERM_READ (1 << 0)
/** @brief Permission to read the attribute with encryption. Corresponds to BTA_GATT_PERM_READ_ENCRYPTED. */
#define ESP_GATT_PERM_READ_ENCRYPTED (1 << 1)
/** @brief Permission to read the attribute with encrypted MITM (Man In The Middle) protection. Corresponds to BTA_GATT_PERM_READ_ENC_MITM.*/
#define ESP_GATT_PERM_READ_ENC_MITM (1 << 2)
/** @brief Permission to write to the attribute. Corresponds to BTA_GATT_PERM_WRITE. */
#define ESP_GATT_PERM_WRITE (1 << 4)
/** @brief Permission to write to the attribute with encryption. Corresponds to BTA_GATT_PERM_WRITE_ENCRYPTED. */
#define ESP_GATT_PERM_WRITE_ENCRYPTED (1 << 5)
/** @brief Permission to write to the attribute with encrypted MITM protection. Corresponds to BTA_GATT_PERM_WRITE_ENC_MITM. */
#define ESP_GATT_PERM_WRITE_ENC_MITM (1 << 6)
/** @brief Permission for signed writes to the attribute. Corresponds to BTA_GATT_PERM_WRITE_SIGNED. */
#define ESP_GATT_PERM_WRITE_SIGNED (1 << 7)
/** @brief Permission for signed writes to the attribute with MITM protection. Corresponds to BTA_GATT_PERM_WRITE_SIGNED_MITM. */
#define ESP_GATT_PERM_WRITE_SIGNED_MITM (1 << 8)
/** @brief Permission to read the attribute with authorization. */
#define ESP_GATT_PERM_READ_AUTHORIZATION (1 << 9)
/** @brief Permission to write to the attribute with authorization. */
#define ESP_GATT_PERM_WRITE_AUTHORIZATION (1 << 10)
/**
* @brief Macro to specify minimum encryption key size.
*
* @param keysize The minimum size of the encryption key, in bytes.
*/
#define ESP_GATT_PERM_ENCRYPT_KEY_SIZE(keysize) (((keysize - 6) & 0xF) << 12)
/** @} */ // End of GATT_PERMS group
typedef uint16_t esp_gatt_perm_t; ///< Type to represent GATT attribute permissions.
/**
* @brief Defines GATT characteristic properties.
*
* These properties are related to `BTA_GATT_CHAR_PROP_BIT_xxx` in `bta/bta_gatt_api.h`.
*/
/** @defgroup GATT_CHAR_PROPERTIES GATT Characteristic Properties
* These properties define various capabilities of a GATT characteristic.
* @{
*/
/** @brief Ability to broadcast.Corresponds to BTA_GATT_CHAR_PROP_BIT_BROADCAST. */
#define ESP_GATT_CHAR_PROP_BIT_BROADCAST (1 << 0)
/** @brief Ability to read.Corresponds to BTA_GATT_CHAR_PROP_BIT_READ. */
#define ESP_GATT_CHAR_PROP_BIT_READ (1 << 1)
/** @brief Ability to write without response.Corresponds to BTA_GATT_CHAR_PROP_BIT_WRITE_NR. */
#define ESP_GATT_CHAR_PROP_BIT_WRITE_NR (1 << 2)
/** @brief Ability to write.Corresponds to BTA_GATT_CHAR_PROP_BIT_WRITE. */
#define ESP_GATT_CHAR_PROP_BIT_WRITE (1 << 3)
/** @brief Ability to notify.Corresponds to BTA_GATT_CHAR_PROP_BIT_NOTIFY. */
#define ESP_GATT_CHAR_PROP_BIT_NOTIFY (1 << 4)
/** @brief Ability to indicate.Corresponds to BTA_GATT_CHAR_PROP_BIT_INDICATE. */
#define ESP_GATT_CHAR_PROP_BIT_INDICATE (1 << 5)
/** @brief Ability to authenticate.Corresponds to BTA_GATT_CHAR_PROP_BIT_AUTH. */
#define ESP_GATT_CHAR_PROP_BIT_AUTH (1 << 6)
/** @brief Has extended properties.Corresponds to BTA_GATT_CHAR_PROP_BIT_EXT_PROP. */
#define ESP_GATT_CHAR_PROP_BIT_EXT_PROP (1 << 7)
/** @} */ // end of GATT_CHAR_PROPERTIES
/**
* @typedef esp_gatt_char_prop_t
* @brief Type for characteristic properties bitmask.
*/
typedef uint8_t esp_gatt_char_prop_t;
/// GATT maximum attribute length
#define ESP_GATT_MAX_ATTR_LEN 600 //as same as GATT_MAX_ATTR_LEN
/**
* @brief Defines the maximum length of a GATT attribute.
*
* This definition specifies the maximum number of bytes that a GATT attribute can hold.
*/
#define ESP_GATT_MAX_ATTR_LEN 512 /*!< As same as GATT_MAX_ATTR_LEN. */
/**
* @brief Enumerates the possible sources of a GATT service discovery.
*
* This enumeration identifies the source of a GATT service discovery process,
* indicating whether the service information was obtained from a remote device,
* from NVS (Non-Volatile Storage) flash, or the source is unknown.
*/
typedef enum {
ESP_GATT_SERVICE_FROM_REMOTE_DEVICE = 0, /* relate to BTA_GATTC_SERVICE_INFO_FROM_REMOTE_DEVICE in bta_gattc_int.h */
ESP_GATT_SERVICE_FROM_NVS_FLASH = 1, /* relate to BTA_GATTC_SERVICE_INFO_FROM_NVS_FLASH in bta_gattc_int.h */
ESP_GATT_SERVICE_FROM_UNKNOWN = 2, /* relate to BTA_GATTC_SERVICE_INFO_FROM_UNKNOWN in bta_gattc_int.h */
ESP_GATT_SERVICE_FROM_REMOTE_DEVICE = 0, /*!< Service information from a remote device. Relates to BTA_GATTC_SERVICE_INFO_FROM_REMOTE_DEVICE. */
ESP_GATT_SERVICE_FROM_NVS_FLASH = 1, /*!< Service information from NVS flash. Relates to BTA_GATTC_SERVICE_INFO_FROM_NVS_FLASH. */
ESP_GATT_SERVICE_FROM_UNKNOWN = 2, /*!< Service source is unknown. Relates to BTA_GATTC_SERVICE_INFO_FROM_UNKNOWN. */
} esp_service_source_t;
/**
* @brief Attribute description (used to create database)
*/
typedef struct
{
uint16_t uuid_length; /*!< UUID length */
uint8_t *uuid_p; /*!< UUID value */
uint16_t perm; /*!< Attribute permission */
uint16_t max_length; /*!< Maximum length of the element*/
uint16_t length; /*!< Current length of the element*/
uint8_t *value; /*!< Element value array*/
} esp_attr_desc_t;
/**
* @brief attribute auto response flag
* @brief Defines an attribute's description.
*
* This structure is used to describe an attribute in the GATT database. It includes
* details such as the UUID of the attribute, its permissions, and its value.
*/
typedef struct
{
uint16_t uuid_length; /*!< Length of the UUID in bytes. */
uint8_t *uuid_p; /*!< Pointer to the UUID value. */
uint16_t perm; /*!< Attribute permissions, defined by esp_gatt_perm_t. */
uint16_t max_length; /*!< Maximum length of the attribute's value. */
uint16_t length; /*!< Current length of the attribute's value. */
uint8_t *value; /*!< Pointer to the attribute's value array. */
} esp_attr_desc_t;
/**
* @brief Defines attribute control for GATT operations.
*
* This module provides definitions for controlling attribute auto responses
* in GATT operations.
*/
/** @brief Response to Write/Read operations should be handled by the application. */
#define ESP_GATT_RSP_BY_APP 0
/** @brief Response to Write/Read operations should be automatically handled by the GATT stack. */
#define ESP_GATT_AUTO_RSP 1
/**
* @brief Defines the auto response setting for attribute operations.
*
* This structure is used to control whether the GATT stack or the application
* will handle responses to Read/Write operations.
*/
typedef struct
{
#define ESP_GATT_RSP_BY_APP 0
#define ESP_GATT_AUTO_RSP 1
/**
* @brief if auto_rsp set to ESP_GATT_RSP_BY_APP, means the response of Write/Read operation will by replied by application.
if auto_rsp set to ESP_GATT_AUTO_RSP, means the response of Write/Read operation will be replied by GATT stack automatically.
* @brief Controls who handles the response to Read/Write operations.
*
* - If set to @c ESP_GATT_RSP_BY_APP, the application is responsible for
* generating the response.
* - If set to @c ESP_GATT_AUTO_RSP, the GATT stack will automatically generate
* the response.
*/
uint8_t auto_rsp;
} esp_attr_control_t;
/**
* @brief attribute type added to the gatt server database
* @brief attribute type added to the GATT server database
*/
typedef struct
{
@@ -378,116 +585,103 @@ typedef struct
uint16_t end_hdl; /*!< Gatt end handle value of included 128 bit service */
} esp_gatts_incl128_svc_desc_t; /*!< Gatt include 128 bit service entry element */
/// Gatt attribute value
/**
* @brief Represents a GATT attribute's value.
*/
typedef struct {
uint8_t value[ESP_GATT_MAX_ATTR_LEN]; /*!< Gatt attribute value */
uint16_t handle; /*!< Gatt attribute handle */
uint16_t offset; /*!< Gatt attribute value offset */
uint16_t len; /*!< Gatt attribute value length */
uint8_t auth_req; /*!< Gatt authentication request */
uint8_t value[ESP_GATT_MAX_ATTR_LEN]; /*!< Array holding the value of the GATT attribute. */
uint16_t handle; /*!< Unique identifier (handle) of the GATT attribute. */
uint16_t offset; /*!< Offset within the attribute's value, for partial updates. */
uint16_t len; /*!< Current length of the data in the value array. */
uint8_t auth_req; /*!< Authentication requirements for accessing this attribute. */
} esp_gatt_value_t;
/// GATT remote read request response type
/**
* @brief Represents the response type for a GATT remote read request.
*/
typedef union {
esp_gatt_value_t attr_value; /*!< Gatt attribute structure */
uint16_t handle; /*!< Gatt attribute handle */
esp_gatt_value_t attr_value; /*!< The GATT attribute value, including its data, handle, and metadata. */
uint16_t handle; /*!< Only the handle of the GATT attribute, when that's the only required information. */
} esp_gatt_rsp_t;
/**
* @brief Gatt write type
*/
* @brief Defines the types of GATT write operations.
*/
typedef enum {
ESP_GATT_WRITE_TYPE_NO_RSP = 1, /*!< Gatt write attribute need no response */
ESP_GATT_WRITE_TYPE_RSP, /*!< Gatt write attribute need remote response */
ESP_GATT_WRITE_TYPE_NO_RSP = 1, /*!< Write operation where no response is needed. */
ESP_GATT_WRITE_TYPE_RSP = 2, /*!< Write operation that requires a remote response. */
} esp_gatt_write_type_t;
/**
* @brief Connection parameters information
*/
/** @brief Connection parameters for GATT. */
typedef struct {
uint16_t interval; /*!< connection interval */
uint16_t latency; /*!< Slave latency for the connection in number of connection events. Range: 0x0000 to 0x01F3 */
uint16_t timeout; /*!< Supervision timeout for the LE Link. Range: 0x000A to 0x0C80.
Mandatory Range: 0x000A to 0x0C80 Time = N * 10 msec
Time Range: 100 msec to 32 seconds */
uint16_t interval; /*!< Connection interval. */
uint16_t latency; /*!< Slave latency for the connection in number of connection events. */
uint16_t timeout; /*!< Supervision timeout for the LE Link. */
} esp_gatt_conn_params_t;
#define ESP_GATT_IF_NONE 0xff /*!< If callback report gattc_if/gatts_if as this macro, means this event is not correspond to any app */
/** @brief Macro indicating no specific GATT interface. */
#define ESP_GATT_IF_NONE 0xff /*!< No specific application GATT interface. */
typedef uint8_t esp_gatt_if_t; /*!< Gatt interface type, different application on GATT client use different gatt_if */
/** @brief GATT interface type for client applications. */
typedef uint8_t esp_gatt_if_t;
/**
* @brief the type of attribute element
*/
/** @brief Enumerates types of GATT database attributes. */
typedef enum {
ESP_GATT_DB_PRIMARY_SERVICE, /*!< Gattc primary service attribute type in the cache */
ESP_GATT_DB_SECONDARY_SERVICE, /*!< Gattc secondary service attribute type in the cache */
ESP_GATT_DB_CHARACTERISTIC, /*!< Gattc characteristic attribute type in the cache */
ESP_GATT_DB_DESCRIPTOR, /*!< Gattc characteristic descriptor attribute type in the cache */
ESP_GATT_DB_INCLUDED_SERVICE, /*!< Gattc include service attribute type in the cache */
ESP_GATT_DB_ALL, /*!< Gattc all the attribute (primary service & secondary service & include service & char & descriptor) type in the cache */
} esp_gatt_db_attr_type_t; /*!< Gattc attribute type element */
ESP_GATT_DB_PRIMARY_SERVICE, /*!< Primary service attribute. */
ESP_GATT_DB_SECONDARY_SERVICE, /*!< Secondary service attribute. */
ESP_GATT_DB_CHARACTERISTIC, /*!< Characteristic attribute. */
ESP_GATT_DB_DESCRIPTOR, /*!< Descriptor attribute. */
ESP_GATT_DB_INCLUDED_SERVICE, /*!< Included service attribute. */
ESP_GATT_DB_ALL, /*!< All attribute types. */
} esp_gatt_db_attr_type_t;
/**
* @brief read multiple attribute
*/
/** @brief Represents multiple attributes for reading. */
typedef struct {
uint8_t num_attr; /*!< The number of the attribute */
uint16_t handles[ESP_GATT_MAX_READ_MULTI_HANDLES]; /*!< The handles list */
} esp_gattc_multi_t; /*!< The gattc multiple read element */
uint8_t num_attr; /*!< Number of attributes. */
uint16_t handles[ESP_GATT_MAX_READ_MULTI_HANDLES]; /*!< List of attribute handles. */
} esp_gattc_multi_t;
/**
* @brief data base attribute element
*/
/** @brief GATT database attribute element. */
typedef struct {
esp_gatt_db_attr_type_t type; /*!< The attribute type */
uint16_t attribute_handle; /*!< The attribute handle, it's valid for all of the type */
uint16_t start_handle; /*!< The service start handle, it's valid only when the type = ESP_GATT_DB_PRIMARY_SERVICE or ESP_GATT_DB_SECONDARY_SERVICE */
uint16_t end_handle; /*!< The service end handle, it's valid only when the type = ESP_GATT_DB_PRIMARY_SERVICE or ESP_GATT_DB_SECONDARY_SERVICE */
esp_gatt_char_prop_t properties; /*!< The characteristic properties, it's valid only when the type = ESP_GATT_DB_CHARACTERISTIC */
esp_bt_uuid_t uuid; /*!< The attribute uuid, it's valid for all of the type */
} esp_gattc_db_elem_t; /*!< The gattc service data base element in the cache */
esp_gatt_db_attr_type_t type; /*!< Attribute type. */
uint16_t attribute_handle; /*!< Attribute handle. */
uint16_t start_handle; /*!< Service start handle. */
uint16_t end_handle; /*!< Service end handle. */
esp_gatt_char_prop_t properties; /*!< Characteristic properties. */
esp_bt_uuid_t uuid; /*!< Attribute UUID. */
} esp_gattc_db_elem_t;
/**
* @brief service element
*/
/** @brief Represents a GATT service element. */
typedef struct {
bool is_primary; /*!< The service flag, true if the service is primary service, else is secondary service */
uint16_t start_handle; /*!< The start handle of the service */
uint16_t end_handle; /*!< The end handle of the service */
esp_bt_uuid_t uuid; /*!< The uuid of the service */
} esp_gattc_service_elem_t; /*!< The gattc service element */
bool is_primary; /*!< Indicates if the service is primary. */
uint16_t start_handle; /*!< Service start handle. */
uint16_t end_handle; /*!< Service end handle. */
esp_bt_uuid_t uuid; /*!< Service UUID. */
} esp_gattc_service_elem_t;
/**
* @brief characteristic element
*/
/** @brief Represents a GATT characteristic element. */
typedef struct {
uint16_t char_handle; /*!< The characteristic handle */
esp_gatt_char_prop_t properties; /*!< The characteristic properties */
esp_bt_uuid_t uuid; /*!< The characteristic uuid */
} esp_gattc_char_elem_t; /*!< The gattc characteristic element */
uint16_t char_handle; /*!< Characteristic handle. */
esp_gatt_char_prop_t properties; /*!< Characteristic properties. */
esp_bt_uuid_t uuid; /*!< Characteristic UUID. */
} esp_gattc_char_elem_t;
/**
* @brief descriptor element
*/
/** @brief Represents a GATT descriptor element. */
typedef struct {
uint16_t handle; /*!< The characteristic descriptor handle */
esp_bt_uuid_t uuid; /*!< The characteristic descriptor uuid */
} esp_gattc_descr_elem_t; /*!< The gattc descriptor type element */
uint16_t handle; /*!< Descriptor handle. */
esp_bt_uuid_t uuid; /*!< Descriptor UUID. */
} esp_gattc_descr_elem_t;
/**
* @brief include service element
*/
/** @brief Represents an included GATT service element. */
typedef struct {
uint16_t handle; /*!< The include service current attribute handle */
uint16_t incl_srvc_s_handle; /*!< The start handle of the service which has been included */
uint16_t incl_srvc_e_handle; /*!< The end handle of the service which has been included */
esp_bt_uuid_t uuid; /*!< The include service uuid */
} esp_gattc_incl_svc_elem_t; /*!< The gattc include service element */
uint16_t handle; /*!< Current attribute handle of the included service. */
uint16_t incl_srvc_s_handle; /*!< Start handle of the included service. */
uint16_t incl_srvc_e_handle; /*!< End handle of the included service. */
esp_bt_uuid_t uuid; /*!< Included service UUID. */
} esp_gattc_incl_svc_elem_t;
#ifdef __cplusplus
}
#endif
#endif /* __ESP_GATT_DEFS_H__ */

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

@@ -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_SPP_API_H__
#define __ESP_SPP_API_H__
@@ -35,10 +27,18 @@ typedef enum {
} esp_spp_status_t;
/* Security Setting Mask
Use these three mask mode:
Use these three mask modes on both sides:
1. ESP_SPP_SEC_NONE
2. ESP_SPP_SEC_AUTHENTICATE
3. (ESP_SPP_SEC_ENCRYPT|ESP_SPP_SEC_AUTHENTICATE)
3. (ESP_SPP_SEC_AUTHENTICATE | ESP_SPP_SEC_ENCRYPT)
Use these three mask modes only on acceptor side:
1. ESP_SPP_SEC_IN_16_DIGITS
2. (ESP_SPP_SEC_IN_16_DIGITS | ESP_SPP_SEC_AUTHENTICATE)
3. (ESP_SPP_SEC_IN_16_DIGITS | ESP_SPP_SEC_AUTHENTICATE | ESP_SPP_SEC_ENCRYPT)
Due to certain limitations, do not use these mask modes:
1. ESP_SPP_SEC_AUTHORIZE
2. ESP_SPP_SEC_MODE4_LEVEL4
3. ESP_SPP_SEC_MITM
*/
#define ESP_SPP_SEC_NONE 0x0000 /*!< No security. relate to BTA_SEC_NONE in bta/bta_api.h */
#define ESP_SPP_SEC_AUTHORIZE 0x0001 /*!< Authorization required (only needed for out going connection ) relate to BTA_SEC_AUTHORIZE in bta/bta_api.h*/

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
@@ -604,6 +612,11 @@ void bta_dm_disable (tBTA_DM_MSG *p_data)
btm_ble_resolving_list_cleanup (); //by TH, because cmn_ble_vsc_cb.max_filter has something mistake as btm_ble_adv_filter_cleanup
#endif
#if BLE_INCLUDED == TRUE
// btm_ble_multi_adv_init is called when the host is enabled, so btm_ble_multi_adv_cleanup is called when the host is disabled.
btm_ble_multi_adv_cleanup();
#endif
}
/*******************************************************************************
@@ -638,7 +651,7 @@ static void bta_dm_disable_timer_cback (TIMER_LIST_ENT *p_tle)
}
/* Retrigger disable timer in case ACL disconnect failed, DISABLE_EVT still need
to be sent out to avoid jave layer disable timeout */
to be sent out to avoid the layer disable timeout */
if (trigger_disc) {
bta_dm_cb.disable_timer.p_cback = (TIMER_CBACK *)&bta_dm_disable_timer_cback;
bta_dm_cb.disable_timer.param = 1;
@@ -694,6 +707,14 @@ void bta_dm_get_dev_name (tBTA_DM_MSG *p_data)
}
}
void bta_dm_send_vendor_hci(tBTA_DM_MSG *p_data)
{
BTM_VendorSpecificCommand(p_data->vendor_hci_cmd.opcode,
p_data->vendor_hci_cmd.param_len,
p_data->vendor_hci_cmd.p_param_buf,
p_data->vendor_hci_cmd.vendor_hci_cb);
}
/*******************************************************************************
**
** Function bta_dm_set_afh_channels
@@ -742,7 +763,7 @@ static BOOLEAN bta_dm_read_remote_device_name (BD_ADDR bd_addr, tBT_TRANSPORT tr
APPL_TRACE_DEBUG("bta_dm_read_remote_device_name: BTM_ReadRemoteDeviceName is busy");
/* Remote name discovery is on going now so BTM cannot notify through "bta_dm_remname_cback" */
/* adding callback to get notified that current reading remore name done */
/* adding callback to get notified that current reading remote name done */
BTM_SecAddRmtNameNotifyCallback(&bta_dm_service_search_remname_cback);
return (TRUE);
@@ -1073,7 +1094,7 @@ void bta_dm_add_device (tBTA_DM_MSG *p_data)
}
if (p_dev->is_trusted) {
/* covert BTA service mask to BTM mask */
/* convert BTA service mask to BTM mask */
while (p_dev->tm && (index < BTA_MAX_SERVICE_ID)) {
if (p_dev->tm & (UINT32)(1 << index)) {
@@ -1101,7 +1122,7 @@ void bta_dm_add_device (tBTA_DM_MSG *p_data)
** Function bta_dm_close_acl
**
** Description This function forces to close the connection to a remote device
** and optionaly remove the device from security database if
** and optionally remove the device from security database if
** required.
****
*******************************************************************************/
@@ -2626,7 +2647,7 @@ static void bta_dm_discover_device(BD_ADDR remote_bd_addr)
&bta_dm_search_cb.services_found );
}
/* if seaching with EIR is not completed */
/* if searching with EIR is not completed */
if (bta_dm_search_cb.services_to_search) {
/* check whether connection already exists to the device
if connection exists, we don't have to wait for ACL
@@ -3700,7 +3721,7 @@ static void bta_dm_disable_conn_down_timer_cback (TIMER_LIST_ENT *p_tle)
tBTA_SYS_HW_MSG *sys_enable_event;
#if (BTA_DM_PM_INCLUDED == TRUE)
/* disable the power managment module */
/* disable the power management module */
bta_dm_disable_pm();
#endif /* #if (BTA_DM_PM_INCLUDED == TRUE) */
@@ -4082,7 +4103,7 @@ static void bta_dm_set_eir (char *local_name)
p = (UINT8 *)p_buf + BTM_HCI_EIR_OFFSET; /* reset p */
#endif // BTA_EIR_CANNED_UUID_LIST
/* if UUID doesn't fit remaing space, shorten local name */
/* if UUID doesn't fit remaining space, shorten local name */
if ( local_name_len > (free_eir_length - 4 - num_uuid * LEN_UUID_16)) {
APPL_TRACE_WARNING("BTA EIR: local name is shortened");
local_name_len = p_bta_dm_eir_cfg->bta_dm_eir_min_name_len;
@@ -5101,14 +5122,14 @@ void bta_dm_ble_disconnect (tBTA_DM_MSG *p_data)
**
** Description This function set the LE random address for the device.
**
** Parameters: rand_addr:the random address whitch should be setting
** Parameters: rand_addr:the random address which should be setting
** Explanation: This function added by Yulong at 2016/9/9
*******************************************************************************/
void bta_dm_ble_set_rand_address(tBTA_DM_MSG *p_data)
{
tBTM_STATUS status = BTM_SET_STATIC_RAND_ADDR_FAIL;
if (p_data->set_addr.addr_type != BLE_ADDR_RANDOM) {
APPL_TRACE_ERROR("Invalid random adress type = %d\n", p_data->set_addr.addr_type);
APPL_TRACE_ERROR("Invalid random address type = %d\n", p_data->set_addr.addr_type);
if(p_data->set_addr.p_set_rand_addr_cback) {
(*p_data->set_addr.p_set_rand_addr_cback)(status);
}
@@ -5463,7 +5484,7 @@ void bta_dm_ble_set_data_length(tBTA_DM_MSG *p_data)
}
p_acl_cb->p_set_pkt_data_cback = p_data->ble_set_data_length.p_set_pkt_data_cback;
// if the value of the data length is same, triger callback directly
// if the value of the data length is same, trigger callback directly
if(p_data->ble_set_data_length.tx_data_length == p_acl_cb->data_length_params.tx_len) {
if(p_data->ble_set_data_length.p_set_pkt_data_cback) {
(*p_data->ble_set_data_length.p_set_pkt_data_cback)(status, &p_acl_cb->data_length_params);
@@ -5472,7 +5493,7 @@ void bta_dm_ble_set_data_length(tBTA_DM_MSG *p_data)
}
if(p_acl_cb->data_len_updating) {
// aleady have one cmd
// already have one cmd
if(p_acl_cb->data_len_waiting) {
status = BTM_ILLEGAL_ACTION;
} else {
@@ -5633,7 +5654,66 @@ 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_dtm_tx_start(tBTA_DM_MSG *p_data)
{
BTM_BleTransmitterTest(p_data->dtm_tx_start.tx_channel, p_data->dtm_tx_start.len_of_data, p_data->dtm_tx_start.pkt_payload, p_data->dtm_tx_start.p_dtm_cmpl_cback);
}
void bta_dm_ble_gap_dtm_rx_start(tBTA_DM_MSG *p_data)
{
BTM_BleReceiverTest(p_data->dtm_rx_start.rx_channel, p_data->dtm_rx_start.p_dtm_cmpl_cback);
}
void bta_dm_ble_gap_dtm_stop(tBTA_DM_MSG *p_data)
{
BTM_BleTestEnd(p_data->dtm_stop.p_dtm_cmpl_cback);
}
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);
}
}
}
void bta_dm_ble_gap_set_rpa_timeout(tBTA_DM_MSG *p_data)
{
APPL_TRACE_API("%s, rpa_timeout = %d", __func__, p_data->set_rpa_timeout.rpa_timeout);
BTM_BleSetRpaTimeout(p_data->set_rpa_timeout.rpa_timeout,p_data->set_rpa_timeout.p_set_rpa_timeout_cback);
}
void bta_dm_ble_gap_add_dev_to_resolving_list(tBTA_DM_MSG *p_data)
{
APPL_TRACE_API("%s", __func__);
BTM_BleAddDevToResolvingList(p_data->add_dev_to_resolving_list.addr,
p_data->add_dev_to_resolving_list.addr_type,
p_data->add_dev_to_resolving_list.irk,
p_data->add_dev_to_resolving_list.p_add_dev_to_resolving_list_callback);
}
void bta_dm_ble_gap_set_privacy_mode(tBTA_DM_MSG *p_data)
{
APPL_TRACE_API("%s, privacy_mode = %d", __func__, p_data->ble_set_privacy_mode.privacy_mode);
BTM_BleSetPrivacyMode(p_data->ble_set_privacy_mode.addr_type, p_data->ble_set_privacy_mode.addr,
p_data->ble_set_privacy_mode.privacy_mode, p_data->ble_set_privacy_mode.p_cback);
}
#if (BLE_50_FEATURE_SUPPORT == TRUE)
void bta_dm_ble_gap_dtm_enhance_tx_start(tBTA_DM_MSG *p_data)
{
BTM_BleEnhancedTransmitterTest(p_data->dtm_enh_tx_start.tx_channel, p_data->dtm_enh_tx_start.len_of_data,
p_data->dtm_enh_tx_start.pkt_payload, p_data->dtm_enh_tx_start.phy, p_data->dtm_enh_tx_start.p_dtm_cmpl_cback);
}
void bta_dm_ble_gap_dtm_enhance_rx_start(tBTA_DM_MSG *p_data)
{
BTM_BleEnhancedReceiverTest(p_data->dtm_enh_rx_start.rx_channel, p_data->dtm_enh_rx_start.phy,
p_data->dtm_enh_rx_start.modulation_index, p_data->dtm_enh_rx_start.p_dtm_cmpl_cback);
}
void bta_dm_ble_gap_read_phy(tBTA_DM_MSG *p_data)
{
//tBTM_STATUS btm_status = 0;
@@ -6302,7 +6382,7 @@ static void bta_dm_gatt_disc_result(tBTA_GATT_ID service_id)
}
} else {
APPL_TRACE_ERROR("%s out of room to accomodate more service ids ble_raw_size = %d ble_raw_used = %d", __FUNCTION__, bta_dm_search_cb.ble_raw_size, bta_dm_search_cb.ble_raw_used );
APPL_TRACE_ERROR("%s out of room to accommodate more service ids ble_raw_size = %d ble_raw_used = %d", __FUNCTION__, bta_dm_search_cb.ble_raw_size, bta_dm_search_cb.ble_raw_used );
}
APPL_TRACE_API("%s service_id_uuid_len=%d ", __func__, service_id.uuid.len);

View File

@@ -202,6 +202,21 @@ void BTA_DmGetDeviceName(tBTA_GET_DEV_NAME_CBACK *p_cback)
}
}
void BTA_DmsendVendorHciCmd(UINT16 opcode, UINT8 param_len, UINT8 *p_param_buf, tBTA_SEND_VENDOR_HCI_CMPL_CBACK p_vendor_cmd_complete_cback)
{
tBTA_DM_API_SEND_VENDOR_HCI_CMD *p_msg;
if ((p_msg = (tBTA_DM_API_SEND_VENDOR_HCI_CMD *)osi_malloc(sizeof(tBTA_DM_API_SEND_VENDOR_HCI_CMD) + param_len)) != NULL) {
p_msg->hdr.event = BTA_DM_API_SEND_VENDOR_HCI_CMD_EVT;
p_msg->opcode = opcode;
p_msg->param_len = param_len;
p_msg->p_param_buf = (UINT8 *)(p_msg + 1);
memcpy(p_msg->p_param_buf, p_param_buf, param_len);
p_msg->vendor_hci_cb = p_vendor_cmd_complete_cback;
bta_sys_sendmsg(p_msg);
}
}
#if (CLASSIC_BT_INCLUDED == TRUE)
void BTA_DmConfigEir(tBTA_DM_EIR_CONF *eir_config)
@@ -847,7 +862,7 @@ void BTA_DmAddDevice(BD_ADDR bd_addr, DEV_CLASS dev_class, LINK_KEY link_key,
**
** Function BTA_DmRemoveDevice
**
** Description This function removes a device fromthe security database list of
** Description This function removes a device from the security database list of
** peer device. It manages unpairing even while connected.
**
**
@@ -1065,7 +1080,7 @@ void BTA_DmAddBleDevice(BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type, int auth_mode
** Description Send BLE SMP passkey reply.
**
** Parameters: bd_addr - BD address of the peer
** accept - passkey entry sucessful or declined.
** accept - passkey entry successful or declined.
** passkey - passkey value, must be a 6 digit number,
** can be lead by 0.
**
@@ -1744,6 +1759,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
/*******************************************************************************
**
@@ -1881,7 +1919,7 @@ void BTA_DmDiscoverExt(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
** p_services: if service is not empty, service discovery will be done.
** for all GATT based service condition, put num_uuid, and
** p_uuid is the pointer to the list of UUID values.
** p_cback: callback functino when search is completed.
** p_cback: callback function when search is completed.
**
**
**
@@ -1969,7 +2007,7 @@ void BTA_DmBleUpdateConnectionParam(BD_ADDR bd_addr, UINT16 min_int,
**
** Description Enable/disable privacy on the local device
**
** Parameters: privacy_enable - enable/disabe privacy on remote device.
** Parameters: privacy_enable - enable/disable privacy on remote device.
**
** Returns void
**
@@ -2021,7 +2059,7 @@ void BTA_DmBleConfigLocalIcon(uint16_t icon)
**
** Function BTA_BleEnableAdvInstance
**
** Description This function enable a Multi-ADV instance with the specififed
** Description This function enable a Multi-ADV instance with the specified
** adv parameters
**
** Parameters p_params: pointer to the adv parameter structure.
@@ -2060,7 +2098,7 @@ void BTA_BleEnableAdvInstance (tBTA_BLE_ADV_PARAMS *p_params,
**
** Function BTA_BleUpdateAdvInstParam
**
** Description This function update a Multi-ADV instance with the specififed
** Description This function update a Multi-ADV instance with the specified
** adv parameters.
**
** Parameters inst_id: Adv instance to update the parameter.
@@ -2091,7 +2129,7 @@ void BTA_BleUpdateAdvInstParam (UINT8 inst_id, tBTA_BLE_ADV_PARAMS *p_params)
**
** Function BTA_BleCfgAdvInstData
**
** Description This function configure a Multi-ADV instance with the specififed
** Description This function configure a Multi-ADV instance with the specified
** adv data or scan response data.
**
** Parameter inst_id: Adv instance to configure the adv data or scan response.
@@ -2478,6 +2516,64 @@ void BTA_DmBleSetDataLength(BD_ADDR remote_device, UINT16 tx_data_length, tBTA_S
}
}
void BTA_DmBleDtmTxStart(uint8_t tx_channel, uint8_t len_of_data, uint8_t pkt_payload, tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback)
{
tBTA_DM_API_BLE_DTM_TX_START *p_msg;
if ((p_msg = (tBTA_DM_API_BLE_DTM_TX_START *)osi_malloc(sizeof(tBTA_DM_API_BLE_DTM_TX_START)))
!= NULL) {
p_msg->hdr.event = BTA_DM_API_DTM_TX_START_EVT;
p_msg->tx_channel = tx_channel;
p_msg->len_of_data = len_of_data;
p_msg->pkt_payload = pkt_payload;
p_msg->p_dtm_cmpl_cback = p_dtm_cmpl_cback;
bta_sys_sendmsg(p_msg);
}
}
void BTA_DmBleDtmRxStart(uint8_t rx_channel, tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback)
{
tBTA_DM_API_BLE_DTM_RX_START *p_msg;
if ((p_msg = (tBTA_DM_API_BLE_DTM_RX_START *)osi_malloc(sizeof(tBTA_DM_API_BLE_DTM_RX_START)))
!= NULL) {
p_msg->hdr.event = BTA_DM_API_DTM_RX_START_EVT;
p_msg->rx_channel= rx_channel;
p_msg->p_dtm_cmpl_cback = p_dtm_cmpl_cback;
bta_sys_sendmsg(p_msg);
}
}
void BTA_DmBleDtmStop(tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback)
{
tBTA_DM_API_BLE_DTM_STOP *p_msg;
if ((p_msg = (tBTA_DM_API_BLE_DTM_STOP *)osi_malloc(sizeof(tBTA_DM_API_BLE_DTM_STOP)))
!= NULL) {
p_msg->hdr.event = BTA_DM_API_DTM_STOP_EVT;
p_msg->p_dtm_cmpl_cback = p_dtm_cmpl_cback;
bta_sys_sendmsg(p_msg);
}
}
void BTA_DmBleSetPrivacyMode(uint8_t addr_type, BD_ADDR addr, uint8_t privacy_mode, tBTA_SET_PRIVACY_MODE_CMPL_CBACK *p_cback)
{
tBTA_DM_API_SET_PRIVACY_MODE *p_msg;
if ((p_msg = (tBTA_DM_API_SET_PRIVACY_MODE *)osi_malloc(sizeof(tBTA_DM_API_SET_PRIVACY_MODE)))
!= NULL) {
p_msg->hdr.event = BTA_DM_API_SET_PRIVACY_MODE_EVT;
p_msg->addr_type = addr_type;
memcpy(p_msg->addr, addr, sizeof(BD_ADDR));
p_msg->privacy_mode = privacy_mode;
p_msg->p_cback = p_cback;
bta_sys_sendmsg(p_msg);
}
}
#endif
/*******************************************************************************
@@ -2491,7 +2587,7 @@ void BTA_DmBleSetDataLength(BD_ADDR remote_device, UINT16 tx_data_length, tBTA_S
**
** Parameters: bd_addr - Address of the peer device
** transport - transport of the link to be encruypted
** p_callback - Pointer to callback function to indicat the
** p_callback - Pointer to callback function to indicate the
** link encryption status
** sec_act - This is the security action to indicate
** what kind of BLE security level is required for
@@ -2671,7 +2767,7 @@ extern void BTA_DmBleStopAdvertising(void)
**
** Description This function set the random address for the APP
**
** Parameters rand_addr: the random address whith should be setting
** Parameters rand_addr: the random address with should be setting
** p_set_rand_addr_cback: complete callback
** Returns void
**
@@ -2687,7 +2783,68 @@ extern void BTA_DmSetRandAddress(BD_ADDR rand_addr, tBTA_SET_RAND_ADDR_CBACK *p_
p_msg->hdr.event = BTA_DM_API_SET_RAND_ADDR_EVT;
p_msg->addr_type = BLE_ADDR_RANDOM;
p_msg->p_set_rand_addr_cback = p_set_rand_addr_cback;
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
}
}
/*******************************************************************************
**
** Function BTA_DmBleSetRpaTimeout
**
** Description This function sets the Resolvable Private Address (RPA) timeout
** for the Bluetooth device. The RPA timeout defines how long an RPA
** remains in use before a new one is generated.
**
** Parameters rpa_timeout: The timeout in seconds within the range of 1s to 1 hour
** as defined by the Bluetooth specification. This duration
** specifies how long the controller uses an RPA before
** generating a new one.
** Returns void
**
**
*******************************************************************************/
void BTA_DmBleSetRpaTimeout(uint16_t rpa_timeout,tBTA_SET_RPA_TIMEOUT_CMPL_CBACK *p_set_rpa_timeout_cback)
{
tBTA_DM_API_SET_RPA_TIMEOUT *p_msg;
if ((p_msg = (tBTA_DM_API_SET_RPA_TIMEOUT *) osi_malloc(sizeof(tBTA_DM_API_SET_RPA_TIMEOUT))) != NULL) {
memset(p_msg, 0, sizeof(tBTA_DM_API_SET_RPA_TIMEOUT));
p_msg->hdr.event = BTA_DM_API_SET_RPA_TIMEOUT_EVT;
p_msg->rpa_timeout = rpa_timeout; // Assign the RPA timeout value to the message
p_msg->p_set_rpa_timeout_cback = p_set_rpa_timeout_cback;
bta_sys_sendmsg(p_msg);
}
}
/*******************************************************************************
**
** Function BTA_DmBleAddDevToResolvingList
**
** Description This function adds a device to the resolving list of the
** Bluetooth controller. The resolving list is used for resolving
** the identity of devices using resolvable private addresses (RPAs).
**
** Parameters addr: Bluetooth device address to be added to the resolving list
** addr_type: Type of the address (public or random)
** irk: Identity Resolving Key (IRK) of the device
** add_dev_to_resolving_list_callback: Callback function to be invoked
** upon completion of the operation
**
** Returns void
**
*******************************************************************************/
void BTA_DmBleAddDevToResolvingList(BD_ADDR addr,
uint8_t addr_type,
PEER_IRK irk,
tBTA_ADD_DEV_TO_RESOLVING_LIST_CMPL_CBACK *add_dev_to_resolving_list_callback)
{
tBTA_DM_API_ADD_DEV_TO_RESOLVING_LIST *p_msg;
if ((p_msg = (tBTA_DM_API_ADD_DEV_TO_RESOLVING_LIST *) osi_malloc(sizeof(tBTA_DM_API_ADD_DEV_TO_RESOLVING_LIST))) != NULL) {
memset(p_msg, 0, sizeof(tBTA_DM_API_ADD_DEV_TO_RESOLVING_LIST));
p_msg->hdr.event = BTA_DM_API_ADD_DEV_TO_RESOLVING_LIST_EVT;
memcpy(p_msg->addr, addr, BD_ADDR_LEN); // Copy the device address to the message
p_msg->addr_type = addr_type; // Assign the address type to the message
memcpy(p_msg->irk, irk, PEER_IRK_LEN); // Copy the IRK to the message
p_msg->p_add_dev_to_resolving_list_callback = add_dev_to_resolving_list_callback;
bta_sys_sendmsg(p_msg);
}
}
@@ -2747,7 +2904,6 @@ void BTA_VendorCleanup (void)
}
#endif
btm_ble_multi_adv_cleanup();
}
#if (BLE_50_FEATURE_SUPPORT == TRUE)
void BTA_DmBleGapReadPHY(BD_ADDR addr)
@@ -2758,7 +2914,7 @@ void BTA_DmBleGapReadPHY(BD_ADDR addr)
memset(p_msg, 0, sizeof(tBTA_DM_API_READ_PHY));
p_msg->hdr.event = BTA_DM_API_READ_PHY_EVT;
memcpy(p_msg->bd_addr, addr, BD_ADDR_LEN);
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -2770,13 +2926,13 @@ void BTA_DmBleGapSetPreferedDefaultPHY(tBTA_DM_BLE_GAP_PHY_MASK tx_phy_mask,
tBTA_DM_BLE_GAP_PHY_MASK rx_phy_mask)
{
tBTA_DM_API_SET_PER_DEF_PHY *p_msg;
APPL_TRACE_API("%s, Set prefered default phy.", __func__);
APPL_TRACE_API("%s, Set preferred default phy.", __func__);
if ((p_msg = (tBTA_DM_API_SET_PER_DEF_PHY *) osi_malloc(sizeof(tBTA_DM_API_SET_PER_DEF_PHY))) != NULL) {
memset(p_msg, 0, sizeof(tBTA_DM_API_SET_PER_DEF_PHY));
p_msg->hdr.event = BTA_DM_API_SET_PER_DEF_PHY_EVT;
p_msg->tx_phy_mask = tx_phy_mask;
p_msg->rx_phy_mask = rx_phy_mask;
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -2791,7 +2947,7 @@ void BTA_DmBleGapSetPreferedPHY(BD_ADDR addr,
UINT16 phy_options)
{
tBTA_DM_API_SET_PER_PHY *p_msg;
APPL_TRACE_API("%s, Set prefered phy.", __func__);
APPL_TRACE_API("%s, Set preferred phy.", __func__);
if ((p_msg = (tBTA_DM_API_SET_PER_PHY *) osi_malloc(sizeof(tBTA_DM_API_SET_PER_PHY))) != NULL) {
memset(p_msg, 0, sizeof(tBTA_DM_API_SET_PER_PHY));
p_msg->hdr.event = BTA_DM_API_SET_PER_PHY_EVT;
@@ -2800,7 +2956,7 @@ void BTA_DmBleGapSetPreferedPHY(BD_ADDR addr,
p_msg->tx_phy_mask = tx_phy_mask;
p_msg->rx_phy_mask = rx_phy_mask;
p_msg->phy_options = phy_options;
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -2816,7 +2972,7 @@ void BTA_DmBleGapExtAdvSetRandaddr(UINT16 instance, BD_ADDR addr)
p_msg->hdr.event = BTA_DM_API_SET_EXT_ADV_RAND_ADDR_EVT;
p_msg->instance = instance;
memcpy(&p_msg->rand_addr, addr, BD_ADDR_LEN);
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -2834,7 +2990,7 @@ void BTA_DmBleGapExtAdvSetParams(UINT16 instance,
p_msg->hdr.event = BTA_DM_API_SET_EXT_ADV_PARAMS_EVT;
p_msg->instance = instance;
memcpy(&p_msg->params, params, sizeof(tBTA_DM_BLE_GAP_EXT_ADV_PARAMS));
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -2857,7 +3013,7 @@ void BTA_DmBleGapConfigExtAdvDataRaw(BOOLEAN is_scan_rsp, UINT8 instance, UINT16
if (data) {
memcpy(p_msg->data, data, length);
}
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -2877,7 +3033,7 @@ void BTA_DmBleGapExtAdvEnable(BOOLEAN enable, UINT8 num, tBTA_DM_BLE_EXT_ADV *ex
if (ext_adv) {
memcpy(p_msg->ext_adv, ext_adv, sizeof(tBTA_DM_BLE_EXT_ADV)*num);
}
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -2892,7 +3048,7 @@ void BTA_DmBleGapExtAdvSetRemove(UINT8 instance)
memset(p_msg, 0, sizeof(tBTA_DM_API_BLE_EXT_ADV_SET_REMOVE));
p_msg->hdr.event = BTA_DM_API_EXT_ADV_SET_REMOVE_EVT;
p_msg->instance = instance;
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -2906,7 +3062,7 @@ void BTA_DmBleGapExtAdvSetClear(void)
if ((p_msg = (tBTA_DM_API_BLE_EXT_ADV_SET_CLEAR *) osi_malloc(sizeof(tBTA_DM_API_BLE_EXT_ADV_SET_CLEAR))) != NULL) {
memset(p_msg, 0, sizeof(tBTA_DM_API_BLE_EXT_ADV_SET_CLEAR));
p_msg->hdr.event = BTA_DM_API_EXT_ADV_SET_CLEAR_EVT;
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -2923,7 +3079,7 @@ void BTA_DmBleGapPeriodicAdvSetParams(UINT8 instance,
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_SET_PARAMS_EVT;
p_msg->instance = instance;
memcpy(&p_msg->params, params, sizeof(tBTA_DM_BLE_Periodic_Adv_Params));
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -2945,7 +3101,7 @@ void BTA_DmBleGapPeriodicAdvCfgDataRaw(UINT8 instance, UINT16 length,
memcpy(p_msg->data, data, length);
p_msg->data = length != 0 ? (UINT8 *)(p_msg + 1) : NULL;
p_msg->only_update_did = only_update_did;
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -2962,7 +3118,7 @@ void BTA_DmBleGapPeriodicAdvEnable(UINT8 enable, UINT8 instance)
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_ENABLE_EVT;
p_msg->instance = instance;
p_msg->enable = enable;
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -2978,7 +3134,7 @@ void BTA_DmBleGapPeriodicAdvCreateSync(tBTA_DM_BLE_Periodic_Sync_Params *params)
memset(p_msg, 0, sizeof(tBTA_DM_API_PERIODIC_ADV_SYNC));
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_SYNC_EVT;
memcpy(&p_msg->params, params, sizeof(tBTA_DM_BLE_Periodic_Sync_Params));
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -2993,7 +3149,7 @@ void BTA_DmBleGapPeriodicAdvSyncCancel(void)
if ((p_msg = (tBTA_DM_API_PERIODIC_ADV_SYNC_CANCEL *) osi_malloc(sizeof(tBTA_DM_API_PERIODIC_ADV_SYNC_CANCEL))) != NULL) {
memset(p_msg, 0, sizeof(tBTA_DM_API_PERIODIC_ADV_SYNC_CANCEL));
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_SYNC_CANCEL_EVT;
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -3009,7 +3165,7 @@ void BTA_DmBleGapPeriodicAdvSyncTerm(UINT16 sync_handle)
memset(p_msg, 0, sizeof(tBTA_DM_API_PERIODIC_ADV_SYNC_TERM));
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_SYNC_TERMINATE_EVT;
p_msg->sync_handle = sync_handle;
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -3029,7 +3185,7 @@ void BTA_DmBleGapPeriodicAdvAddDevToList(tBLE_ADDR_TYPE addr_type,
p_msg->addr_type = addr_type;
p_msg->sid = sid;
memcpy(p_msg->addr, addr, sizeof(BD_ADDR));
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -3049,7 +3205,7 @@ void BTA_DmBleGapPeriodicAdvRemoveDevFromList(tBLE_ADDR_TYPE addr_type,
p_msg->addr_type = addr_type;
p_msg->sid = sid;
memcpy(p_msg->addr, addr, sizeof(BD_ADDR));
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -3064,7 +3220,7 @@ void BTA_DmBleGapPeriodicAdvClearDev(void)
if ((p_msg = (tBTA_DM_API_PERIODIC_ADV_DEV_CLEAR *) osi_malloc(sizeof(tBTA_DM_API_PERIODIC_ADV_DEV_CLEAR))) != NULL) {
memset(p_msg, 0, sizeof(tBTA_DM_API_PERIODIC_ADV_DEV_CLEAR));
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_CLEAR_DEV_EVT;
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -3080,7 +3236,7 @@ void BTA_DmBleGapSetExtScanParams(tBTA_DM_BLE_EXT_SCAN_PARAMS *params)
memset(p_msg, 0, sizeof(tBTA_DM_API_SET_EXT_SCAN_PARAMS));
p_msg->hdr.event = BTA_DM_API_SET_EXT_SCAN_PARAMS_EVT;
memcpy(&p_msg->params, params, sizeof(tBTA_DM_BLE_EXT_SCAN_PARAMS));
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -3098,7 +3254,7 @@ void BTA_DmBleGapExtScan(BOOLEAN start, UINT32 duration, UINT16 period)
p_msg->start = start;
p_msg->duration = duration;
p_msg->period = period;
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -3132,7 +3288,7 @@ void BTA_DmBleGapPreferExtConnectParamsSet(BD_ADDR bd_addr,
if (phy_coded_conn_params) {
memcpy(&p_msg->phy_coded_conn_params, phy_coded_conn_params, sizeof(tBTA_DM_BLE_CONN_PARAMS));
}
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -3151,7 +3307,7 @@ void BTA_DmBleGapExtConnect(tBLE_ADDR_TYPE own_addr_type, const BD_ADDR peer_add
p_msg->hdr.event = BTA_DM_API_EXT_CONN_EVT;
p_msg->own_addr_type = own_addr_type;
memcpy(p_msg->peer_addr, peer_addr, sizeof(BD_ADDR));
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -3159,6 +3315,39 @@ void BTA_DmBleGapExtConnect(tBLE_ADDR_TYPE own_addr_type, const BD_ADDR peer_add
}
void BTA_DmBleDtmEnhTxStart(uint8_t tx_channel, uint8_t len_of_data, uint8_t pkt_payload, uint8_t phy, tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback)
{
tBTA_DM_API_BLE_DTM_ENH_TX_START *p_msg;
if ((p_msg = (tBTA_DM_API_BLE_DTM_ENH_TX_START *)osi_malloc(sizeof(tBTA_DM_API_BLE_DTM_ENH_TX_START)))
!= NULL) {
p_msg->hdr.event = BTA_DM_API_DTM_ENH_TX_START_EVT;
p_msg->tx_channel = tx_channel;
p_msg->len_of_data = len_of_data;
p_msg->pkt_payload = pkt_payload;
p_msg->phy = phy;
p_msg->p_dtm_cmpl_cback = p_dtm_cmpl_cback;
bta_sys_sendmsg(p_msg);
}
}
void BTA_DmBleDtmEnhRxStart(uint8_t rx_channel, uint8_t phy, uint8_t modulation_index, tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback)
{
tBTA_DM_API_BLE_DTM_ENH_RX_START *p_msg;
if ((p_msg = (tBTA_DM_API_BLE_DTM_ENH_RX_START *)osi_malloc(sizeof(tBTA_DM_API_BLE_DTM_ENH_RX_START)))
!= NULL) {
p_msg->hdr.event = BTA_DM_API_DTM_ENH_RX_START_EVT;
p_msg->rx_channel= rx_channel;
p_msg->phy = phy;
p_msg->modulation_index = modulation_index;
p_msg->p_dtm_cmpl_cback = p_dtm_cmpl_cback;
bta_sys_sendmsg(p_msg);
}
}
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
@@ -3171,7 +3360,7 @@ void BTA_DmBleGapPeriodicAdvRecvEnable(UINT16 sync_handle, UINT8 enable)
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_RECV_ENABLE_EVT;
p_msg->sync_handle = sync_handle;
p_msg->enable = enable;
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -3188,7 +3377,7 @@ void BTA_DmBleGapPeriodicAdvSyncTrans(BD_ADDR peer_addr, UINT16 service_data, UI
memcpy(p_msg->addr, peer_addr, sizeof(BD_ADDR));
p_msg->service_data = service_data;
p_msg->sync_handle = sync_handle;
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -3205,7 +3394,7 @@ void BTA_DmBleGapPeriodicAdvSetInfoTrans(BD_ADDR peer_addr, UINT16 service_data,
memcpy(p_msg->addr, peer_addr, sizeof(BD_ADDR));
p_msg->service_data = service_data;
p_msg->adv_hanlde = adv_handle;
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);
@@ -3221,7 +3410,7 @@ void BTA_DmBleGapSetPeriodicAdvSyncTransParams(BD_ADDR peer_addr, tBTA_DM_BLE_PA
p_msg->hdr.event = BTA_DM_API_SET_PERIODIC_ADV_SYNC_TRANS_PARAMS_EVT;
memcpy(p_msg->addr, peer_addr, sizeof(BD_ADDR));
memcpy(&p_msg->params, params, sizeof(tBTA_DM_BLE_PAST_PARAMS));
//start sent the msg to the bta system control moudle
//start sent the msg to the bta system control module
bta_sys_sendmsg(p_msg);
} else {
APPL_TRACE_ERROR("%s malloc failed", __func__);

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

@@ -58,6 +58,7 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
bta_dm_disable, /* BTA_DM_API_DISABLE_EVT */
bta_dm_set_dev_name, /* BTA_DM_API_SET_NAME_EVT */
bta_dm_get_dev_name, /* BTA_DM_API_GET_NAME_EVT */
bta_dm_send_vendor_hci, /* BTA_DM_API_SEND_VENDOR_HCI_CMD_EVT */
#if (CLASSIC_BT_INCLUDED == TRUE)
bta_dm_config_eir, /* BTA_DM_API_CONFIG_EIR_EVT */
#endif
@@ -202,6 +203,8 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
bta_dm_ble_gap_ext_scan, /* BTA_DM_API_START_EXT_SCAN_EVT */
bta_dm_ble_gap_set_prefer_ext_conn_params, /* BTA_DM_API_SET_PERF_EXT_CONN_PARAMS_EVT */
NULL, /* BTA_DM_API_EXT_CONN_EVT */
bta_dm_ble_gap_dtm_enhance_tx_start, /* BTA_DM_API_DTM_ENH_TX_START_EVT */
bta_dm_ble_gap_dtm_enhance_rx_start, /* BTA_DM_API_DTM_ENH_RX_START_EVT */
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
bta_dm_ble_gap_periodic_adv_recv_enable, /* BTA_DM_API_PERIODIC_ADV_RECV_ENABLE_EVT */
@@ -209,6 +212,15 @@ 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_dtm_tx_start, /* BTA_DM_API_DTM_TX_START_EVT */
bta_dm_ble_gap_dtm_rx_start, /* BTA_DM_API_DTM_RX_START_EVT */
bta_dm_ble_gap_dtm_stop, /* BTA_DM_API_DTM_STOP_EVT */
bta_dm_ble_gap_clear_adv, /* BTA_DM_API_BLE_CLEAR_ADV_EVT */
bta_dm_ble_gap_set_rpa_timeout, /* BTA_DM_API_SET_RPA_TIMEOUT_EVT */
bta_dm_ble_gap_add_dev_to_resolving_list, /* BTA_DM_API_ADD_DEV_TO_RESOLVING_LIST_EVT */
bta_dm_ble_gap_set_privacy_mode, /* BTA_DM_API_SET_PRIVACY_MODE_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

@@ -54,6 +54,7 @@ enum {
BTA_DM_API_DISABLE_EVT,
BTA_DM_API_SET_NAME_EVT,
BTA_DM_API_GET_NAME_EVT,
BTA_DM_API_SEND_VENDOR_HCI_CMD_EVT,
#if (CLASSIC_BT_INCLUDED == TRUE)
BTA_DM_API_CONFIG_EIR_EVT,
#endif
@@ -74,7 +75,7 @@ enum {
BTA_DM_API_PIN_REPLY_EVT,
#endif ///SMP_INCLUDED == TRUE
#if (BTA_DM_PM_INCLUDED == TRUE)
/* power manger events */
/* power manager events */
BTA_DM_PM_BTM_STATUS_EVT,
BTA_DM_PM_TIMER_EVT,
#endif /* #if (BTA_DM_PM_INCLUDED == TRUE) */
@@ -199,6 +200,8 @@ enum {
BTA_DM_API_START_EXT_SCAN_EVT,
BTA_DM_API_SET_PERF_EXT_CONN_PARAMS_EVT,
BTA_DM_API_EXT_CONN_EVT,
BTA_DM_API_DTM_ENH_TX_START_EVT,
BTA_DM_API_DTM_ENH_RX_START_EVT,
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
BTA_DM_API_PERIODIC_ADV_RECV_ENABLE_EVT,
@@ -206,6 +209,15 @@ 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_DTM_TX_START_EVT,
BTA_DM_API_DTM_RX_START_EVT,
BTA_DM_API_DTM_STOP_EVT,
BTA_DM_API_BLE_CLEAR_ADV_EVT,
BTA_DM_API_SET_RPA_TIMEOUT_EVT,
BTA_DM_API_ADD_DEV_TO_RESOLVING_LIST_EVT,
BTA_DM_API_SET_PRIVACY_MODE_EVT,
#endif
BTA_DM_MAX_EVT
};
@@ -242,6 +254,14 @@ typedef struct {
tBTA_GET_DEV_NAME_CBACK *p_cback;
} tBTA_DM_API_GET_NAME;
typedef struct {
BT_HDR hdr;
UINT16 opcode;
UINT8 param_len;
UINT8 *p_param_buf;
tBTA_SEND_VENDOR_HCI_CMPL_CBACK *vendor_hci_cb;
}tBTA_DM_API_SEND_VENDOR_HCI_CMD;
/* data type for BTA_DM_API_CONFIG_EIR_EVT */
typedef struct {
BT_HDR hdr;
@@ -615,7 +635,7 @@ typedef struct {
tBTA_DM_BLE_SEL_CBACK *p_select_cback;
} tBTA_DM_API_BLE_SET_BG_CONN_TYPE;
/* set prefered BLE connection parameters for a device */
/* set preferred BLE connection parameters for a device */
typedef struct {
BT_HDR hdr;
BD_ADDR peer_bda;
@@ -716,6 +736,20 @@ typedef struct {
BT_HDR hdr;
} tBTA_DM_APT_CLEAR_ADDR;
typedef struct {
BT_HDR hdr;
UINT16 rpa_timeout;
tBTA_SET_RPA_TIMEOUT_CMPL_CBACK *p_set_rpa_timeout_cback;
} tBTA_DM_API_SET_RPA_TIMEOUT;
typedef struct {
BT_HDR hdr; // Event header
esp_bd_addr_t addr; // Bluetooth device address
UINT8 addr_type; // Type of the address
UINT8 irk[PEER_IRK_LEN]; // Identity Resolving Key (IRK)
tBTA_ADD_DEV_TO_RESOLVING_LIST_CMPL_CBACK *p_add_dev_to_resolving_list_callback; // Callback function pointer
} tBTA_DM_API_ADD_DEV_TO_RESOLVING_LIST;
/* set adv parameter for BLE advertising */
typedef struct {
BT_HDR hdr;
@@ -842,6 +876,38 @@ typedef struct {
BD_ADDR remote_bda;
} tBTA_DM_API_BLE_DISCONNECT;
typedef struct {
BT_HDR hdr;
UINT8 tx_channel;
UINT8 len_of_data;
UINT8 pkt_payload;
tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback;
} tBTA_DM_API_BLE_DTM_TX_START;
typedef struct {
BT_HDR hdr;
UINT8 rx_channel;
tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback;
} tBTA_DM_API_BLE_DTM_RX_START;
typedef struct {
BT_HDR hdr;
tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback;
} tBTA_DM_API_BLE_DTM_STOP;
typedef struct {
BT_HDR hdr;
tBTA_CLEAR_ADV_CMPL_CBACK *p_clear_adv_cback;
} tBTA_DM_API_CLEAR_ADV;
typedef struct {
BT_HDR hdr;
tBLE_ADDR_TYPE addr_type;
BD_ADDR addr;
UINT8 privacy_mode;
tBTA_SET_PRIVACY_MODE_CMPL_CBACK *p_cback;
} tBTA_DM_API_SET_PRIVACY_MODE;
#endif /* BLE_INCLUDED */
/* data type for BTA_DM_API_REMOVE_ACL_EVT */
@@ -898,6 +964,22 @@ typedef struct {
#endif
#if (BLE_50_FEATURE_SUPPORT == TRUE)
typedef struct {
BT_HDR hdr;
UINT8 tx_channel;
UINT8 len_of_data;
UINT8 pkt_payload;
UINT8 phy;
tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback;
} tBTA_DM_API_BLE_DTM_ENH_TX_START;
typedef struct {
BT_HDR hdr;
UINT8 rx_channel;
UINT8 phy;
UINT8 modulation_index;
tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback;
} tBTA_DM_API_BLE_DTM_ENH_RX_START;
#define BTA_PHY_1M_MASK (1 << 0)
#define BTA_PHY_2M_MASK (1 << 1)
#define BTAS_PHY_CODED_MASK (1 << 2)
@@ -1074,6 +1156,7 @@ typedef union {
tBTA_DM_API_SET_NAME set_name;
tBTA_DM_API_GET_NAME get_name;
tBTA_DM_API_SEND_VENDOR_HCI_CMD vendor_hci_cmd;
tBTA_DM_API_CONFIG_EIR config_eir;
tBTA_DM_API_SET_AFH_CHANNELS set_afh_channels;
@@ -1170,6 +1253,8 @@ typedef union {
tBTA_DM_API_BLE_SET_DATA_LENGTH ble_set_data_length;
tBTA_DM_APT_SET_DEV_ADDR set_addr;
tBTA_DM_APT_CLEAR_ADDR clear_addr;
tBTA_DM_API_SET_RPA_TIMEOUT set_rpa_timeout;
tBTA_DM_API_ADD_DEV_TO_RESOLVING_LIST add_dev_to_resolving_list;
tBTA_DM_API_BLE_MULTI_ADV_ENB ble_multi_adv_enb;
tBTA_DM_API_BLE_MULTI_ADV_PARAM ble_multi_adv_param;
tBTA_DM_API_BLE_MULTI_ADV_DATA ble_multi_adv_data;
@@ -1205,6 +1290,8 @@ typedef union {
tBTA_DM_API_SET_EXT_SCAN_PARAMS ble_set_ext_scan_params;
tBTA_DM_API_EXT_SCAN ble_ext_scan;
tBTA_DM_API_SET_PER_EXT_CONN_PARAMS ble_set_per_ext_conn_params;
tBTA_DM_API_BLE_DTM_ENH_TX_START dtm_enh_tx_start;
tBTA_DM_API_BLE_DTM_ENH_RX_START dtm_enh_rx_start;
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
tBTA_DM_API_PERIODIC_ADV_RECV_ENABLE ble_periodic_adv_recv_enable;
@@ -1212,6 +1299,12 @@ 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_BLE_DTM_TX_START dtm_tx_start;
tBTA_DM_API_BLE_DTM_RX_START dtm_rx_start;
tBTA_DM_API_BLE_DTM_STOP dtm_stop;
tBTA_DM_API_CLEAR_ADV ble_clear_adv;
tBTA_DM_API_SET_PRIVACY_MODE ble_set_privacy_mode;
#endif
tBTA_DM_API_REMOVE_ACL remove_acl;
@@ -1346,7 +1439,7 @@ typedef struct {
UINT32 role_policy_mask; /* the bits set indicates the modules that wants to remove role switch from the default link policy */
UINT16 cur_policy; /* current default link policy */
UINT16 rs_event; /* the event waiting for role switch */
UINT8 cur_av_count; /* current AV connecions */
UINT8 cur_av_count; /* current AV connections */
BOOLEAN disable_pair_mode; /* disable pair mode or not */
BOOLEAN conn_paired_only; /* allow connectable to paired device only or not */
tBTA_DM_API_SEARCH search_msg;
@@ -1575,6 +1668,7 @@ extern void bta_dm_enable (tBTA_DM_MSG *p_data);
extern void bta_dm_disable (tBTA_DM_MSG *p_data);
extern void bta_dm_set_dev_name (tBTA_DM_MSG *p_data);
extern void bta_dm_get_dev_name (tBTA_DM_MSG *p_data);
extern void bta_dm_send_vendor_hci(tBTA_DM_MSG *p_data);
#if (CLASSIC_BT_INCLUDED == TRUE)
extern void bta_dm_config_eir (tBTA_DM_MSG *p_data);
#endif
@@ -1643,7 +1737,16 @@ 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_dtm_tx_start(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_gap_dtm_rx_start(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_gap_dtm_stop(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_gap_clear_adv(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_gap_set_rpa_timeout(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_gap_add_dev_to_resolving_list(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_gap_set_privacy_mode(tBTA_DM_MSG *p_data);
#if (BLE_50_FEATURE_SUPPORT == TRUE)
extern void bta_dm_ble_gap_dtm_enhance_tx_start(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_gap_dtm_enhance_rx_start(tBTA_DM_MSG *p_data);
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);
extern void bta_dm_ble_gap_set_prefer_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 {

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