forked from espressif/esp-idf
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f89d6ee5a0 | ||
|
|
f019c5d549 | ||
|
|
7023b489a7 | ||
|
|
236200a93f |
@@ -1,4 +1,4 @@
|
||||
[codespell]
|
||||
skip = build,*.yuv,components/fatfs/src/*,alice.txt,*.rgb,components/wpa_supplicant/*,components/esp_wifi/*,*.pem,components/newlib/COPYING.*
|
||||
skip = build,*.yuv,components/fatfs/src/*,alice.txt,*.rgb,components/wpa_supplicant/*,components/esp_wifi/*,*.pem,components/newlib/COPYING.*,docs/sphinx-known-warnings.txt
|
||||
ignore-words-list = ser,dout,rsource,fram,inout,shs,ans,aci,unstall,unstalling,hart,wheight,wel,ot,fane,assertIn,registr,oen,parms
|
||||
write-changes = true
|
||||
|
||||
11
.github/workflows/release_zips.yml
vendored
11
.github/workflows/release_zips.yml
vendored
@@ -8,11 +8,10 @@ on:
|
||||
jobs:
|
||||
release_zips:
|
||||
name: Create release zip file
|
||||
runs-on: ubuntu-24.04
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Create a recursive clone source zip
|
||||
uses: espressif/release-zips-action@v1
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
release_project_name: ESP-IDF
|
||||
git_extra_args: --shallow-since="1 year ago"
|
||||
uses: espressif/github-actions/release_zips@master
|
||||
env:
|
||||
RELEASE_PROJECT_NAME: ESP-IDF
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -2,5 +2,253 @@
|
||||
#
|
||||
# https://docs.gitlab.com/ee/user/project/code_owners.html#the-syntax-of-code-owners-files
|
||||
#
|
||||
# If more than one rule matches a given file, the latest rule is used.
|
||||
# The file should be generally kept sorted, except when it is necessary
|
||||
# to use a different order due to the fact above. In that case, use
|
||||
# '# sort-order-reset' comment line to reset the sort order.
|
||||
#
|
||||
# Recipes for a few common cases:
|
||||
#
|
||||
# 1. Specific directory with all its contents:
|
||||
#
|
||||
# /components/app_trace/
|
||||
#
|
||||
# Note the trailing slash!
|
||||
#
|
||||
# 2. File with certain extension in any subdirectory of a certain directory:
|
||||
#
|
||||
# /examples/**/*.py
|
||||
#
|
||||
# This includes an *.py files in /examples/ directory as well.
|
||||
#
|
||||
# 3. Contents of a directory with a certain name, anywhere in the tree:
|
||||
#
|
||||
# test_*_host/
|
||||
#
|
||||
# Will match everything under components/efuse/test_efuse_host/,
|
||||
# components/heap/test_multi_heap_host/, components/lwip/test_afl_host/, etc.
|
||||
#
|
||||
# 4. Same as above, except limited to a specific place in the tree:
|
||||
#
|
||||
# /components/esp32*/
|
||||
#
|
||||
# Matches everything under /components/esp32, /components/esp32s2, etc.
|
||||
# Doesn't match /tools/some-test/components/esp32s5.
|
||||
#
|
||||
# 5. Specific file:
|
||||
#
|
||||
# /tools/tools.json
|
||||
#
|
||||
# 6. File with a certain name anywhere in the tree
|
||||
#
|
||||
# .gitignore
|
||||
#
|
||||
|
||||
* @esp-idf-codeowners/all-maintainers
|
||||
* @esp-idf-codeowners/other
|
||||
|
||||
/.* @esp-idf-codeowners/tools
|
||||
/.codespellrc @esp-idf-codeowners/ci
|
||||
/.github/workflows/ @esp-idf-codeowners/ci
|
||||
/.gitlab-ci.yml @esp-idf-codeowners/ci
|
||||
/.gitlab/ci/ @esp-idf-codeowners/ci
|
||||
/.pre-commit-config.yaml @esp-idf-codeowners/ci
|
||||
/.readthedocs.yml @esp-idf-codeowners/docs
|
||||
/.vale.ini @esp-idf-codeowners/docs
|
||||
/CMakeLists.txt @esp-idf-codeowners/build-config
|
||||
/COMPATIBILITY*.md @esp-idf-codeowners/peripherals
|
||||
/CONTRIBUTING.md @esp-idf-codeowners/docs
|
||||
/Kconfig @esp-idf-codeowners/build-config
|
||||
/README*.md @esp-idf-codeowners/docs
|
||||
/ROADMAP*.md @esp-idf-codeowners/docs
|
||||
/SUPPORT_POLICY*.md @esp-idf-codeowners/docs
|
||||
/add_path.sh @esp-idf-codeowners/tools
|
||||
/conftest.py @esp-idf-codeowners/ci
|
||||
/export.* @esp-idf-codeowners/tools
|
||||
/install.* @esp-idf-codeowners/tools
|
||||
/pytest.ini @esp-idf-codeowners/ci
|
||||
/ruff.toml @esp-idf-codeowners/tools
|
||||
/sdkconfig.rename @esp-idf-codeowners/build-config
|
||||
/sonar-project.properties @esp-idf-codeowners/ci
|
||||
|
||||
# sort-order-reset
|
||||
|
||||
/components/app_trace/ @esp-idf-codeowners/debugging
|
||||
/components/app_update/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
|
||||
/components/bootloader*/ @esp-idf-codeowners/system @esp-idf-codeowners/security
|
||||
/components/bootloader_support/bootloader_flash/ @esp-idf-codeowners/peripherals
|
||||
/components/bt/ @esp-idf-codeowners/bluetooth
|
||||
/components/cmock/ @esp-idf-codeowners/system
|
||||
/components/console/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities/console
|
||||
/components/cxx/ @esp-idf-codeowners/system
|
||||
/components/driver/ @esp-idf-codeowners/peripherals
|
||||
/components/efuse/ @esp-idf-codeowners/system
|
||||
/components/esp_adc/ @esp-idf-codeowners/peripherals
|
||||
/components/esp_app_format/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
|
||||
/components/esp_bootloader_format/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
|
||||
/components/esp_coex/ @esp-idf-codeowners/wifi @esp-idf-codeowners/bluetooth @esp-idf-codeowners/ieee802154
|
||||
/components/esp_common/ @esp-idf-codeowners/system
|
||||
/components/esp_driver_*/ @esp-idf-codeowners/peripherals
|
||||
/components/esp_driver_sdmmc/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/storage
|
||||
/components/esp_eth/ @esp-idf-codeowners/network
|
||||
/components/esp_event/ @esp-idf-codeowners/system
|
||||
/components/esp_gdbstub/ @esp-idf-codeowners/debugging
|
||||
/components/esp_hid/ @esp-idf-codeowners/bluetooth
|
||||
/components/esp_http_client/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_http_server/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_https_ota/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_https_server/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_hw_support/ @esp-idf-codeowners/system @esp-idf-codeowners/peripherals
|
||||
/components/esp_hw_support/lowpower/ @esp-idf-codeowners/power-management
|
||||
/components/esp_lcd/ @esp-idf-codeowners/peripherals
|
||||
/components/esp_local_ctrl/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_mm/ @esp-idf-codeowners/peripherals
|
||||
/components/esp_netif/ @esp-idf-codeowners/network
|
||||
/components/esp_netif_stack/ @esp-idf-codeowners/network
|
||||
/components/esp_partition/ @esp-idf-codeowners/storage
|
||||
/components/esp_phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
|
||||
/components/esp_pm/ @esp-idf-codeowners/power-management @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/system
|
||||
/components/esp_psram/ @esp-idf-codeowners/peripherals
|
||||
/components/esp_psram/system_layer/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
|
||||
/components/esp_ringbuf/ @esp-idf-codeowners/system
|
||||
/components/esp_rom/ @esp-idf-codeowners/system @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi
|
||||
/components/esp_security/ @esp-idf-codeowners/security
|
||||
/components/esp_system/ @esp-idf-codeowners/system
|
||||
/components/esp_tee/ @esp-idf-codeowners/security
|
||||
/components/esp_timer/ @esp-idf-codeowners/system
|
||||
/components/esp-tls/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_vfs_*/ @esp-idf-codeowners/storage
|
||||
/components/esp_vfs_console/ @esp-idf-codeowners/storage @esp-idf-codeowners/system
|
||||
/components/esp_wifi/ @esp-idf-codeowners/wifi
|
||||
/components/espcoredump/ @esp-idf-codeowners/debugging
|
||||
/components/esptool_py/ @esp-idf-codeowners/tools
|
||||
/components/fatfs/ @esp-idf-codeowners/storage
|
||||
/components/freertos/ @esp-idf-codeowners/system
|
||||
/components/hal/ @esp-idf-codeowners/peripherals
|
||||
/components/hal/test_apps/crypto/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/security
|
||||
/components/heap/ @esp-idf-codeowners/system
|
||||
/components/http_parser/ @esp-idf-codeowners/app-utilities
|
||||
/components/idf_test/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
|
||||
/components/ieee802154/ @esp-idf-codeowners/ieee802154
|
||||
/components/json/ @esp-idf-codeowners/app-utilities
|
||||
/components/linux/ @esp-idf-codeowners/system
|
||||
/components/log/ @esp-idf-codeowners/system
|
||||
/components/lwip/ @esp-idf-codeowners/lwip
|
||||
/components/mbedtls/ @esp-idf-codeowners/app-utilities/mbedtls @esp-idf-codeowners/security
|
||||
/components/mqtt/ @esp-idf-codeowners/network
|
||||
/components/newlib/ @esp-idf-codeowners/system @esp-idf-codeowners/toolchain
|
||||
/components/nvs_flash/ @esp-idf-codeowners/storage
|
||||
/components/nvs_sec_provider/ @esp-idf-codeowners/storage @esp-idf-codeowners/security
|
||||
/components/openthread/ @esp-idf-codeowners/ieee802154
|
||||
/components/partition_table/ @esp-idf-codeowners/system
|
||||
/components/perfmon/ @esp-idf-codeowners/debugging
|
||||
/components/protobuf-c/ @esp-idf-codeowners/app-utilities
|
||||
/components/protocomm/ @esp-idf-codeowners/app-utilities/provisioning
|
||||
/components/pthread/ @esp-idf-codeowners/system
|
||||
/components/riscv/ @esp-idf-codeowners/system
|
||||
/components/rt/ @esp-idf-codeowners/system
|
||||
/components/sdmmc/ @esp-idf-codeowners/storage
|
||||
/components/soc/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
|
||||
/components/spi_flash/ @esp-idf-codeowners/peripherals
|
||||
/components/spiffs/ @esp-idf-codeowners/storage
|
||||
/components/tcp_transport/ @esp-idf-codeowners/network
|
||||
/components/touch_element/ @esp-idf-codeowners/peripherals
|
||||
/components/ulp/ @esp-idf-codeowners/system
|
||||
/components/unity/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
|
||||
/components/usb/ @esp-idf-codeowners/peripherals/usb
|
||||
/components/vfs/ @esp-idf-codeowners/storage
|
||||
/components/wear_levelling/ @esp-idf-codeowners/storage
|
||||
/components/wifi_provisioning/ @esp-idf-codeowners/app-utilities/provisioning
|
||||
/components/wpa_supplicant/ @esp-idf-codeowners/wifi @esp-idf-codeowners/app-utilities/mbedtls
|
||||
/components/xtensa/ @esp-idf-codeowners/system
|
||||
|
||||
/docs/ @esp-idf-codeowners/docs
|
||||
/docs/docs_not_updated/ @esp-idf-codeowners/all-maintainers
|
||||
/docs/**/api-guides/tools/ @esp-idf-codeowners/tools
|
||||
/docs/en/api-guides/core_dump.rst @esp-idf-codeowners/debugging
|
||||
/docs/**/api-guides/wifi* @esp-idf-codeowners/wifi
|
||||
/docs/**/api-guides/esp-wifi-mesh.rst @esp-idf-codeowners/wifi
|
||||
/docs/en/api-guides/jtag-debugging/ @esp-idf-codeowners/debugging
|
||||
/docs/**/api-reference/bluetooth/ @esp-idf-codeowners/bluetooth
|
||||
/docs/**/api-reference/network/ @esp-idf-codeowners/network @esp-idf-codeowners/wifi
|
||||
/docs/**/api-reference/peripherals/ @esp-idf-codeowners/peripherals
|
||||
/docs/**/api-reference/peripherals/usb* @esp-idf-codeowners/peripherals @esp-idf-codeowners/peripherals/usb
|
||||
/docs/**/api-reference/peripherals/usb*/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/peripherals/usb
|
||||
/docs/**/api-reference/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
|
||||
/docs/**/api-reference/provisioning/ @esp-idf-codeowners/app-utilities/provisioning
|
||||
/docs/**/api-reference/storage/ @esp-idf-codeowners/storage
|
||||
/docs/**/api-reference/system/ @esp-idf-codeowners/system
|
||||
/docs/**/security/ @esp-idf-codeowners/security
|
||||
/docs/**/migration-guides/ @esp-idf-codeowners/docs @esp-idf-codeowners/all-maintainers
|
||||
/docs/**/contribute/install-pre-commit-hook.rst @esp-idf-codeowners/ci @esp-idf-codeowners/tools
|
||||
|
||||
/examples/README.md @esp-idf-codeowners/docs @esp-idf-codeowners/ci
|
||||
/examples/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools
|
||||
/examples/bluetooth/ @esp-idf-codeowners/bluetooth
|
||||
/examples/build_system/ @esp-idf-codeowners/build-config
|
||||
/examples/common_components/ @esp-idf-codeowners/system @esp-idf-codeowners/wifi @esp-idf-codeowners/lwip @esp-idf-codeowners/network
|
||||
/examples/custom_bootloader/ @esp-idf-codeowners/system
|
||||
/examples/cxx/ @esp-idf-codeowners/system
|
||||
/examples/ethernet/ @esp-idf-codeowners/network
|
||||
/examples/get-started/ @esp-idf-codeowners/system
|
||||
/examples/ieee802154/ @esp-idf-codeowners/ieee802154
|
||||
/examples/lowpower/ @esp-idf-codeowners/power-management @esp-idf-codeowners/system
|
||||
/examples/mesh/ @esp-idf-codeowners/wifi
|
||||
/examples/network/ @esp-idf-codeowners/network @esp-idf-codeowners/wifi
|
||||
/examples/openthread/ @esp-idf-codeowners/ieee802154
|
||||
/examples/peripherals/ @esp-idf-codeowners/peripherals
|
||||
/examples/peripherals/usb/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/peripherals/usb
|
||||
/examples/phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
|
||||
/examples/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
|
||||
/examples/provisioning/ @esp-idf-codeowners/app-utilities/provisioning
|
||||
/examples/security/ @esp-idf-codeowners/security
|
||||
/examples/storage/ @esp-idf-codeowners/storage
|
||||
/examples/system/ @esp-idf-codeowners/system
|
||||
/examples/system/ota/ @esp-idf-codeowners/app-utilities
|
||||
/examples/wifi/ @esp-idf-codeowners/wifi
|
||||
/examples/zigbee/ @esp-idf-codeowners/ieee802154
|
||||
|
||||
/tools/ @esp-idf-codeowners/tools
|
||||
/tools/ble/ @esp-idf-codeowners/app-utilities
|
||||
/tools/bt/ @esp-idf-codeowners/bluetooth
|
||||
/tools/catch/ @esp-idf-codeowners/ci
|
||||
/tools/ci/ @esp-idf-codeowners/ci
|
||||
/tools/cmake/ @esp-idf-codeowners/build-config
|
||||
/tools/cmake/toolchain-*.cmake @esp-idf-codeowners/toolchain
|
||||
/tools/esp_app_trace/ @esp-idf-codeowners/debugging
|
||||
/tools/esp_prov/ @esp-idf-codeowners/app-utilities
|
||||
/tools/gdb_panic_server.py @esp-idf-codeowners/debugging
|
||||
/tools/kconfig*/ @esp-idf-codeowners/build-config
|
||||
/tools/ldgen/ @esp-idf-codeowners/build-config
|
||||
/tools/mass_mfg/ @esp-idf-codeowners/app-utilities
|
||||
/tools/mocks/ @esp-idf-codeowners/system
|
||||
|
||||
/tools/test_apps/ @esp-idf-codeowners/ci
|
||||
/tools/test_apps/README.md @esp-idf-codeowners/docs @esp-idf-codeowners/ci
|
||||
|
||||
## Note: owners here should be the same as the owners for the same example subdir, above
|
||||
/tools/test_apps/build_system/ @esp-idf-codeowners/build-config
|
||||
/tools/test_apps/configs/ @esp-idf-codeowners/system
|
||||
/tools/test_apps/linux_compatible/ @esp-idf-codeowners/system
|
||||
/tools/test_apps/peripherals/ @esp-idf-codeowners/peripherals
|
||||
/tools/test_apps/phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
|
||||
/tools/test_apps/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
|
||||
/tools/test_apps/security/ @esp-idf-codeowners/security
|
||||
/tools/test_apps/storage/ @esp-idf-codeowners/storage
|
||||
/tools/test_apps/system/ @esp-idf-codeowners/system
|
||||
|
||||
/tools/test_apps/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools
|
||||
|
||||
/tools/test_build_system/ @esp-idf-codeowners/tools @esp-idf-codeowners/build-config
|
||||
|
||||
/tools/tools.json @esp-idf-codeowners/tools @esp-idf-codeowners/toolchain @esp-idf-codeowners/debugging
|
||||
|
||||
/tools/unit-test-app/ @esp-idf-codeowners/system @esp-idf-codeowners/tools
|
||||
|
||||
# sort-order-reset
|
||||
|
||||
/components/**/test_apps/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools
|
||||
|
||||
# ignore lists
|
||||
/tools/ci/check_copyright_config.yaml @esp-idf-codeowners/all-maintainers
|
||||
/tools/ci/check_copyright_ignore.txt @esp-idf-codeowners/all-maintainers
|
||||
/tools/ci/mypy_ignore_list.txt @esp-idf-codeowners/tools
|
||||
|
||||
@@ -40,7 +40,7 @@ variables:
|
||||
GIT_FETCH_EXTRA_FLAGS: "--no-recurse-submodules --prune --prune-tags"
|
||||
# we're using .cache folder for caches
|
||||
GIT_CLEAN_FLAGS: -ffdx -e .cache/
|
||||
LATEST_GIT_TAG: v5.5
|
||||
LATEST_GIT_TAG: v5.5-dev
|
||||
|
||||
SUBMODULE_FETCH_TOOL: "tools/ci/ci_fetch_submodule.py"
|
||||
# by default we will fetch all submodules
|
||||
@@ -55,9 +55,9 @@ variables:
|
||||
CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py"
|
||||
|
||||
# Docker images
|
||||
ESP_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-env-v5.5:3"
|
||||
ESP_IDF_DOC_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-doc-env-v5.5:3-1"
|
||||
TARGET_TEST_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/target-test-env-v5.5:2"
|
||||
ESP_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-env-v6.0:1"
|
||||
ESP_IDF_DOC_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-doc-env-v6.0:1-1"
|
||||
TARGET_TEST_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/target-test-env-v6.0:1"
|
||||
SONARQUBE_SCANNER_IMAGE: "${CI_DOCKER_REGISTRY}/sonarqube-scanner:5"
|
||||
PRE_COMMIT_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-pre-commit:1"
|
||||
|
||||
@@ -70,7 +70,7 @@ variables:
|
||||
CI_PYTHON_CONSTRAINT_BRANCH: ""
|
||||
|
||||
# Update the filename for a specific ESP-IDF release. It is used only with CI_PYTHON_CONSTRAINT_BRANCH.
|
||||
CI_PYTHON_CONSTRAINT_FILE: "espidf.constraints.v5.5.txt"
|
||||
CI_PYTHON_CONSTRAINT_FILE: "espidf.constraints.v6.0.txt"
|
||||
|
||||
# Set this variable to repository name of a Python tool you wish to install and test in the context of ESP-IDF CI.
|
||||
# Keep the variable empty when not used.
|
||||
@@ -191,21 +191,13 @@ variables:
|
||||
fi
|
||||
|
||||
# Custom OpenOCD
|
||||
if [[ "$CI_JOB_STAGE" == "target_test" ]]; then
|
||||
machine="$(uname -m)"
|
||||
if [[ "$machine" == "armv7l" ]] ; then
|
||||
OOCD_DISTRO_URL="$OOCD_DISTRO_URL_ARMHF"
|
||||
elif [[ "$machine" == "aarch64" ]] ; then
|
||||
OOCD_DISTRO_URL="$OOCD_DISTRO_URL_ARM64"
|
||||
fi
|
||||
if [[ ! -z "$OOCD_DISTRO_URL" ]]; then
|
||||
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
|
||||
wget $OOCD_DISTRO_URL
|
||||
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
|
||||
tar -x -f $ARCH_NAME
|
||||
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
|
||||
export PATH=$PWD/openocd-esp32/bin:$PATH
|
||||
fi
|
||||
if [[ ! -z "$OOCD_DISTRO_URL" && "$CI_JOB_STAGE" == "target_test" ]]; then
|
||||
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
|
||||
wget $OOCD_DISTRO_URL
|
||||
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
|
||||
tar -x -f $ARCH_NAME
|
||||
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
|
||||
export PATH=$PWD/openocd-esp32/bin:$PATH
|
||||
fi
|
||||
|
||||
if [[ -n "$CI_PYTHON_TOOL_REPO" ]]; then
|
||||
|
||||
@@ -14,7 +14,6 @@ extra_default_build_targets:
|
||||
|
||||
bypass_check_test_targets:
|
||||
- esp32h21
|
||||
- esp32c61
|
||||
- esp32h4
|
||||
- esp32c5
|
||||
|
||||
|
||||
@@ -165,8 +165,6 @@ pipeline_variables:
|
||||
if [ -n "$CI_PYTHON_CONSTRAINT_BRANCH" ]; then
|
||||
echo "BUILD_AND_TEST_ALL_APPS=1" >> pipeline.env
|
||||
fi
|
||||
- echo "OOCD_DISTRO_URL_ARMHF=$OOCD_DISTRO_URL_ARMHF" >> pipeline.env
|
||||
- echo "OOCD_DISTRO_URL_ARM64=$OOCD_DISTRO_URL_ARM64" >> pipeline.env
|
||||
- python tools/ci/ci_process_description.py
|
||||
- cat pipeline.env
|
||||
- python tools/ci/artifacts_handler.py upload --type modified_files_and_components_report
|
||||
|
||||
@@ -30,7 +30,6 @@ test_cli_installer_win:
|
||||
variables:
|
||||
IDF_PATH: "$CI_PROJECT_DIR"
|
||||
timeout: 3h
|
||||
allow_failure: true
|
||||
script:
|
||||
# Tools must be downloaded for testing
|
||||
- python ${IDF_PATH}\tools\idf_tools.py download required qemu-riscv32 qemu-xtensa cmake
|
||||
|
||||
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -54,10 +54,8 @@
|
||||
sbom-supplier = Person: Dave Gamble
|
||||
sbom-url = https://github.com/DaveGamble/cJSON
|
||||
sbom-description = Ultralightweight JSON parser in ANSI C
|
||||
sbom-hash = 8f2beb57ddad1f94bed899790b00f46df893ccac
|
||||
sbom-hash = acc76239bee01d8e9c858ae2cab296704e52d916
|
||||
sbom-cve-exclude-list = CVE-2024-31755 Resolved in v1.7.18
|
||||
sbom-cve-exclude-list = CVE-2023-26819 Resolved in commit a328d65ad490b64da8c87523cbbfe16050ba5bf6
|
||||
sbom-cve-exclude-list = CVE-2023-53154 Resolved in v1.7.18
|
||||
|
||||
[submodule "components/mbedtls/mbedtls"]
|
||||
path = components/mbedtls/mbedtls
|
||||
|
||||
@@ -70,7 +70,6 @@ repos:
|
||||
rev: v2.3.0
|
||||
hooks:
|
||||
- id: codespell
|
||||
exclude: ^docs/sphinx-known-warnings\.txt$
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: check-executables
|
||||
|
||||
24
README.md
24
README.md
@@ -15,18 +15,18 @@ ESP-IDF is the development framework for Espressif SoCs supported on Windows, Li
|
||||
|
||||
The following table shows ESP-IDF support of Espressif SoCs where ![alt text][preview] and ![alt text][supported] denote preview status and support, respectively. The preview support is usually limited in time and intended for beta versions of chips. Please use an ESP-IDF release where the desired SoC is already supported.
|
||||
|
||||
|Chip | v5.1 | v5.2 | v5.3 | v5.4 | v5.5 | |
|
||||
|:----------- |:--------------------: | :--------------------: | :--------------------: | :--------------------: | :--------------------: |:------------------------------------------------------------------- |
|
||||
|ESP32 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-S2 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-C3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-S3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_S3) |
|
||||
|ESP32-C2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32-C2) |
|
||||
|ESP32-C6 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_C6) |
|
||||
|ESP32-H2 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_H2) |
|
||||
|ESP32-P4 | | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32-P4) |
|
||||
|ESP32-C5 | | | | |![alt text][preview] |[Announcement](https://www.espressif.com/en/news/ESP32-C5) |
|
||||
|ESP32-C61 | | | | |![alt text][preview] |[Announcement](https://www.espressif.com/en/products/socs/esp32-c61) |
|
||||
|Chip | v5.0 | v5.1 | v5.2 | v5.3 | v5.4 | |
|
||||
|:----------- | :---------------------:| :--------------------: | :--------------------: | :--------------------: | :--------------------: |:------------------------------------------------------------------- |
|
||||
|ESP32 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-S2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-C3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-S3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_S3) |
|
||||
|ESP32-C2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32-C2) |
|
||||
|ESP32-C6 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_C6) |
|
||||
|ESP32-H2 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_H2) |
|
||||
|ESP32-P4 | | | | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32-P4) |
|
||||
|ESP32-C5 | | | | | ![alt text][preview] |[Announcement](https://www.espressif.com/en/news/ESP32-C5) |
|
||||
|ESP32-C61 | | | | | ![alt text][preview] |[Announcement](https://www.espressif.com/en/products/socs/esp32-c61) |
|
||||
|
||||
[supported]: https://img.shields.io/badge/-supported-green "supported"
|
||||
[preview]: https://img.shields.io/badge/-preview-orange "preview"
|
||||
|
||||
25
README_CN.md
25
README_CN.md
@@ -15,19 +15,18 @@ ESP-IDF 是乐鑫官方推出的物联网开发框架,支持 Windows、Linux
|
||||
|
||||
下表总结了乐鑫芯片在 ESP-IDF 各版本中的支持状态,其中 ![alt text][supported] 代表已支持,![alt text][preview] 代表目前处于预览支持状态。预览支持状态通常有时间限制,而且仅适用于测试版芯片。请确保使用与芯片相匹配的 ESP-IDF 版本。
|
||||
|
||||
芯片 | v5.1 | v5.2 | v5.3 | v5.4 | v5.5 | |
|
||||
|:----------- | :--------------------: | :--------------------: | :--------------------: | :--------------------: | :--------------------: |:------------------------------------------------------------------------ |
|
||||
|ESP32 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | |
|
||||
|ESP32-S2 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-C3 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-S3 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_S3) |
|
||||
|ESP32-C2 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C2) |
|
||||
|ESP32-C6 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_C6) |
|
||||
|ESP32-H2 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_H2) |
|
||||
|ESP32-P4 | | | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-P4) |
|
||||
|ESP32-C5 | | | | |![alt text][preview] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C5) |
|
||||
|ESP32-C61 | | | | |![alt text][preview] | [芯片发布公告](https://www.espressif.com/zh-hans/products/socs/esp32-c61) |
|
||||
|
||||
|芯片 | v5.0 | v5.1 | v5.2 | v5.3 | v5.4 | |
|
||||
|:----------- | :---------------------:| :--------------------: | :--------------------: | :--------------------: | :--------------------: | :------------------------------------------------------------------------ |
|
||||
|ESP32 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-S2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-C3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-S3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_S3) |
|
||||
|ESP32-C2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C2) |
|
||||
|ESP32-C6 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_C6) |
|
||||
|ESP32-H2 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_H2) |
|
||||
|ESP32-P4 | | | | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-P4) |
|
||||
|ESP32-C5 | | | | | ![alt text][preview] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C5) |
|
||||
|ESP32-C61 | | | | | ![alt text][preview] | [芯片发布公告](https://www.espressif.com/zh-hans/products/socs/esp32-c61) |
|
||||
|
||||
[supported]: https://img.shields.io/badge/-%E6%94%AF%E6%8C%81-green "supported"
|
||||
[preview]: https://img.shields.io/badge/-%E9%A2%84%E8%A7%88-orange "preview"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
@@ -148,18 +148,6 @@ static esp_err_t esp_apptrace_membufs_swap_waitus(esp_apptrace_membufs_proto_dat
|
||||
if (res != ESP_OK) {
|
||||
break;
|
||||
}
|
||||
#if CONFIG_IDF_TARGET_ESP32S3
|
||||
/*
|
||||
* ESP32S3 has a serious data corruption issue with the transferred data to host.
|
||||
* This delay helps reduce the failure rate by temporarily reducing heavy memory writes
|
||||
* from RTOS-level tracing and giving OpenOCD more time to read trace memory before
|
||||
* the current thread continues execution. While this doesn't completely prevent
|
||||
* memory access from other threads/cores/ISRs, it has shown to significantly improve
|
||||
* reliability when combined with CRC checks in OpenOCD. In practice, this reduces the
|
||||
* number of retries needed to read an entire block without corruption.
|
||||
*/
|
||||
esp_rom_delay_us(100);
|
||||
#endif
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -351,7 +339,7 @@ uint8_t *esp_apptrace_membufs_up_buffer_get(esp_apptrace_membufs_proto_data_t *p
|
||||
esp_err_t esp_apptrace_membufs_up_buffer_put(esp_apptrace_membufs_proto_data_t *proto, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
|
||||
{
|
||||
esp_apptrace_membufs_pkt_end(ptr);
|
||||
// TODO: mark block as busy in order not to reuse it for other tracing calls until it is completely written
|
||||
// TODO: mark block as busy in order not to re-use it for other tracing calls until it is completely written
|
||||
// TODO: avoid potential situation when all memory is consumed by low prio tasks which can not complete writing due to
|
||||
// higher prio tasks and the latter can not allocate buffers at all
|
||||
// this is abnormal situation can be detected on host which will receive only uncompleted buffers
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
@@ -12,7 +12,7 @@
|
||||
// ======================
|
||||
|
||||
// Xtensa has useful feature: TRAX debug module. It allows recording program execution flow at run-time without disturbing CPU.
|
||||
// Execution flow data are written to configurable Trace RAM block. Besides accessing Trace RAM itself TRAX module also allows to read/write
|
||||
// Exectution flow data are written to configurable Trace RAM block. Besides accessing Trace RAM itself TRAX module also allows to read/write
|
||||
// trace memory via its registers by means of JTAG, APB or ERI transactions.
|
||||
// ESP32 has two Xtensa cores with separate TRAX modules on them and provides two special memory regions to be used as trace memory.
|
||||
// Chip allows muxing access to those trace memory blocks in such a way that while one block is accessed by CPUs another one can be accessed by host
|
||||
@@ -47,7 +47,7 @@
|
||||
// 2. TRAX Registers layout
|
||||
// ========================
|
||||
|
||||
// This module uses two TRAX HW registers and one Performance Monitor register to communicate with host SW (OpenOCD).
|
||||
// This module uses two TRAX HW registers to communicate with host SW (OpenOCD).
|
||||
// - Control register uses TRAX_DELAYCNT as storage. Only lower 24 bits of TRAX_DELAYCNT are writable. Control register has the following bitfields:
|
||||
// | 31..XXXXXX..24 | 23 .(host_connect). 23| 22..(block_id)..15 | 14..(block_len)..0 |
|
||||
// 14..0 bits - actual length of user data in trace memory block. Target updates it every time it fills memory block and exposes it to host.
|
||||
@@ -55,15 +55,9 @@
|
||||
// 21..15 bits - trace memory block transfer ID. Block counter. It can overflow. Updated by target, host should not modify it. Actually can be 2 bits;
|
||||
// 22 bit - 'host data present' flag. If set to one there is data from host, otherwise - no host data;
|
||||
// 23 bit - 'host connected' flag. If zero then host is not connected and tracing module works in post-mortem mode, otherwise in streaming mode;
|
||||
// - Status register uses TRAX_TRIGGERPC as storage. If this register is not zero then current CPU is changing TRAX registers and
|
||||
// this register holds address of the instruction which application will execute when it finishes with those registers modifications.
|
||||
// See 'Targets Connection' section for details.
|
||||
// - CRC16 register uses ERI_PERFMON_PM1 as storage. This register is used to store CRC16 checksum of the exposed trace memory block.
|
||||
// The register has the following format:
|
||||
// | 31..16 (CRC indicator) | 15..0 (CRC16 value) |
|
||||
// CRC indicator (0xA55A) is used to distinguish valid CRC values from other data that might be in the register.
|
||||
// CRC16 is calculated over the entire exposed block and is updated every time a block is exposed to the host.
|
||||
// This allows the host to verify data integrity of the received trace data.
|
||||
// - Status register uses TRAX_TRIGGERPC as storage. If this register is not zero then current CPU is changing TRAX registers and
|
||||
// this register holds address of the instruction which application will execute when it finishes with those registers modifications.
|
||||
// See 'Targets Connection' setion for details.
|
||||
|
||||
// 3. Modes of operation
|
||||
// =====================
|
||||
@@ -133,7 +127,7 @@
|
||||
|
||||
// Access to internal module's data is synchronized with custom mutex. Mutex is a wrapper for portMUX_TYPE and uses almost the same sync mechanism as in
|
||||
// vPortCPUAcquireMutex/vPortCPUReleaseMutex. The mechanism uses S32C1I Xtensa instruction to implement exclusive access to module's data from tasks and
|
||||
// ISRs running on both cores. Also custom mutex allows specifying timeout for locking operation. Locking routine checks underlying mutex in cycle until
|
||||
// ISRs running on both cores. Also custom mutex allows specifying timeout for locking operation. Locking routine checks underlaying mutex in cycle until
|
||||
// it gets its ownership or timeout expires. The differences of application tracing module's mutex implementation from vPortCPUAcquireMutex/vPortCPUReleaseMutex are:
|
||||
// - Support for timeouts.
|
||||
// - Local IRQs for CPU which owns the mutex are disabled till the call to unlocking routine. This is made to avoid possible task's prio inversion.
|
||||
@@ -148,9 +142,9 @@
|
||||
|
||||
// Timeout mechanism is based on xthal_get_ccount() routine and supports timeout values in microseconds.
|
||||
// There are two situations when task/ISR can be delayed by tracing API call. Timeout mechanism takes into account both conditions:
|
||||
// - Trace data are locked by another task/ISR. When waiting on trace data lock.
|
||||
// - Trace data are locked by another task/ISR. When wating on trace data lock.
|
||||
// - Current TRAX memory input block is full when working in streaming mode (host is connected). When waiting for host to complete previous block reading.
|
||||
// When waiting for any of above conditions xthal_get_ccount() is called periodically to calculate time elapsed from trace API routine entry. When elapsed
|
||||
// When wating for any of above conditions xthal_get_ccount() is called periodically to calculate time elapsed from trace API routine entry. When elapsed
|
||||
// time exceeds specified timeout value operation is canceled and ESP_ERR_TIMEOUT code is returned.
|
||||
#include "sdkconfig.h"
|
||||
#include "soc/soc.h"
|
||||
@@ -165,15 +159,11 @@
|
||||
#include "esp_log.h"
|
||||
#include "esp_app_trace_membufs_proto.h"
|
||||
#include "esp_app_trace_port.h"
|
||||
#include "esp_rom_crc.h"
|
||||
|
||||
// TRAX is disabled, so we use its registers for our own purposes
|
||||
// | 31..XXXXXX..24 | 23 .(host_connect). 23 | 22 .(host_data). 22| 21..(block_id)..15 | 14..(block_len)..0 |
|
||||
#define ESP_APPTRACE_TRAX_CTRL_REG ERI_TRAX_DELAYCNT
|
||||
#define ESP_APPTRACE_TRAX_STAT_REG ERI_TRAX_TRIGGERPC
|
||||
#define ESP_APPTRACE_TRAX_CRC16_REG ERI_PERFMON_PM1
|
||||
|
||||
#define ESP_APPTRACE_CRC_INDICATOR (0xA55AU << 16)
|
||||
|
||||
#define ESP_APPTRACE_TRAX_BLOCK_LEN_MSK 0x7FFFUL
|
||||
#define ESP_APPTRACE_TRAX_BLOCK_LEN(_l_) ((_l_) & ESP_APPTRACE_TRAX_BLOCK_LEN_MSK)
|
||||
@@ -508,8 +498,7 @@ static esp_err_t esp_apptrace_trax_buffer_swap_start(uint32_t curr_block_id)
|
||||
uint32_t acked_block = ESP_APPTRACE_TRAX_BLOCK_ID_GET(ctrl_reg);
|
||||
uint32_t host_to_read = ESP_APPTRACE_TRAX_BLOCK_LEN_GET(ctrl_reg);
|
||||
if (host_to_read != 0 || acked_block != (curr_block_id & ESP_APPTRACE_TRAX_BLOCK_ID_MSK)) {
|
||||
ESP_APPTRACE_LOGD("HC[%d]: Can not switch %" PRIx32 " %" PRIu32 " %" PRIx32 " %" PRIx32 "/%" PRIx32,
|
||||
esp_cpu_get_core_id(), ctrl_reg, host_to_read, acked_block,
|
||||
ESP_APPTRACE_LOGD("HC[%d]: Can not switch %" PRIx32 " %" PRIu32 " %" PRIx32 " %" PRIx32 "/%" PRIx32, esp_cpu_get_core_id(), ctrl_reg, host_to_read, acked_block,
|
||||
curr_block_id & ESP_APPTRACE_TRAX_BLOCK_ID_MSK, curr_block_id);
|
||||
res = ESP_ERR_NO_MEM;
|
||||
goto _on_err;
|
||||
@@ -525,14 +514,6 @@ static esp_err_t esp_apptrace_trax_buffer_swap_end(uint32_t new_block_id, uint32
|
||||
{
|
||||
uint32_t ctrl_reg = eri_read(ESP_APPTRACE_TRAX_CTRL_REG);
|
||||
uint32_t host_connected = ESP_APPTRACE_TRAX_HOST_CONNECT & ctrl_reg;
|
||||
|
||||
/* calculate CRC16 of the already switched block */
|
||||
if (prev_block_len > 0) {
|
||||
const uint8_t *prev_block_start = s_trax_blocks[!((new_block_id % 2))];
|
||||
uint16_t crc16 = esp_rom_crc16_le(0, prev_block_start, prev_block_len);
|
||||
eri_write(ESP_APPTRACE_TRAX_CRC16_REG, crc16 | ESP_APPTRACE_CRC_INDICATOR);
|
||||
ESP_APPTRACE_LOGD("CRC16:%x %d @%x", crc16, prev_block_len, prev_block_start);
|
||||
}
|
||||
eri_write(ESP_APPTRACE_TRAX_CTRL_REG, ESP_APPTRACE_TRAX_BLOCK_ID(new_block_id) |
|
||||
host_connected | ESP_APPTRACE_TRAX_BLOCK_LEN(prev_block_len));
|
||||
esp_apptrace_trax_buffer_swap_unlock();
|
||||
|
||||
@@ -108,7 +108,7 @@ static void _cbSendTaskList(void) {
|
||||
* Called from SystemView when asked by the host, returns the
|
||||
* current system time in micro seconds.
|
||||
*/
|
||||
__attribute__((unused)) static U64 _cbGetTime(void) {
|
||||
static U64 _cbGetTime(void) {
|
||||
U64 Time;
|
||||
|
||||
Time = xTaskGetTickCountFromISR();
|
||||
@@ -260,10 +260,7 @@ void SYSVIEW_SendTaskInfo(U32 TaskID, const char* sName, unsigned Prio, U32 Stac
|
||||
*/
|
||||
// Callbacks provided to SYSTEMVIEW by FreeRTOS
|
||||
const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI = {
|
||||
/* Callback _cbGetTime locks xKernelLock inside xTaskGetTickCountFromISR, this can cause deadlock on multi-core.
|
||||
To prevent deadlock, always lock xKernelLock before s_sys_view_lock. Omitting the callback here results in sending
|
||||
SYSVIEW_EVTID_SYSTIME_CYCLES events instead of SYSVIEW_EVTID_SYSTIME_US */
|
||||
NULL,
|
||||
_cbGetTime,
|
||||
_cbSendTaskList,
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ menu "Settings"
|
||||
config BOOTLOADER_LOG_MODE_BINARY
|
||||
bool "Binary Log Mode"
|
||||
select BOOTLOADER_LOG_MODE_BINARY_EN
|
||||
depends on BOOTLOADER_LOG_VERSION_2
|
||||
help
|
||||
Enables binary logging with host-side format string expansion. In this mode, the
|
||||
format argument of ESP_LOGx, ESP_EARLY_LOG, and ESP_DRAM_LOG macros is stored in a
|
||||
|
||||
@@ -136,7 +136,7 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
|
||||
#if ESP_TEE_BUILD
|
||||
#include "esp_fault.h"
|
||||
#include "esp_flash_partitions.h"
|
||||
#include "rom/spi_flash.h"
|
||||
#include "esp32c6/rom/spi_flash.h"
|
||||
|
||||
extern bool esp_tee_flash_check_paddr_in_active_tee_part(size_t paddr);
|
||||
#endif
|
||||
|
||||
@@ -55,8 +55,7 @@ void IRAM_ATTR bootloader_init_mspi_clock(void)
|
||||
// SPLL clock on C5 is 480MHz , and mspi_pll needs 80MHz
|
||||
// in this stage, set divider as 6
|
||||
_mspi_timing_ll_set_flash_clk_src(0, FLASH_CLK_SRC_SPLL);
|
||||
// MSPI0 and MSPI1 share this core clock register, but only setting to MSPI0 register is valid
|
||||
mspi_timing_ll_set_core_clock(MSPI_TIMING_LL_MSPI_ID_0, MSPI_TIMING_LL_CORE_CLOCK_MHZ_DEFAULT);
|
||||
mspi_ll_fast_set_hs_divider(6);
|
||||
}
|
||||
|
||||
void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)
|
||||
|
||||
@@ -52,8 +52,7 @@ void IRAM_ATTR bootloader_init_mspi_clock(void)
|
||||
// SPLL clock on C61 is 480MHz , and mspi_pll needs 80MHz
|
||||
// in this stage, set divider as 6
|
||||
_mspi_timing_ll_set_flash_clk_src(0, FLASH_CLK_SRC_DEFAULT);
|
||||
// MSPI0 and MSPI1 share this core clock register, but only setting to MSPI0 register is valid
|
||||
mspi_timing_ll_set_core_clock(MSPI_TIMING_LL_MSPI_ID_0, MSPI_TIMING_LL_CORE_CLOCK_MHZ_DEFAULT);
|
||||
mspi_ll_fast_set_hs_divider(6);
|
||||
}
|
||||
|
||||
void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)
|
||||
|
||||
@@ -25,11 +25,12 @@ void bootloader_ana_super_wdt_reset_config(bool enable);
|
||||
void bootloader_ana_clock_glitch_reset_config(bool enable);
|
||||
|
||||
/**
|
||||
* @brief Configure analog power glitch reset
|
||||
* @brief Configure analog power glitch reset & glitch reset dref
|
||||
*
|
||||
* @param enable Boolean to enable or disable power glitch reset
|
||||
* @param dref voltage threshold
|
||||
*/
|
||||
void bootloader_power_glitch_reset_config(bool enable);
|
||||
void bootloader_power_glitch_reset_config(bool enable, uint8_t dref);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
#define ESP_PARTITION_HASH_LEN 32 /* SHA-256 digest length */
|
||||
#define IS_FIELD_SET(rev_full) (((rev_full) != 65535) && ((rev_full) != 0))
|
||||
#define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1))
|
||||
|
||||
static const char* TAG = "boot_comm";
|
||||
|
||||
@@ -265,10 +264,7 @@ rtc_retain_mem_t* bootloader_common_get_rtc_retain_mem(void)
|
||||
#if ESP_ROM_HAS_LP_ROM
|
||||
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_LOW)
|
||||
#else
|
||||
/* Since the structure containing the retain_mem_t is aligned on 8 by the linker, make sure we align this
|
||||
* structure size here too */
|
||||
#define RETAIN_MEM_SIZE ALIGN_UP(sizeof(rtc_retain_mem_t), 8)
|
||||
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_HIGH - RETAIN_MEM_SIZE)
|
||||
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_HIGH - sizeof(rtc_retain_mem_t))
|
||||
#endif //ESP_ROM_HAS_LP_ROM
|
||||
static rtc_retain_mem_t *const s_bootloader_retain_mem = (rtc_retain_mem_t *)RTC_RETAIN_MEM_ADDR;
|
||||
return s_bootloader_retain_mem;
|
||||
|
||||
@@ -94,7 +94,11 @@ static inline void bootloader_ana_reset_config(void)
|
||||
{
|
||||
//Enable BOD reset (mode1)
|
||||
brownout_ll_ana_reset_enable(true);
|
||||
bootloader_power_glitch_reset_config(true);
|
||||
if (efuse_hal_chip_revision() == 0) {
|
||||
// decrease power glitch reset voltage to avoid start the glitch reset
|
||||
uint8_t power_glitch_dref = 0;
|
||||
bootloader_power_glitch_reset_config(true, power_glitch_dref);
|
||||
}
|
||||
}
|
||||
|
||||
esp_err_t bootloader_init(void)
|
||||
|
||||
@@ -17,18 +17,18 @@ void bootloader_ana_clock_glitch_reset_config(bool enable)
|
||||
(void)enable;
|
||||
}
|
||||
|
||||
void bootloader_power_glitch_reset_config(bool enable)
|
||||
void bootloader_power_glitch_reset_config(bool enable, uint8_t dref)
|
||||
{
|
||||
//only detect VDDPST POWER GLITCH
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PERIF, 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_XTAL, 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PLL, 0);
|
||||
|
||||
REG_SET_FIELD(LP_ANA_FIB_ENABLE_REG, LP_ANA_ANA_FIB_PWR_GLITCH_ENA, 0);//default val for chip from ECO1
|
||||
assert(dref < 8);
|
||||
REG_SET_FIELD(LP_ANA_FIB_ENABLE_REG, LP_ANA_ANA_FIB_PWR_GLITCH_ENA, 0);
|
||||
if (enable) {
|
||||
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_PWR_GLITCH_RESET_ENA, 0xf);//default val for chip from ECO1
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PERIF, dref);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_VDDPST, dref);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_XTAL, dref);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PLL, dref);
|
||||
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_PWR_GLITCH_RESET_ENA, 0xf);
|
||||
} else {
|
||||
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_PWR_GLITCH_RESET_ENA, 0);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,8 @@ static inline void bootloader_ana_reset_config(void)
|
||||
{
|
||||
//Enable BOD reset (mode1)
|
||||
brownout_ll_ana_reset_enable(true);
|
||||
bootloader_power_glitch_reset_config(true);
|
||||
uint8_t power_glitch_dref = 0;
|
||||
bootloader_power_glitch_reset_config(true, power_glitch_dref);
|
||||
}
|
||||
|
||||
esp_err_t bootloader_init(void)
|
||||
|
||||
@@ -17,18 +17,18 @@ void bootloader_ana_clock_glitch_reset_config(bool enable)
|
||||
(void)enable;
|
||||
}
|
||||
|
||||
void bootloader_power_glitch_reset_config(bool enable)
|
||||
void bootloader_power_glitch_reset_config(bool enable, uint8_t dref)
|
||||
{
|
||||
//only detect VDDPST POWER GLITCH
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PERIF, 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PLLBB, 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PLL, 0);
|
||||
|
||||
REG_SET_FIELD(LP_ANA_FIB_ENABLE_REG, LP_ANA_ANA_FIB_PWR_GLITCH_ENA, 0);//default val for chip from ECO2
|
||||
assert(dref < 8);
|
||||
REG_SET_FIELD(LP_ANA_FIB_ENABLE_REG, LP_ANA_ANA_FIB_PWR_GLITCH_ENA, 0);
|
||||
if (enable) {
|
||||
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_POWER_GLITCH_RESET_ENA, 0xf);//default val for chip from ECO2
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PERIF, dref);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_VDDPST, dref);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PLLBB, dref);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PLL, dref);
|
||||
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_POWER_GLITCH_RESET_ENA, 0xf);
|
||||
} else {
|
||||
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_POWER_GLITCH_RESET_ENA, 0);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <strings.h>
|
||||
#include "hal/ecdsa_ll.h"
|
||||
#include "esp_flash_encrypt.h"
|
||||
#include "esp_secure_boot.h"
|
||||
#include "esp_efuse.h"
|
||||
@@ -37,12 +36,6 @@ esp_err_t esp_secure_boot_enable_secure_features(void)
|
||||
ESP_LOGW(TAG, "UART ROM Download mode kept enabled - SECURITY COMPROMISED");
|
||||
#endif
|
||||
|
||||
#ifdef SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
|
||||
if (ecdsa_ll_is_configurable_curve_supported()) {
|
||||
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG
|
||||
ESP_LOGI(TAG, "Disable hardware & software JTAG...");
|
||||
esp_efuse_write_field_bit(ESP_EFUSE_DIS_PAD_JTAG);
|
||||
|
||||
@@ -796,27 +796,20 @@ static esp_err_t verify_segment_header(int index, const esp_image_segment_header
|
||||
bool map_segment = should_map(load_addr);
|
||||
|
||||
#if SOC_MMU_PAGE_SIZE_CONFIGURABLE
|
||||
esp_err_t err = ESP_FAIL;
|
||||
|
||||
/* ESP APP descriptor is present in the DROM segment #0 */
|
||||
if (index == 0 && !is_bootloader(metadata->start_addr)) {
|
||||
uint32_t mmu_page_size = 0, magic_word = 0;
|
||||
const uint32_t mmu_page_size_offset = segment_data_offs + offsetof(esp_app_desc_t, mmu_page_size);
|
||||
CHECK_ERR(bootloader_flash_read(segment_data_offs, &magic_word, sizeof(uint32_t), true));
|
||||
CHECK_ERR(bootloader_flash_read(mmu_page_size_offset, &mmu_page_size, sizeof(uint32_t), true));
|
||||
// Extract only the lowest byte from mmu_page_size (as per image format)
|
||||
mmu_page_size &= 0xFF;
|
||||
|
||||
if (magic_word != ESP_APP_DESC_MAGIC_WORD) {
|
||||
const esp_app_desc_t *app_desc = (const esp_app_desc_t *)bootloader_mmap(segment_data_offs, sizeof(esp_app_desc_t));
|
||||
if (!app_desc || app_desc->magic_word != ESP_APP_DESC_MAGIC_WORD) {
|
||||
ESP_LOGE(TAG, "Failed to fetch app description header!");
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
// Convert from log base 2 number to actual size while handling legacy image case (value 0)
|
||||
metadata->mmu_page_size = (mmu_page_size > 0) ? (1UL << mmu_page_size) : SPI_FLASH_MMU_PAGE_SIZE;
|
||||
metadata->mmu_page_size = (app_desc->mmu_page_size > 0) ? (1UL << app_desc->mmu_page_size) : SPI_FLASH_MMU_PAGE_SIZE;
|
||||
if (metadata->mmu_page_size != SPI_FLASH_MMU_PAGE_SIZE) {
|
||||
ESP_LOGI(TAG, "MMU page size mismatch, configured: 0x%x, found: 0x%"PRIx32, SPI_FLASH_MMU_PAGE_SIZE, metadata->mmu_page_size);
|
||||
}
|
||||
bootloader_munmap(app_desc);
|
||||
} else if (index == 0 && is_bootloader(metadata->start_addr)) {
|
||||
// Bootloader always uses the default MMU page size
|
||||
metadata->mmu_page_size = SPI_FLASH_MMU_PAGE_SIZE;
|
||||
@@ -843,10 +836,6 @@ static esp_err_t verify_segment_header(int index, const esp_image_segment_header
|
||||
}
|
||||
|
||||
return ESP_OK;
|
||||
#if SOC_MMU_PAGE_SIZE_CONFIGURABLE
|
||||
err:
|
||||
return err;
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool should_map(uint32_t load_addr)
|
||||
|
||||
@@ -12,10 +12,6 @@
|
||||
#include "esp_secure_boot.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
|
||||
#ifdef SOC_ECDSA_SUPPORTED
|
||||
#include "hal/ecdsa_ll.h"
|
||||
#endif
|
||||
|
||||
#ifndef BOOTLOADER_BUILD
|
||||
static __attribute__((unused)) const char *TAG = "secure_boot";
|
||||
|
||||
@@ -345,17 +341,15 @@ bool esp_secure_boot_cfg_verify_release_mode(void)
|
||||
}
|
||||
|
||||
#ifdef SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
|
||||
if (ecdsa_ll_is_configurable_curve_supported()) {
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
|
||||
if (!secure) {
|
||||
uint8_t current_curve;
|
||||
esp_err_t err = esp_efuse_read_field_blob(ESP_EFUSE_ECDSA_CURVE_MODE, ¤t_curve, ESP_EFUSE_ECDSA_CURVE_MODE[0]->bit_count);
|
||||
if (err == ESP_OK) {
|
||||
if (current_curve != ESP_EFUSE_ECDSA_CURVE_MODE_ALLOW_ONLY_P256_BIT_LOCKED) {
|
||||
// If not P256 mode
|
||||
result &= secure;
|
||||
ESP_LOGW(TAG, "Not write disabled ECDSA curve mode (set WR_DIS_ECDSA_CURVE_MODE->1)");
|
||||
}
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
|
||||
if (!secure) {
|
||||
uint8_t current_curve;
|
||||
esp_err_t err = esp_efuse_read_field_blob(ESP_EFUSE_ECDSA_CURVE_MODE, ¤t_curve, ESP_EFUSE_ECDSA_CURVE_MODE[0]->bit_count);
|
||||
if (err == ESP_OK) {
|
||||
if (current_curve != ESP_EFUSE_ECDSA_CURVE_MODE_ALLOW_ONLY_P256_BIT_LOCKED) {
|
||||
// If not P256 mode
|
||||
result &= secure;
|
||||
ESP_LOGW(TAG, "Not write disabled ECDSA curve mode (set WR_DIS_ECDSA_CURVE_MODE->1)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ config BT_BLE_LOG_SPI_OUT_LL_TASK_BUF_SIZE
|
||||
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
|
||||
default 1024
|
||||
help
|
||||
SPI transaction buffer size for lower layer task logs.
|
||||
SPI transaction buffer size for upper layer task logs.
|
||||
There will be 2 SPI DMA buffers with the same size.
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_LL_ISR_BUF_SIZE
|
||||
@@ -56,17 +56,9 @@ config BT_BLE_LOG_SPI_OUT_LL_ISR_BUF_SIZE
|
||||
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
|
||||
default 512
|
||||
help
|
||||
SPI transaction buffer size for lower layer ISR logs.
|
||||
SPI transaction buffer size for upper layer ISR logs.
|
||||
There will be 2 SPI DMA buffers with the same size.
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_LL_HCI_BUF_SIZE
|
||||
int "SPI transaction buffer size for lower layer HCI logs"
|
||||
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
|
||||
default 512
|
||||
help
|
||||
SPI transaction buffer size for upper layer HCI logs.
|
||||
There will be 2 SPI DMA buffers with the same size
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_MOSI_IO_NUM
|
||||
int "GPIO number of SPI MOSI"
|
||||
depends on BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
@@ -102,13 +94,6 @@ config BT_BLE_LOG_SPI_OUT_SYNC_IO_NUM
|
||||
help
|
||||
GPIO number of SYNC IO
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_TS_SYNC_SLEEP_SUPPORT
|
||||
bool "Enable ble log & logic analyzer log time sync sleep support"
|
||||
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
|
||||
default n
|
||||
help
|
||||
Enable ble log & logic analyzer log time sync sleep support
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_FLUSH_TIMER_ENABLED
|
||||
bool "Enable periodic buffer flush out"
|
||||
depends on BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
@@ -123,18 +108,3 @@ config BT_BLE_LOG_SPI_OUT_FLUSH_TIMEOUT
|
||||
default 1000
|
||||
help
|
||||
Buffer flush out period in unit of ms
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_LE_AUDIO_ENABLED
|
||||
bool "Enable LE Audio log output to SPI"
|
||||
depends on BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
default n
|
||||
help
|
||||
Enable LE Audio log output to SPI
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_LE_AUDIO_BUF_SIZE
|
||||
int "SPI transaction buffer size for LE Audio logs"
|
||||
depends on BT_BLE_LOG_SPI_OUT_LE_AUDIO_ENABLED
|
||||
default 1024
|
||||
help
|
||||
SPI transaction buffer size for LE Audio logs.
|
||||
There will be 2 SPI DMA buffers with the same size.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -13,35 +13,28 @@
|
||||
#include "esp_timer.h"
|
||||
#include "esp_log.h"
|
||||
#include "freertos/semphr.h"
|
||||
#include "esp_heap_caps.h"
|
||||
|
||||
// Public enums
|
||||
enum {
|
||||
BLE_LOG_SPI_OUT_SOURCE_ESP = 0,
|
||||
BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY,
|
||||
BLE_LOG_SPI_OUT_SOURCE_BLUEDROID,
|
||||
BLE_LOG_SPI_OUT_SOURCE_NIMBLE,
|
||||
BLE_LOG_SPI_OUT_SOURCE_HCI_UPSTREAM,
|
||||
BLE_LOG_SPI_OUT_SOURCE_HCI_DOWNSTREAM,
|
||||
BLE_LOG_SPI_OUT_SOURCE_ESP_ISR,
|
||||
BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY_ISR,
|
||||
BLE_LOG_SPI_OUT_SOURCE_LL_HCI,
|
||||
BLE_LOG_SPI_OUT_SOURCE_LE_AUDIO,
|
||||
BLE_LOG_SPI_OUT_SOURCE_USER = 0x10,
|
||||
BLE_LOG_SPI_OUT_SOURCE_SSC = 0xFD,
|
||||
BLE_LOG_SPI_OUT_SOURCE_SYNC,
|
||||
BLE_LOG_SPI_OUT_SOURCE_LOSS,
|
||||
};
|
||||
// Public typedefs
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_ESP 0
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY 1
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_BLUEDROID 2
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_NIMBLE 3
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_HCI_UPSTREAM 4
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_HCI_DOWNSTREAM 5
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_ESP_ISR 6
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY_ISR 7
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_USER 0x10
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_SYNC 0xFE
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_LOSS 0xFF
|
||||
|
||||
enum {
|
||||
BLE_LOG_SPI_OUT_LEVEL_NONE = 0,
|
||||
BLE_LOG_SPI_OUT_LEVEL_ERROR,
|
||||
BLE_LOG_SPI_OUT_LEVEL_WARN,
|
||||
BLE_LOG_SPI_OUT_LEVEL_INFO,
|
||||
BLE_LOG_SPI_OUT_LEVEL_DEBUG,
|
||||
BLE_LOG_SPI_OUT_LEVEL_VERBOSE,
|
||||
BLE_LOG_SPI_OUT_LEVEL_MAX,
|
||||
};
|
||||
// SPI Log Level Definitions
|
||||
#define BLE_LOG_SPI_OUT_LEVEL_NONE 0 /*!< No log output */
|
||||
#define BLE_LOG_SPI_OUT_LEVEL_ERROR 1 /*!< Critical errors that SPI driver cannot recover from */
|
||||
#define BLE_LOG_SPI_OUT_LEVEL_WARN 2 /*!< Recoverable error conditions in SPI communication */
|
||||
#define BLE_LOG_SPI_OUT_LEVEL_INFO 3 /*!< Informational messages about SPI transactions */
|
||||
#define BLE_LOG_SPI_OUT_LEVEL_DEBUG 4 /*!< Detailed debug information, such as SPI register values */
|
||||
#define BLE_LOG_SPI_OUT_LEVEL_VERBOSE 5 /*!< Very detailed debugging logs, potentially flooding output */
|
||||
#define BLE_LOG_SPI_OUT_LEVEL_MAX 6 /*!< Number of SPI log levels supported */
|
||||
|
||||
// Public functions
|
||||
int ble_log_spi_out_init(void);
|
||||
@@ -57,8 +50,5 @@ int ble_log_spi_out_printf(uint8_t source, const char *format, ...);
|
||||
int ble_log_spi_out_printf_enh(uint8_t source, uint8_t level, const char *tag, const char *format, ...);
|
||||
int ble_log_spi_out_write_with_ts(uint8_t source, const uint8_t *addr, uint16_t len);
|
||||
void ble_log_spi_out_dump_all(void);
|
||||
void ble_log_spi_out_enable(bool enable);
|
||||
void ble_log_spi_out_flush(void);
|
||||
void ble_log_spi_out_le_audio_write(const uint8_t *addr, uint16_t len);
|
||||
|
||||
#endif // __BT_SPI_OUT_H__
|
||||
|
||||
@@ -965,7 +965,7 @@ static void btdm_sleep_enter_phase1_wrapper(uint32_t lpcycles)
|
||||
assert(us_to_sleep > BTDM_MIN_TIMER_UNCERTAINTY_US);
|
||||
// allow a maximum time uncertainty to be about 488ppm(1/2048) at least as clock drift
|
||||
// and set the timer in advance
|
||||
uint32_t uncertainty = (us_to_sleep / 1000);
|
||||
uint32_t uncertainty = (us_to_sleep >> 11);
|
||||
if (uncertainty < BTDM_MIN_TIMER_UNCERTAINTY_US) {
|
||||
uncertainty = BTDM_MIN_TIMER_UNCERTAINTY_US;
|
||||
}
|
||||
@@ -1701,7 +1701,6 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
if (ble_log_spi_out_init() != 0) {
|
||||
ESP_LOGE(BTDM_LOG_TAG, "BLE Log SPI output init failed");
|
||||
err = ESP_ERR_NO_MEM;
|
||||
goto error;
|
||||
}
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
@@ -584,7 +584,7 @@ config BT_LE_CCA_RSSI_THRESH
|
||||
int "CCA RSSI threshold value"
|
||||
depends on BT_LE_TX_CCA_ENABLED
|
||||
range 20 100
|
||||
default 65
|
||||
default 20
|
||||
help
|
||||
Power threshold of CCA in unit of -1 dBm.
|
||||
|
||||
|
||||
@@ -119,11 +119,6 @@ struct ext_funcs_t {
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
|
||||
|
||||
enum {
|
||||
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
|
||||
BLE_LOG_INTERFACE_FLAG_END,
|
||||
};
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
/* External functions or variables
|
||||
@@ -416,22 +411,20 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
|
||||
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
|
||||
{
|
||||
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
|
||||
bool end = flag ? true : false;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_controller_log_storage(len, addr, end);
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
|
||||
if (len && addr) {
|
||||
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
if (len_append && addr_append) {
|
||||
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
|
||||
}
|
||||
if (end) { esp_rom_printf("\n"); }
|
||||
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
}
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
|
||||
|
||||
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
|
||||
bool "BLE adv report flow control supported"
|
||||
depends on BT_CTRL_BLE_SCAN
|
||||
depends on (!BT_CTRL_RUN_IN_FLASH_ONLY) || (BT_CTRL_RUN_IN_FLASH_ONLY && BT_CTRL_BLE_SCAN)
|
||||
default y
|
||||
help
|
||||
The function is mainly used to enable flow control for advertising reports. When it is enabled,
|
||||
@@ -530,31 +530,30 @@ config BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
impact on Bluetooth performance.
|
||||
|
||||
config BT_CTRL_DTM_ENABLE
|
||||
depends on BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
bool "Enable direct test mode feature"
|
||||
default y
|
||||
default n
|
||||
|
||||
config BT_CTRL_BLE_MASTER
|
||||
bool "Enable BLE connection feature"
|
||||
depends on BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
bool "Enable BLE master role feature"
|
||||
default y
|
||||
help
|
||||
If this option is disabled, it is not recommended to use connectable ADV.
|
||||
|
||||
config BT_CTRL_BLE_TEST
|
||||
bool "Enable BLE QA test feature (Not Used)"
|
||||
depends on BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
bool "Enable BLE QA test feature"
|
||||
default n
|
||||
|
||||
config BT_CTRL_BLE_SCAN
|
||||
depends on BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
bool "Enable BLE scan feature"
|
||||
default y
|
||||
|
||||
config BT_CTRL_BLE_SECURITY_ENABLE
|
||||
depends on BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
bool "Enable BLE security feature"
|
||||
default y
|
||||
|
||||
config BT_CTRL_BLE_ADV
|
||||
bool "Enable BLE ADV feature"
|
||||
default y
|
||||
|
||||
config BT_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
|
||||
bool "Enable enhanced Access Address check in CONNECT_IND"
|
||||
default n
|
||||
|
||||
@@ -312,17 +312,6 @@ extern void advFilter_stack_enableDupExcListVsCmd(bool en);
|
||||
extern void chanSel_stack_enableSetCsaVsCmd(bool en);
|
||||
#endif // (CONFIG_BT_BLUEDROID_ENABLED || CONFIG_BT_NIMBLE_ENABLED)
|
||||
|
||||
extern void ble_dtm_funcs_reset(void);
|
||||
extern void ble_scan_funcs_reset(void);
|
||||
extern void ble_42_adv_funcs_reset(void);
|
||||
extern void ble_init_funcs_reset(void);
|
||||
extern void ble_con_funcs_reset(void);
|
||||
extern void ble_cca_funcs_reset(void);
|
||||
extern void ble_ext_adv_funcs_reset(void);
|
||||
extern void ble_ext_scan_funcs_reset(void);
|
||||
extern void ble_base_funcs_reset(void);
|
||||
extern void ble_enc_funcs_reset(void);
|
||||
|
||||
extern uint32_t _bt_bss_start;
|
||||
extern uint32_t _bt_bss_end;
|
||||
extern uint32_t _bt_controller_bss_start;
|
||||
@@ -1276,46 +1265,6 @@ static void btdm_funcs_table_ready_wrapper(void)
|
||||
#if BLE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED
|
||||
btdm_aa_check_enhance_enable();
|
||||
#endif
|
||||
#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
// do nothing
|
||||
#else
|
||||
ESP_LOGI(BT_LOG_TAG, "Feature Config, ADV:%d, BLE_50:%d, DTM:%d, SCAN:%d, CCA:%d, SMP:%d, CONNECT:%d",
|
||||
BT_CTRL_BLE_ADV, BT_CTRL_50_FEATURE_SUPPORT, BT_CTRL_DTM_ENABLE, BT_CTRL_BLE_SCAN,
|
||||
BT_BLE_CCA_MODE, BLE_SECURITY_ENABLE, BT_CTRL_BLE_MASTER);
|
||||
|
||||
ble_base_funcs_reset();
|
||||
#if CONFIG_BT_CTRL_BLE_ADV
|
||||
ble_42_adv_funcs_reset();
|
||||
#if (BT_CTRL_50_FEATURE_SUPPORT == 1)
|
||||
ble_ext_adv_funcs_reset();
|
||||
#endif //
|
||||
#endif // CONFIG_BT_CTRL_BLE_ADV
|
||||
|
||||
#if CONFIG_BT_CTRL_DTM_ENABLE
|
||||
ble_dtm_funcs_reset();
|
||||
#endif // CONFIG_BT_CTRL_DTM_ENABLE
|
||||
|
||||
#if CONFIG_BT_CTRL_BLE_SCAN
|
||||
ble_scan_funcs_reset();
|
||||
#if (BT_CTRL_50_FEATURE_SUPPORT == 1)
|
||||
ble_ext_scan_funcs_reset();
|
||||
#endif // (BT_CTRL_50_FEATURE_SUPPORT == 1)
|
||||
#endif // CONFIG_BT_CTRL_BLE_SCAN
|
||||
|
||||
#if (BT_BLE_CCA_MODE != 0)
|
||||
ble_cca_funcs_reset();
|
||||
#endif // (BT_BLE_CCA_MODE != 0)
|
||||
|
||||
#if CONFIG_BT_CTRL_BLE_SECURITY_ENABLE
|
||||
ble_enc_funcs_reset();
|
||||
#endif // CONFIG_BT_CTRL_BLE_SECURITY_ENABLE
|
||||
|
||||
#if CONFIG_BT_CTRL_BLE_MASTER
|
||||
ble_init_funcs_reset();
|
||||
ble_con_funcs_reset();
|
||||
#endif // CONFIG_BT_CTRL_BLE_MASTER
|
||||
|
||||
#endif // CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
}
|
||||
|
||||
bool bt_async_wakeup_request(void)
|
||||
|
||||
@@ -681,7 +681,7 @@ config BT_LE_CCA_RSSI_THRESH
|
||||
int "CCA RSSI threshold value"
|
||||
depends on BT_LE_TX_CCA_ENABLED
|
||||
range 20 100
|
||||
default 65
|
||||
default 20
|
||||
help
|
||||
Power threshold of CCA in unit of -1 dBm.
|
||||
|
||||
@@ -805,10 +805,3 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
|
||||
config BT_LE_RXBUF_OPT_ENABLED
|
||||
bool "Enable rxbuf optimization feature"
|
||||
default y
|
||||
|
||||
config BT_LE_CTRL_FAST_CONN_DATA_TX_EN
|
||||
bool "Enable fast sending of connection data"
|
||||
default y
|
||||
help
|
||||
If this option is enabled, The Controller will continue to
|
||||
Send an empty PDU after sending valid connection data within an interval.
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
#define OSI_COEX_VERSION 0x00010006
|
||||
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
|
||||
|
||||
#define EXT_FUNC_VERSION 0x20250415
|
||||
#define EXT_FUNC_VERSION 0x20240422
|
||||
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
|
||||
|
||||
#define BT_ASSERT_PRINT ets_printf
|
||||
@@ -98,17 +98,14 @@ struct ext_funcs_t {
|
||||
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
|
||||
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y,
|
||||
const uint8_t *local_priv_key, uint8_t *dhkey);
|
||||
void (* _esp_reset_rpa_moudle)(void);
|
||||
uint32_t magic;
|
||||
};
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
|
||||
|
||||
enum {
|
||||
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
|
||||
BLE_LOG_INTERFACE_FLAG_END,
|
||||
};
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
/* External functions or variables
|
||||
************************************************************************
|
||||
*/
|
||||
@@ -185,6 +182,7 @@ static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
|
||||
static int esp_intr_free_wrapper(void **ret_handle);
|
||||
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
|
||||
static uint32_t osi_random_wrapper(void);
|
||||
static void esp_reset_rpa_moudle(void);
|
||||
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
|
||||
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
|
||||
const uint8_t *our_priv_key, uint8_t *out_dhkey);
|
||||
@@ -461,9 +459,15 @@ struct ext_funcs_t ext_funcs_ro = {
|
||||
._os_random = osi_random_wrapper,
|
||||
._ecc_gen_key_pair = esp_ecc_gen_key_pair,
|
||||
._ecc_gen_dh_key = esp_ecc_gen_dh_key,
|
||||
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
|
||||
.magic = EXT_FUNC_MAGIC_VALUE,
|
||||
};
|
||||
|
||||
static void IRAM_ATTR esp_reset_rpa_moudle(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
|
||||
uint32_t param1, uint32_t param2)
|
||||
{
|
||||
@@ -1415,22 +1419,20 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
|
||||
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
|
||||
{
|
||||
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
|
||||
bool end = flag ? true : false;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_controller_log_storage(len, addr, end);
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
|
||||
if (len && addr) {
|
||||
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
if (len_append && addr_append) {
|
||||
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
|
||||
}
|
||||
if (end) { esp_rom_printf("\n"); }
|
||||
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
}
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
}
|
||||
@@ -1673,7 +1675,7 @@ int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv)
|
||||
#endif // CONFIG_BT_LE_DEBUG_REMAIN_SCENE_ENABLED
|
||||
|
||||
int IRAM_ATTR
|
||||
ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, uint32_t param2)
|
||||
ble_capture_info_user_handler(uint8_t type, uint32_t reason)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
@@ -192,12 +192,6 @@ extern "C" {
|
||||
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
|
||||
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
|
||||
#else
|
||||
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#else
|
||||
|
||||
@@ -721,7 +721,7 @@ config BT_LE_CCA_RSSI_THRESH
|
||||
int "CCA RSSI threshold value"
|
||||
depends on BT_LE_TX_CCA_ENABLED
|
||||
range 20 100
|
||||
default 65
|
||||
default 20
|
||||
help
|
||||
Power threshold of CCA in unit of -1 dBm.
|
||||
|
||||
@@ -839,10 +839,3 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
|
||||
config BT_LE_RXBUF_OPT_ENABLED
|
||||
bool "Enable rxbuf optimization feature"
|
||||
default y
|
||||
|
||||
config BT_LE_CTRL_FAST_CONN_DATA_TX_EN
|
||||
bool "Enable fast sending of connection data"
|
||||
default y
|
||||
help
|
||||
If this option is enabled, The Controller will continue to
|
||||
Send an empty PDU after sending valid connection data within an interval.
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
|
||||
#include "hal/efuse_hal.h"
|
||||
#include "soc/rtc.h"
|
||||
#include "modem/modem_syscon_struct.h"
|
||||
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
#include "ble_log/ble_log_spi_out.h"
|
||||
@@ -71,7 +70,7 @@
|
||||
#define OSI_COEX_VERSION 0x00010006
|
||||
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
|
||||
|
||||
#define EXT_FUNC_VERSION 0x20250415
|
||||
#define EXT_FUNC_VERSION 0x20240422
|
||||
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
|
||||
|
||||
#define BT_ASSERT_PRINT ets_printf
|
||||
@@ -102,29 +101,17 @@ struct ext_funcs_t {
|
||||
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
|
||||
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y,
|
||||
const uint8_t *local_priv_key, uint8_t *dhkey);
|
||||
#if CONFIG_IDF_TARGET_ESP32C6
|
||||
void (* _esp_reset_modem)(uint8_t mdl_opts, uint8_t start);
|
||||
#endif // CONFIG_IDF_TARGET_ESP32C6
|
||||
void (* _esp_reset_rpa_moudle)(void);
|
||||
uint32_t magic;
|
||||
};
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
|
||||
|
||||
enum {
|
||||
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
|
||||
BLE_LOG_INTERFACE_FLAG_END,
|
||||
};
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
/* External functions or variables
|
||||
************************************************************************
|
||||
*/
|
||||
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
|
||||
extern void coex_hw_timer_set(uint8_t idx,uint8_t src, uint8_t pti,uint32_t latency, uint32_t perioidc);
|
||||
extern void coex_hw_timer_enable(uint8_t idx);
|
||||
extern void coex_hw_timer_disable(uint8_t idx);
|
||||
#endif // CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
|
||||
extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
|
||||
extern int r_ble_controller_init(esp_bt_controller_config_t *cfg);
|
||||
extern void esp_ble_controller_info_capture(uint32_t cycle_times);
|
||||
@@ -198,9 +185,7 @@ static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
|
||||
static int esp_intr_free_wrapper(void **ret_handle);
|
||||
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
|
||||
static uint32_t osi_random_wrapper(void);
|
||||
#if CONFIG_IDF_TARGET_ESP32C6
|
||||
static void esp_reset_modem(uint8_t mdl_opts,uint8_t start);
|
||||
#endif // CONFIG_IDF_TARGET_ESP32C6
|
||||
static void esp_reset_rpa_moudle(void);
|
||||
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
|
||||
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
|
||||
const uint8_t *our_priv_key, uint8_t *out_dhkey);
|
||||
@@ -478,34 +463,15 @@ struct ext_funcs_t ext_funcs_ro = {
|
||||
._os_random = osi_random_wrapper,
|
||||
._ecc_gen_key_pair = esp_ecc_gen_key_pair,
|
||||
._ecc_gen_dh_key = esp_ecc_gen_dh_key,
|
||||
#if CONFIG_IDF_TARGET_ESP32C6
|
||||
._esp_reset_modem = esp_reset_modem,
|
||||
#endif // CONFIG_IDF_TARGET_ESP32C6
|
||||
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
|
||||
.magic = EXT_FUNC_MAGIC_VALUE,
|
||||
};
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32C6
|
||||
static void IRAM_ATTR esp_reset_modem(uint8_t mdl_opts,uint8_t start)
|
||||
static void IRAM_ATTR esp_reset_rpa_moudle(void)
|
||||
{
|
||||
if (mdl_opts == 0x05) {
|
||||
if (start) {
|
||||
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
|
||||
coex_hw_timer_set(0x04, 0x02, 15, 0, 5000);
|
||||
coex_hw_timer_enable(0x04);
|
||||
#endif // CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
|
||||
MODEM_SYSCON.modem_rst_conf.val |= (BIT(16) | BIT(18));
|
||||
MODEM_SYSCON.modem_rst_conf.val &= ~(BIT(16) | BIT(18));
|
||||
} else {
|
||||
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
|
||||
coex_hw_timer_disable(0x04);
|
||||
#endif // CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // CONFIG_IDF_TARGET_ESP32C6
|
||||
|
||||
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
|
||||
uint32_t param1, uint32_t param2)
|
||||
{
|
||||
@@ -1486,22 +1452,20 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
|
||||
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
|
||||
{
|
||||
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
|
||||
bool end = flag ? true : false;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_controller_log_storage(len, addr, end);
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
|
||||
if (len && addr) {
|
||||
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
if (len_append && addr_append) {
|
||||
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
|
||||
}
|
||||
if (end) { esp_rom_printf("\n"); }
|
||||
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
}
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
}
|
||||
@@ -1744,7 +1708,7 @@ int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv)
|
||||
#endif // CONFIG_BT_LE_DEBUG_REMAIN_SCENE_ENABLED
|
||||
|
||||
int IRAM_ATTR
|
||||
ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, uint32_t param2)
|
||||
ble_capture_info_user_handler(uint8_t type, uint32_t reason)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
@@ -195,12 +195,6 @@ extern "C" {
|
||||
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
|
||||
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
|
||||
#else
|
||||
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#else
|
||||
|
||||
@@ -716,7 +716,7 @@ config BT_LE_CCA_RSSI_THRESH
|
||||
int "CCA RSSI threshold value"
|
||||
depends on BT_LE_TX_CCA_ENABLED
|
||||
range 20 100
|
||||
default 65
|
||||
default 20
|
||||
help
|
||||
Power threshold of CCA in unit of -1 dBm.
|
||||
|
||||
@@ -843,10 +843,3 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
|
||||
config BT_LE_RXBUF_OPT_ENABLED
|
||||
bool "Enable rxbuf optimization feature"
|
||||
default y
|
||||
|
||||
config BT_LE_CTRL_FAST_CONN_DATA_TX_EN
|
||||
bool "Enable fast sending of connection data"
|
||||
default y
|
||||
help
|
||||
If this option is enabled, The Controller will continue to
|
||||
Send an empty PDU after sending valid connection data within an interval.
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
#define OSI_COEX_VERSION 0x00010006
|
||||
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
|
||||
|
||||
#define EXT_FUNC_VERSION 0x20250415
|
||||
#define EXT_FUNC_VERSION 0x20240422
|
||||
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
|
||||
|
||||
#define BT_ASSERT_PRINT ets_printf
|
||||
@@ -97,16 +97,12 @@ struct ext_funcs_t {
|
||||
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
|
||||
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y,
|
||||
const uint8_t *local_priv_key, uint8_t *dhkey);
|
||||
void (* _esp_reset_rpa_moudle)(void);
|
||||
uint32_t magic;
|
||||
};
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
|
||||
|
||||
enum {
|
||||
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
|
||||
BLE_LOG_INTERFACE_FLAG_END,
|
||||
};
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
/* External functions or variables
|
||||
************************************************************************
|
||||
@@ -187,6 +183,7 @@ static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
|
||||
static int esp_intr_free_wrapper(void **ret_handle);
|
||||
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
|
||||
static uint32_t osi_random_wrapper(void);
|
||||
static void esp_reset_rpa_moudle(void);
|
||||
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
|
||||
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
|
||||
const uint8_t *our_priv_key, uint8_t *out_dhkey);
|
||||
@@ -463,9 +460,15 @@ struct ext_funcs_t ext_funcs_ro = {
|
||||
._os_random = osi_random_wrapper,
|
||||
._ecc_gen_key_pair = esp_ecc_gen_key_pair,
|
||||
._ecc_gen_dh_key = esp_ecc_gen_dh_key,
|
||||
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
|
||||
.magic = EXT_FUNC_MAGIC_VALUE,
|
||||
};
|
||||
|
||||
static void IRAM_ATTR esp_reset_rpa_moudle(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
|
||||
uint32_t param1, uint32_t param2)
|
||||
{
|
||||
@@ -1409,22 +1412,20 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
|
||||
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
|
||||
{
|
||||
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
|
||||
bool end = flag ? true : false;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_controller_log_storage(len, addr, end);
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
|
||||
if (len && addr) {
|
||||
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
if (len_append && addr_append) {
|
||||
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
|
||||
}
|
||||
if (end) { esp_rom_printf("\n"); }
|
||||
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
}
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
}
|
||||
@@ -1666,7 +1667,7 @@ int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv)
|
||||
#endif // CONFIG_BT_LE_DEBUG_REMAIN_SCENE_ENABLED
|
||||
|
||||
int IRAM_ATTR
|
||||
ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, uint32_t param2)
|
||||
ble_capture_info_user_handler(uint8_t type, uint32_t reason)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
@@ -192,12 +192,6 @@ extern "C" {
|
||||
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
|
||||
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
|
||||
#else
|
||||
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#else
|
||||
|
||||
Submodule components/bt/controller/lib_esp32c2/esp32c2-bt-lib updated: 3ad0070589...d6c94459f3
Submodule components/bt/controller/lib_esp32c3_family updated: 3ff529142f...b09bf658a7
Submodule components/bt/controller/lib_esp32c5/esp32c5-bt-lib updated: 40a1921b1f...48ff59a739
Submodule components/bt/controller/lib_esp32c6/esp32c6-bt-lib updated: 250e75199e...233738dc87
Submodule components/bt/controller/lib_esp32h2/esp32h2-bt-lib updated: 82cbc1dd93...efd8a69553
@@ -25,6 +25,7 @@ if BLE_MESH
|
||||
menuconfig BLE_MESH_USE_BLE_50
|
||||
bool "Support using BLE 5.0 APIs for BLE Mesh"
|
||||
depends on BLE_MESH_EXPERIMENTAL
|
||||
depends on IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
|
||||
select BT_NIMBLE_50_FEATURE_SUPPORT if BT_NIMBLE_ENABLED
|
||||
select BT_NIMBLE_EXT_ADV if BT_NIMBLE_ENABLED
|
||||
select BT_BLE_50_FEATURES_SUPPORTED if BT_BLUEDROID_ENABLED
|
||||
@@ -476,7 +477,7 @@ if BLE_MESH
|
||||
int "Maximum capacity of solicitation replay protection list"
|
||||
depends on BLE_MESH_PROXY_SOLIC_PDU_RX
|
||||
default 2
|
||||
range 1 65536
|
||||
range 1 255
|
||||
help
|
||||
This option specifies the maximum capacity of the solicitation replay
|
||||
protection list. The solicitation replay protection list is used to
|
||||
|
||||
@@ -94,16 +94,17 @@ static inline int adv_send(struct net_buf *buf)
|
||||
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
|
||||
if (BLE_MESH_ADV(buf)->type == BLE_MESH_ADV_PROXY_SOLIC) {
|
||||
bt_mesh_adv_buf_ref_debug(__func__, buf, 3U, BLE_MESH_BUF_REF_SMALL);
|
||||
struct bt_mesh_adv_data solic_ad[2] = {
|
||||
struct bt_mesh_adv_data solic_ad[3] = {
|
||||
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_FLAGS, (BLE_MESH_AD_GENERAL | BLE_MESH_AD_NO_BREDR)),
|
||||
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_UUID16_ALL, 0x59, 0x18),
|
||||
BLE_MESH_ADV_DATA(BLE_MESH_DATA_SVC_DATA16, buf->data, buf->len),
|
||||
};
|
||||
#if CONFIG_BLE_MESH_USE_BLE_50
|
||||
param.primary_phy = BLE_MESH_ADV_PHY_1M;
|
||||
param.secondary_phy = BLE_MESH_ADV_PHY_1M;
|
||||
err = bt_le_ext_adv_start(CONFIG_BLE_MESH_ADV_INST_ID, ¶m, solic_ad, ARRAY_SIZE(solic_ad), NULL, 0);
|
||||
err = bt_le_ext_adv_start(CONFIG_BLE_MESH_ADV_INST_ID, ¶m, &ad, 3, NULL, 0);
|
||||
#else /* CONFIG_BLE_MESH_USE_BLE_50 */
|
||||
err = bt_le_adv_start(¶m, solic_ad, ARRAY_SIZE(solic_ad), NULL, 0);
|
||||
err = bt_le_adv_start(¶m, &ad, 3, NULL, 0);
|
||||
#endif /* CONFIG_BLE_MESH_USE_BLE_50 */
|
||||
} else
|
||||
#endif
|
||||
|
||||
@@ -625,9 +625,6 @@ void bt_mesh_adv_common_init(void)
|
||||
bt_mesh_adv_type_init(BLE_MESH_ADV_DATA, &adv_queue, &adv_buf_pool, adv_alloc);
|
||||
bt_mesh_adv_type_init(BLE_MESH_ADV_BEACON, &adv_queue, &adv_buf_pool, adv_alloc);
|
||||
bt_mesh_adv_type_init(BLE_MESH_ADV_URI, &adv_queue, &adv_buf_pool, adv_alloc);
|
||||
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
|
||||
bt_mesh_adv_type_init(BLE_MESH_ADV_PROXY_SOLIC, &adv_queue, &adv_buf_pool, adv_alloc);
|
||||
#endif
|
||||
|
||||
#if CONFIG_BLE_MESH_USE_BLE_50
|
||||
bt_mesh_adv_inst_init(BLE_MESH_ADV_INS, CONFIG_BLE_MESH_ADV_INST_ID);
|
||||
|
||||
@@ -140,9 +140,6 @@ enum bt_mesh_adv_type {
|
||||
#endif
|
||||
BLE_MESH_ADV_BEACON,
|
||||
BLE_MESH_ADV_URI,
|
||||
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
|
||||
BLE_MESH_ADV_PROXY_SOLIC,
|
||||
#endif
|
||||
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV
|
||||
BLE_MESH_ADV_BLE,
|
||||
#endif
|
||||
|
||||
@@ -667,7 +667,7 @@ int bt_le_ext_adv_start(const uint8_t inst_id,
|
||||
interval >>= 1;
|
||||
interval += (bt_mesh_get_rand() % (interval + 1));
|
||||
|
||||
BT_DBG("%u->%u", param->interval_min, interval);
|
||||
BT_INFO("%u->%u", param->interval_min, interval);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2153,10 +2153,8 @@ static void bt_mesh_bta_gattc_cb(tBTA_GATTC_EVT event, tBTA_GATTC *p_data)
|
||||
for (i = 0; i < ARRAY_SIZE(bt_mesh_gattc_info); i++) {
|
||||
if (bt_mesh_gattc_info[i].conn.handle == handle) {
|
||||
if (bt_mesh_gattc_info[i].wr_desc_done == false) {
|
||||
BT_WARN("Receive notification before finishing to write ccc");
|
||||
#if !CONFIG_BLE_MESH_BQB_TEST
|
||||
BT_DBG("Receive notification before finishing to write ccc");
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
conn = &bt_mesh_gattc_info[i].conn;
|
||||
|
||||
@@ -70,9 +70,6 @@ static inline int adv_send(struct bt_mesh_adv_inst *inst, uint16_t *adv_duration
|
||||
#endif
|
||||
#if CONFIG_BLE_MESH_RELAY_ADV_BUF
|
||||
case BLE_MESH_ADV_RELAY_DATA:
|
||||
#endif
|
||||
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
|
||||
case BLE_MESH_ADV_PROXY_SOLIC:
|
||||
#endif
|
||||
case BLE_MESH_ADV_BEACON:
|
||||
case BLE_MESH_ADV_URI: {
|
||||
@@ -99,20 +96,9 @@ static inline int adv_send(struct bt_mesh_adv_inst *inst, uint16_t *adv_duration
|
||||
param.primary_phy = BLE_MESH_ADV_PHY_1M;
|
||||
param.secondary_phy = BLE_MESH_ADV_PHY_1M;
|
||||
|
||||
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
|
||||
if (BLE_MESH_ADV(buf)->type == BLE_MESH_ADV_PROXY_SOLIC) {
|
||||
bt_mesh_adv_buf_ref_debug(__func__, buf, 3U, BLE_MESH_BUF_REF_SMALL);
|
||||
struct bt_mesh_adv_data solic_ad[2] = {
|
||||
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_UUID16_ALL, 0x59, 0x18),
|
||||
BLE_MESH_ADV_DATA(BLE_MESH_DATA_SVC_DATA16, buf->data, buf->len),
|
||||
};
|
||||
err = bt_le_ext_adv_start(CONFIG_BLE_MESH_ADV_INST_ID, ¶m, solic_ad, ARRAY_SIZE(solic_ad), NULL, 0);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
bt_mesh_adv_buf_ref_debug(__func__, buf, 4U, BLE_MESH_BUF_REF_SMALL);
|
||||
err = bt_le_ext_adv_start(inst->id, ¶m, &ad, 1, NULL, 0);
|
||||
}
|
||||
bt_mesh_adv_buf_ref_debug(__func__, buf, 4U, BLE_MESH_BUF_REF_SMALL);
|
||||
|
||||
err = bt_le_ext_adv_start(inst->id, ¶m, &ad, 1, NULL, 0);
|
||||
}
|
||||
break;
|
||||
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV
|
||||
@@ -317,7 +303,6 @@ static uint32_t received_adv_evts_handle(uint32_t recv_evts)
|
||||
CONFIG_BLE_MESH_GATT_PROXY_SERVER
|
||||
if (unlikely(i == BLE_MESH_ADV_PROXY_INS)) {
|
||||
BT_DBG("Mesh Proxy Advertising auto stop");
|
||||
bt_mesh_proxy_server_adv_flag_set(false);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
@@ -381,7 +366,7 @@ void bt_mesh_adv_update(void)
|
||||
{
|
||||
#if (CONFIG_BLE_MESH_NODE && CONFIG_BLE_MESH_PB_GATT) || \
|
||||
CONFIG_BLE_MESH_GATT_PROXY_SERVER
|
||||
BT_DBG("Mesh Proxy Advertising stopped manually");
|
||||
BT_WARN("Mesh Proxy Advertising stopped manually");
|
||||
bt_mesh_proxy_server_adv_stop();
|
||||
if (adv_insts[BLE_MESH_ADV_PROXY_INS].busy) {
|
||||
ble_mesh_adv_task_wakeup(ADV_TASK_PROXY_ADV_UPD_EVT);
|
||||
|
||||
@@ -1223,7 +1223,7 @@ int bt_le_ext_adv_start(const uint8_t inst_id,
|
||||
interval >>= 1;
|
||||
interval += (bt_mesh_get_rand() % (interval + 1));
|
||||
|
||||
BT_DBG("%u->%u", param->interval_min, interval);
|
||||
BT_INFO("%u->%u", param->interval_min, interval);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
static struct bt_mesh_proxy_server {
|
||||
struct bt_mesh_conn *conn;
|
||||
bt_mesh_addr_t addr;
|
||||
|
||||
enum __attribute__((packed)) {
|
||||
CLI_NONE,
|
||||
CLI_PROV,
|
||||
@@ -465,7 +465,6 @@ static void proxy_connected(bt_mesh_addr_t *addr, struct bt_mesh_conn *conn, int
|
||||
|
||||
server->conn = bt_mesh_conn_ref(conn);
|
||||
server->conn_type = CLI_NONE;
|
||||
memcpy(&server->addr, addr, sizeof(bt_mesh_addr_t));
|
||||
net_buf_simple_reset(&server->buf);
|
||||
|
||||
#if CONFIG_BLE_MESH_RPR_SRV && CONFIG_BLE_MESH_PB_GATT
|
||||
@@ -630,12 +629,6 @@ static ssize_t proxy_write_ccc(bt_mesh_addr_t *addr, struct bt_mesh_conn *conn)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if CONFIG_BLE_MESH_BQB_TEST
|
||||
/* notify maybe received first */
|
||||
if (server->conn_type == CLI_PROXY) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -648,16 +641,6 @@ static ssize_t proxy_recv_ntf(struct bt_mesh_conn *conn, uint8_t *data, uint16_t
|
||||
return -ENOTCONN;
|
||||
}
|
||||
|
||||
#if CONFIG_BLE_MESH_BQB_TEST
|
||||
/* update conn type if notify received before write ccc */
|
||||
if (server->conn_type == CLI_NONE) {
|
||||
server->conn_type = CLI_PROXY;
|
||||
if (proxy_client_connect_cb) {
|
||||
proxy_client_connect_cb(&server->addr, server - servers, server->net_idx);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (server->conn_type == CLI_PROXY) {
|
||||
return proxy_recv(conn, NULL, data, len, 0, 0);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017 Intel Corporation
|
||||
* SPDX-FileContributor: 2018-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2018-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -170,11 +170,6 @@ static void proxy_sar_timeout(struct k_work *work)
|
||||
bt_mesh_gatts_disconnect(client->conn, 0x13);
|
||||
}
|
||||
|
||||
void bt_mesh_proxy_server_adv_flag_set(bool enable)
|
||||
{
|
||||
proxy_adv_enabled = enable;
|
||||
}
|
||||
|
||||
#if CONFIG_BLE_MESH_GATT_PROXY_SERVER
|
||||
/**
|
||||
* The following callbacks are used to notify proper information
|
||||
@@ -858,9 +853,7 @@ static void proxy_connected(struct bt_mesh_conn *conn, uint8_t err)
|
||||
conn_count++;
|
||||
|
||||
/* Since we use ADV_OPT_ONE_TIME */
|
||||
#if !CONFIG_BLE_MESH_USE_BLE_50
|
||||
bt_mesh_proxy_server_adv_flag_set(false);
|
||||
#endif
|
||||
proxy_adv_enabled = false;
|
||||
|
||||
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_RX
|
||||
/* Before re-enabling advertising, stop advertising
|
||||
@@ -1363,7 +1356,7 @@ int bt_mesh_proxy_server_segment_send(struct bt_mesh_conn *conn, uint8_t type,
|
||||
net_buf_simple_pull(msg, mtu);
|
||||
|
||||
while (msg->len) {
|
||||
if (msg->len + 1 <= mtu) {
|
||||
if (msg->len + 1 < mtu) {
|
||||
net_buf_simple_push_u8(msg, BLE_MESH_PROXY_PDU_HDR(BLE_MESH_PROXY_SAR_LAST, type));
|
||||
proxy_send(conn, msg->data, msg->len);
|
||||
break;
|
||||
@@ -1505,7 +1498,7 @@ static int node_id_adv(struct bt_mesh_subnet *sub)
|
||||
return err;
|
||||
}
|
||||
|
||||
bt_mesh_proxy_server_adv_flag_set(true);
|
||||
proxy_adv_enabled = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1536,7 +1529,7 @@ static int net_id_adv(struct bt_mesh_subnet *sub)
|
||||
return err;
|
||||
}
|
||||
|
||||
bt_mesh_proxy_server_adv_flag_set(true);
|
||||
proxy_adv_enabled = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1599,7 +1592,7 @@ static int private_node_id_adv(struct bt_mesh_subnet *sub)
|
||||
return err;
|
||||
}
|
||||
|
||||
bt_mesh_proxy_server_adv_flag_set(true);
|
||||
proxy_adv_enabled = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1643,7 +1636,7 @@ static int private_net_id_adv(struct bt_mesh_subnet *sub)
|
||||
return err;
|
||||
}
|
||||
|
||||
bt_mesh_proxy_server_adv_flag_set(true);
|
||||
proxy_adv_enabled = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1909,7 +1902,7 @@ int32_t bt_mesh_proxy_server_adv_start(void)
|
||||
prov_sd, prov_sd_len) == 0) {
|
||||
#endif /* CONFIG_BLE_MESH_USE_BLE_50 */
|
||||
|
||||
bt_mesh_proxy_server_adv_flag_set(true);
|
||||
proxy_adv_enabled = true;
|
||||
|
||||
/* Advertise 60 seconds using fast interval */
|
||||
if (prov_fast_adv) {
|
||||
@@ -1966,7 +1959,7 @@ int bt_mesh_proxy_server_adv_stop(void)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bt_mesh_proxy_server_adv_flag_set(false);
|
||||
proxy_adv_enabled = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2029,7 +2022,7 @@ int bt_mesh_proxy_server_deinit(void)
|
||||
proxy_adv_inst = BLE_MESH_ADV_INS_UNUSED;
|
||||
#endif
|
||||
|
||||
bt_mesh_proxy_server_adv_flag_set(false);
|
||||
proxy_adv_enabled = false;
|
||||
gatt_svc = MESH_GATT_NONE;
|
||||
|
||||
#if CONFIG_BLE_MESH_GATT_PROXY_SERVER
|
||||
|
||||
@@ -118,7 +118,6 @@ void bt_mesh_proxy_server_identity_stop(struct bt_mesh_subnet *sub);
|
||||
|
||||
bool bt_mesh_proxy_server_relay(struct net_buf_simple *buf, uint16_t dst);
|
||||
void bt_mesh_proxy_server_addr_add(struct net_buf_simple *buf, uint16_t addr);
|
||||
void bt_mesh_proxy_server_adv_flag_set(bool enable);
|
||||
|
||||
int bt_mesh_proxy_server_init(void);
|
||||
int bt_mesh_proxy_server_deinit(void);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017 Intel Corporation
|
||||
* SPDX-FileContributor: 2020-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2020-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -102,14 +102,13 @@ int bt_mesh_unprov_dev_info_query(uint8_t uuid[16], uint8_t addr[6],
|
||||
{
|
||||
uint8_t idx = 0;
|
||||
uint8_t cnt = 0;
|
||||
uint8_t pair_num = unprov_dev_info_fifo.pair_num;
|
||||
|
||||
if (uuid == NULL && addr == NULL) {
|
||||
if (uuid == NULL || addr == NULL) {
|
||||
BT_WARN("No available information to query");
|
||||
return -1;
|
||||
}
|
||||
|
||||
while (cnt < pair_num) {
|
||||
while (cnt < unprov_dev_info_fifo.pair_num) {
|
||||
idx = (cnt + unprov_dev_info_fifo.start_idx) % BLE_MESH_STORE_UNPROV_INFO_MAX_NUM;
|
||||
if (query_type & BLE_MESH_STORE_UNPROV_INFO_QUERY_TYPE_UUID) {
|
||||
if (!memcmp(unprov_dev_info_fifo.info[idx].addr, addr, 6)) {
|
||||
@@ -135,7 +134,7 @@ int bt_mesh_unprov_dev_info_query(uint8_t uuid[16], uint8_t addr[6],
|
||||
cnt++;
|
||||
}
|
||||
|
||||
if (cnt == pair_num) {
|
||||
if (cnt == unprov_dev_info_fifo.pair_num) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,9 +92,6 @@ uint8_t __meshlib_var_BLE_MESH_ADV_RELAY_DATA = BLE_MESH_ADV_RELAY_DATA;
|
||||
#endif
|
||||
uint8_t __meshlib_var_BLE_MESH_ADV_BEACON = BLE_MESH_ADV_BEACON;
|
||||
uint8_t __meshlib_var_BLE_MESH_ADV_URI = BLE_MESH_ADV_URI;
|
||||
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
|
||||
uint8_t __meshlib_var_BLE_MESH_ADV_PROXY_SOLIC = BLE_MESH_ADV_PROXY_SOLIC;
|
||||
#endif
|
||||
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV
|
||||
uint8_t __meshlib_var_BLE_MESH_ADV_BLE = BLE_MESH_ADV_BLE;
|
||||
#endif
|
||||
@@ -1178,17 +1175,17 @@ uint8_t *bt_mesh_ext_net_get_dev_key_ca(void)
|
||||
return bt_mesh.dev_key_ca;
|
||||
}
|
||||
|
||||
uint16_t bt_mesh_ext_net_get_rpl_count(void)
|
||||
uint8_t bt_mesh_ext_net_get_rpl_count(void)
|
||||
{
|
||||
return ARRAY_SIZE(bt_mesh.rpl);
|
||||
}
|
||||
|
||||
uint16_t bt_mesh_ext_net_get_rpl_src(uint16_t index)
|
||||
uint16_t bt_mesh_ext_net_get_rpl_src(uint8_t index)
|
||||
{
|
||||
return bt_mesh.rpl[index].src;
|
||||
}
|
||||
|
||||
void bt_mesh_ext_net_reset_rpl(uint16_t index)
|
||||
void bt_mesh_ext_net_reset_rpl(uint8_t index)
|
||||
{
|
||||
memset(&bt_mesh.rpl[index], 0, sizeof(bt_mesh.rpl[index]));
|
||||
}
|
||||
@@ -3816,7 +3813,7 @@ void *bt_mesh_ext_brc_srv_get_bridge_table_entry(void *srv, uint8_t index)
|
||||
#endif /* CONFIG_BLE_MESH_BRC_SRV */
|
||||
}
|
||||
|
||||
void *bt_mesh_ext_brc_srv_get_bridge_rpl(uint16_t index)
|
||||
void *bt_mesh_ext_brc_srv_get_bridge_rpl(uint8_t index)
|
||||
{
|
||||
#if CONFIG_BLE_MESH_BRC_SRV
|
||||
return &bridge_rpl[index];
|
||||
@@ -4587,7 +4584,7 @@ typedef struct {
|
||||
uint16_t (*_bt_mesh_ext_sub_get_sbr_net_idx)(void *sub);
|
||||
void (*_bt_mesh_ext_sub_set_sbr_net_idx)(void *sub, uint16_t sbr_net_idx);
|
||||
void *(*_bt_mesh_ext_brc_srv_get_bridge_table_entry)(void *srv, uint8_t index);
|
||||
void *(*_bt_mesh_ext_brc_srv_get_bridge_rpl)(uint16_t index);
|
||||
void *(*_bt_mesh_ext_brc_srv_get_bridge_rpl)(uint8_t index);
|
||||
/* CONFIG_BLE_MESH_BRC_SRV */
|
||||
|
||||
/* CONFIG_BLE_MESH_AGG_CLI */
|
||||
|
||||
Submodule components/bt/esp_ble_mesh/lib/lib updated: d9fe7de9a9...480089db59
@@ -1493,13 +1493,6 @@ config BT_BLE_FEAT_CONN_SUBRATING
|
||||
help
|
||||
Enable BLE connection subrating feature
|
||||
|
||||
config BT_BLE_VENDOR_HCI_EN
|
||||
bool "Enable BLE Vendor HCI command and event"
|
||||
depends on BT_BLE_ENABLED
|
||||
default y
|
||||
help
|
||||
This enables BLE vendor HCI command and event
|
||||
|
||||
config BT_BLE_HIGH_DUTY_ADV_INTERVAL
|
||||
bool "Enable BLE high duty advertising interval feature"
|
||||
depends on BT_BLE_ENABLED
|
||||
|
||||
@@ -131,6 +131,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_ADV_EN == TRUE)
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
@@ -287,17 +300,83 @@ esp_err_t esp_ble_gap_config_local_privacy (bool privacy_enable)
|
||||
|
||||
esp_err_t esp_ble_gap_config_local_icon (uint16_t icon)
|
||||
{
|
||||
esp_err_t ret;
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_gap_args_t arg;
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_ACT_CONFIG_LOCAL_ICON;
|
||||
arg.cfg_local_icon.icon = icon;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
switch (icon) {
|
||||
case ESP_BLE_APPEARANCE_GENERIC_PHONE:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_COMPUTER:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_REMOTE:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_THERMOMETER:
|
||||
case ESP_BLE_APPEARANCE_THERMOMETER_EAR:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_HEART_RATE:
|
||||
case ESP_BLE_APPEARANCE_HEART_RATE_BELT:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE:
|
||||
case ESP_BLE_APPEARANCE_BLOOD_PRESSURE_ARM:
|
||||
case ESP_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER:
|
||||
case ESP_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP:
|
||||
case ESP_BLE_APPEARANCE_PULSE_OXIMETER_WRIST:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_GLUCOSE:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_WEIGHT:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_WALKING:
|
||||
case ESP_BLE_APPEARANCE_WALKING_IN_SHOE:
|
||||
case ESP_BLE_APPEARANCE_WALKING_ON_SHOE:
|
||||
case ESP_BLE_APPEARANCE_WALKING_ON_HIP:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_WATCH:
|
||||
case ESP_BLE_APPEARANCE_SPORTS_WATCH:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_EYEGLASSES:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_DISPLAY:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER:
|
||||
case ESP_BLE_APPEARANCE_HID_BARCODE_SCANNER:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_HID:
|
||||
case ESP_BLE_APPEARANCE_HID_KEYBOARD:
|
||||
case ESP_BLE_APPEARANCE_HID_MOUSE:
|
||||
case ESP_BLE_APPEARANCE_HID_JOYSTICK:
|
||||
case ESP_BLE_APPEARANCE_HID_GAMEPAD:
|
||||
case ESP_BLE_APPEARANCE_HID_DIGITIZER_TABLET:
|
||||
case ESP_BLE_APPEARANCE_HID_CARD_READER:
|
||||
case ESP_BLE_APPEARANCE_HID_DIGITAL_PEN:
|
||||
case ESP_BLE_APPEARANCE_UNKNOWN:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_CLOCK:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_TAG:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_KEYRING:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_CYCLING:
|
||||
case ESP_BLE_APPEARANCE_CYCLING_COMPUTER:
|
||||
case ESP_BLE_APPEARANCE_CYCLING_SPEED:
|
||||
case ESP_BLE_APPEARANCE_CYCLING_CADENCE:
|
||||
case ESP_BLE_APPEARANCE_CYCLING_POWER:
|
||||
case ESP_BLE_APPEARANCE_CYCLING_SPEED_CADENCE:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE:
|
||||
case ESP_BLE_APPEARANCE_POWERED_WHEELCHAIR:
|
||||
case ESP_BLE_APPEARANCE_MOBILITY_SCOOTER:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_INSULIN_PUMP:
|
||||
case ESP_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP:
|
||||
case ESP_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP:
|
||||
case ESP_BLE_APPEARANCE_INSULIN_PEN:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY:
|
||||
case ESP_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS:
|
||||
case ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION:
|
||||
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;
|
||||
arg.cfg_local_icon.icon = icon;
|
||||
ret = (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
break;
|
||||
default:
|
||||
ret = ESP_ERR_INVALID_ARG;
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_update_whitelist(bool add_remove, esp_bd_addr_t remote_bda, esp_ble_wl_addr_type_t wl_addr_type)
|
||||
@@ -1000,6 +1079,23 @@ esp_err_t esp_ble_gap_set_privacy_mode(esp_ble_addr_type_t addr_type, esp_bd_add
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_set_csa_support(uint8_t csa_select)
|
||||
{
|
||||
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_CSA_SUPPORT;
|
||||
|
||||
arg.set_csa_support.csa_select = csa_select;
|
||||
|
||||
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)
|
||||
@@ -1683,7 +1779,6 @@ esp_err_t esp_ble_gap_set_periodic_adv_sync_trans_params(esp_bd_addr_t addr, con
|
||||
}
|
||||
#endif //#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
esp_err_t esp_ble_gap_vendor_command_send(esp_ble_vendor_cmd_params_t *vendor_cmd_param)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
@@ -1712,7 +1807,7 @@ esp_err_t esp_ble_gap_vendor_command_send(esp_ble_vendor_cmd_params_t *vendor_cm
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_set_vendor_event_mask(esp_ble_vendor_evt_mask_t event_mask)
|
||||
esp_err_t esp_ble_gap_set_vendor_event_mask(uint32_t event_mask)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_gap_args_t arg;
|
||||
@@ -1730,37 +1825,6 @@ esp_err_t esp_ble_gap_set_vendor_event_mask(esp_ble_vendor_evt_mask_t event_mask
|
||||
== 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);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_set_csa_support(uint8_t csa_select)
|
||||
{
|
||||
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_CSA_SUPPORT;
|
||||
|
||||
arg.set_csa_support.csa_select = csa_select;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif // (BLE_VENDOR_HCI_EN == TRUE)
|
||||
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
esp_err_t esp_ble_gap_enhanced_read_transmit_power_level(uint16_t conn_handle, esp_ble_tx_power_phy_t phy)
|
||||
{
|
||||
|
||||
@@ -260,11 +260,6 @@ esp_err_t esp_ble_gatts_stop_service(uint16_t service_handle)
|
||||
esp_err_t esp_ble_gatts_send_indicate(esp_gatt_if_t gatts_if, uint16_t conn_id, uint16_t attr_handle,
|
||||
uint16_t value_len, uint8_t *value, bool need_confirm)
|
||||
{
|
||||
if (value_len > ESP_GATT_MAX_ATTR_LEN) {
|
||||
LOG_ERROR("%s, value_len > ESP_GATT_MAX_ATTR_LEN.", __func__);
|
||||
return ESP_ERR_INVALID_SIZE;
|
||||
}
|
||||
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_gatts_args_t arg;
|
||||
|
||||
@@ -277,7 +272,7 @@ esp_err_t esp_ble_gatts_send_indicate(esp_gatt_if_t gatts_if, uint16_t conn_id,
|
||||
}
|
||||
|
||||
if (L2CA_CheckIsCongest(L2CAP_ATT_CID, p_tcb->peer_bda)) {
|
||||
LOG_DEBUG("%s, the l2cap channel is congest.", __func__);
|
||||
LOG_DEBUG("%s, the l2cap chanel is congest.", __func__);
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +145,6 @@ typedef enum {
|
||||
ESP_AVRC_CT_SET_ABSOLUTE_VOLUME_RSP_EVT = 7, /*!< set absolute volume response event */
|
||||
ESP_AVRC_CT_COVER_ART_STATE_EVT = 8, /*!< cover art client connection state changed event */
|
||||
ESP_AVRC_CT_COVER_ART_DATA_EVT = 9, /*!< cover art client data event */
|
||||
ESP_AVRC_CT_PROF_STATE_EVT = 10, /*!< Indicate AVRCP controller init or deinit complete */
|
||||
} esp_avrc_ct_cb_event_t;
|
||||
|
||||
/// AVRC Target callback events
|
||||
@@ -156,7 +155,6 @@ typedef enum {
|
||||
ESP_AVRC_TG_SET_ABSOLUTE_VOLUME_CMD_EVT = 3, /*!< set absolute volume command from remote device */
|
||||
ESP_AVRC_TG_REGISTER_NOTIFICATION_EVT = 4, /*!< register notification event */
|
||||
ESP_AVRC_TG_SET_PLAYER_APP_VALUE_EVT = 5, /*!< set application attribute value, attribute refer to esp_avrc_ps_attr_ids_t */
|
||||
ESP_AVRC_TG_PROF_STATE_EVT = 6, /*!< Indicate AVRCP target init or deinit complete */
|
||||
} esp_avrc_tg_cb_event_t;
|
||||
|
||||
/// AVRC metadata attribute mask
|
||||
@@ -305,18 +303,6 @@ typedef struct {
|
||||
uint8_t ct_cover_art_conn_num; /*!< Number of cover art client connections */
|
||||
} esp_avrc_profile_status_t;
|
||||
|
||||
/**
|
||||
* @brief Bluetooth AVRCP Initiation states
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_AVRC_INIT_SUCCESS = 0, /*!< Indicate init successful */
|
||||
ESP_AVRC_INIT_ALREADY, /*!< Indicate init repeated */
|
||||
ESP_AVRC_INIT_FAIL, /*!< Indicate init fail */
|
||||
ESP_AVRC_DEINIT_SUCCESS, /*!< Indicate deinit successful */
|
||||
ESP_AVRC_DEINIT_ALREADY, /*!< Indicate deinit repeated */
|
||||
ESP_AVRC_DEINIT_FAIL, /*!< Indicate deinit fail */
|
||||
} esp_avrc_init_state_t;
|
||||
|
||||
/// AVRC controller callback parameters
|
||||
typedef union {
|
||||
/**
|
||||
@@ -404,14 +390,6 @@ typedef union {
|
||||
uint16_t data_len; /*!< the data length of this data event, in bytes */
|
||||
uint8_t *p_data; /*!< pointer to data, should copy to other buff before event callback return */
|
||||
} cover_art_data; /*!< AVRC Cover Art data event */
|
||||
|
||||
/**
|
||||
* @brief ESP_AVRC_CT_PROF_STATE_EVT
|
||||
*/
|
||||
struct avrc_ct_init_stat_param {
|
||||
esp_avrc_init_state_t state; /*!< avrc ct initialization param */
|
||||
} avrc_ct_init_stat; /*!< status to indicate avrcp ct init or deinit */
|
||||
|
||||
} esp_avrc_ct_cb_param_t;
|
||||
|
||||
/// AVRC target callback parameters
|
||||
@@ -464,13 +442,6 @@ typedef union {
|
||||
esp_avrc_set_app_value_param_t *p_vals; /*!< point to the id and value of player application attribute */
|
||||
} set_app_value; /*!< set player application value */
|
||||
|
||||
/**
|
||||
* @brief ESP_AVRC_TG_PROF_STATE_EVT
|
||||
*/
|
||||
struct avrc_tg_init_stat_param {
|
||||
esp_avrc_init_state_t state; /*!< avrc tg initialization param */
|
||||
} avrc_tg_init_stat; /*!< status to indicate avrcp tg init or deinit */
|
||||
|
||||
} esp_avrc_tg_cb_param_t;
|
||||
|
||||
/**
|
||||
@@ -511,7 +482,6 @@ esp_err_t esp_avrc_ct_register_callback(esp_avrc_ct_cb_t callback);
|
||||
* @brief Initialize the bluetooth AVRCP controller module, This function should be called
|
||||
* after esp_bluedroid_enable() completes successfully. Note: AVRC cannot work independently,
|
||||
* AVRC should be used along with A2DP and AVRC should be initialized before A2DP.
|
||||
* ESP_AVRC_CT_PROF_STATE_EVT with ESP_AVRC_INIT_SUCCESS will reported to the APP layer.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
@@ -526,7 +496,6 @@ esp_err_t esp_avrc_ct_init(void);
|
||||
* @brief De-initialize AVRCP controller module. This function should be called after
|
||||
* after esp_bluedroid_enable() completes successfully. Note: AVRC cannot work independently,
|
||||
* AVRC should be used along with A2DP and AVRC should be deinitialized before A2DP.
|
||||
* ESP_AVRC_CT_PROF_STATE_EVT with ESP_AVRC_DEINIT_SUCCESS will reported to the APP layer.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
@@ -667,7 +636,6 @@ esp_err_t esp_avrc_tg_register_callback(esp_avrc_tg_cb_t callback);
|
||||
* @brief Initialize the bluetooth AVRCP target module, This function should be called
|
||||
* after esp_bluedroid_enable() completes successfully. Note: AVRC cannot work independently,
|
||||
* AVRC should be used along with A2DP and AVRC should be initialized before A2DP.
|
||||
* ESP_AVRC_TG_PROF_STATE_EVT with ESP_AVRC_INIT_SUCCESS will reported to the APP layer.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
@@ -682,7 +650,6 @@ esp_err_t esp_avrc_tg_init(void);
|
||||
* @brief De-initialize AVRCP target module. This function should be called after
|
||||
* after esp_bluedroid_enable() completes successfully. Note: AVRC cannot work independently,
|
||||
* AVRC should be used along with A2DP and AVRC should be deinitialized before A2DP.
|
||||
* ESP_AVRC_TG_PROF_STATE_EVT with ESP_AVRC_DEINIT_SUCCESS will reported to the APP layer.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: success
|
||||
|
||||
@@ -282,11 +282,8 @@ typedef enum {
|
||||
|
||||
/// white list address type
|
||||
typedef enum {
|
||||
BLE_WL_ADDR_TYPE_PUBLIC = 0x00, /*!< Public Device Address */
|
||||
BLE_WL_ADDR_TYPE_RANDOM = 0x01, /*!< Random Device Address */
|
||||
#if (CONFIG_BT_BLE_50_FEATURES_SUPPORTED)
|
||||
BLE_WL_ADDR_TYPE_ANONYMOUS = 0xFF, /*!< Devices sending anonymous advertisements, use to enable anonymous advertising report for scanning */
|
||||
#endif // (CONFIG_BT_BLE_50_FEATURES_SUPPORTED)
|
||||
BLE_WL_ADDR_TYPE_PUBLIC = 0x00,
|
||||
BLE_WL_ADDR_TYPE_RANDOM = 0x01,
|
||||
} esp_ble_wl_addr_type_t;
|
||||
|
||||
/// Used to exchange the encryption key in the init key & response key
|
||||
|
||||
@@ -1102,58 +1102,11 @@ typedef struct {
|
||||
} esp_ble_gap_past_params_t;
|
||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
|
||||
typedef enum {
|
||||
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;
|
||||
|
||||
#define ESP_BLE_VENDOR_SCAN_REQ_RECV_EVT_MASK BIT(0) /*!< Vendor BLE legacy SCAN_REQ received event mask */
|
||||
#define ESP_BLE_VENDOR_CHMAP_UPDATE_EVT_MASK BIT(1) /*!< Vendor BLE channel map update event mask */
|
||||
#define ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT_MASK BIT(3) /*!< Vendor BLE sleep wakeup event mask */
|
||||
#define ESP_BLE_VENDOR_CONN_REQ_RECV_EVT_MASK BIT(4) /*!< Vendor BLE CONNECT_IND and AUX_CONNECT_REQ received event mask */
|
||||
#define ESP_BLE_VENDOR_CONN_RSP_RECV_EVT_MASK BIT(5) /*!< Vendor BLE AUX_CONNECT_RSP received event mask */
|
||||
typedef uint32_t esp_ble_vendor_evt_mask_t;
|
||||
|
||||
#define ESP_BLE_VENDOR_PDU_RECV_EVT (0) /*!< Vendor BLE specify PDU received event */
|
||||
#define ESP_BLE_VENDOR_CHAN_MAP_UPDATE_EVT (1) /*!< Vendor BLE channel map update complete event */
|
||||
#define ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT (2) /*!< Vendor BLE sleep wakeup event */
|
||||
typedef uint8_t esp_ble_vendor_evt_t;
|
||||
|
||||
typedef enum {
|
||||
ESP_BLE_VENDOR_PDU_SCAN_REQ = 0, /*!< SCAN_REQ PDU type */
|
||||
ESP_BLE_VENDOR_PDU_CONN_REQ, /*!< CONNECT_IND and AUX_CONNECT_REQ PDU type */
|
||||
ESP_BLE_VENDOR_PDU_CONN_RSP, /*!< AUX_CONNECT_RSP PDU type */
|
||||
} esp_ble_vendor_pdu_t;
|
||||
|
||||
/**
|
||||
* @brief BLE vendor event parameters union
|
||||
*/
|
||||
typedef union {
|
||||
/**
|
||||
* @brief ESP_BLE_VENDOR_PDU_RECV_EVT
|
||||
*/
|
||||
struct ble_pdu_recv_evt_param {
|
||||
esp_ble_vendor_pdu_t type; /*!< The type of LE PDU */
|
||||
uint8_t handle; /*!< The handle of advertising set */
|
||||
esp_ble_addr_type_t addr_type; /*!< The address type of peer device */
|
||||
esp_bd_addr_t peer_addr; /*!< The address of peer device */
|
||||
} pdu_recv; /*!< Event parameter of ESP_BLE_VENDOR_PDU_RECV_EVT */
|
||||
/**
|
||||
* @brief ESP_BLE_VENDOR_CHAN_MAP_UPDATE_EVT
|
||||
*/
|
||||
struct ble_chan_map_update_evt_param {
|
||||
uint8_t status; /*!< Indicate the channel map update status (HCI error code) */
|
||||
uint16_t conn_handle; /*!< The connection handle */
|
||||
esp_gap_ble_channels ch_map; /*!< The channel map after updated */
|
||||
} chan_map_update; /*!< Event parameter of ESP_BLE_VENDOR_CHAN_MAP_UPDATE_EVT */
|
||||
/**
|
||||
* @brief ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT
|
||||
*/
|
||||
struct ble_sleep_wakeup_evt_param {
|
||||
// No parameters
|
||||
} sleep_wakeup; /*!< Event parameter of ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT */
|
||||
} esp_ble_vendor_evt_param_t;
|
||||
|
||||
/**
|
||||
* @brief path loss report parameters
|
||||
*/
|
||||
@@ -1305,6 +1258,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
|
||||
@@ -1706,19 +1665,6 @@ typedef union {
|
||||
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_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 */
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
/**
|
||||
* @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 */
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_VENDOR_CMD_COMPLETE_EVT
|
||||
*/
|
||||
@@ -1727,6 +1673,12 @@ typedef union {
|
||||
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 */
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_SET_CSA_SUPPORT_COMPLETE_EVT
|
||||
*/
|
||||
@@ -1743,12 +1695,10 @@ typedef union {
|
||||
* @brief ESP_GAP_BLE_VENDOR_HCI_EVT
|
||||
*/
|
||||
struct ble_vendor_hci_event_evt_param {
|
||||
esp_ble_vendor_evt_t subevt_code; /*!< Subevent code for BLE vendor HCI event */
|
||||
esp_ble_vendor_evt_param_t param; /*!< Event parameter of BLE vendor HCI subevent */
|
||||
uint8_t param_len; /*!< The length of the event parameter buffer (for internal use only) */
|
||||
uint8_t *param_buf; /*!< The pointer of the event parameter buffer (for internal use only) */
|
||||
} vendor_hci_evt; /*!< Event parameter of ESP_GAP_BLE_VENDOR_HCI_EVT */
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
uint8_t subevt_code; /*!< Subevent code for vendor HCI event, the range is 0xC0 to 0xFF */
|
||||
uint8_t param_len; /*!< The length of the event parameter buffer */
|
||||
uint8_t *param_buf; /*!< The pointer of the event parameter buffer */
|
||||
} vendor_hci_evt; /*!< Event parameter buffer of ESP_GAP_BLE_VENDOR_HCI_EVT */
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_ENH_READ_TRANS_PWR_LEVEL_EVT
|
||||
@@ -2090,19 +2040,15 @@ esp_err_t esp_ble_gap_clear_rand_addr(void);
|
||||
esp_err_t esp_ble_gap_config_local_privacy (bool privacy_enable);
|
||||
|
||||
/**
|
||||
* @brief Set the local GAP appearance icon.
|
||||
* @brief set local gap appearance icon
|
||||
*
|
||||
* @note This API does not restrict the input icon value.
|
||||
* If an undefined or incorrect icon value is used, the device icon may not display properly.
|
||||
*
|
||||
* For a complete list of valid appearance values, please refer to "2.6.2 Appearance Category ranges" at:
|
||||
* @param[in] icon - External appearance value, these values are defined by the Bluetooth SIG, please refer to
|
||||
* https://www.bluetooth.com/specifications/assigned-numbers/
|
||||
*
|
||||
* @param[in] icon - External appearance value (16-bit), as defined by the Bluetooth SIG.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK : Success
|
||||
* - ESP_FAIL : Internal failure
|
||||
* - ESP_OK : success
|
||||
* - other : failed
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_gap_config_local_icon (uint16_t icon);
|
||||
@@ -2780,17 +2726,15 @@ esp_err_t esp_ble_gap_periodic_adv_stop(uint8_t instance);
|
||||
esp_err_t esp_ble_gap_set_ext_scan_params(const esp_ble_ext_scan_params_t *params);
|
||||
|
||||
/**
|
||||
* @brief Enables extended scanning.
|
||||
* @brief This function is used to enable scanning.
|
||||
*
|
||||
* @param[in] duration Scan duration in units of 10 ms.
|
||||
* - Range: 0x0001 to 0xFFFF (Time = N * 10 ms).
|
||||
* - 0x0000: Scan continuously until explicitly disabled.
|
||||
* @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.
|
||||
*
|
||||
* @param[in] period Time interval between the start of consecutive scan durations, in units of 1.28 seconds.
|
||||
* - Range: 0x0001 to 0xFFFF (Time = N * 1.28 sec).
|
||||
* - 0x0000: Scan continuously.
|
||||
* @return - ESP_OK : success
|
||||
* - other : failed
|
||||
*
|
||||
*/
|
||||
esp_err_t esp_ble_gap_start_ext_scan(uint32_t duration, uint16_t period);
|
||||
|
||||
@@ -3082,13 +3026,14 @@ esp_err_t esp_ble_gap_set_csa_support(uint8_t csa_select);
|
||||
/**
|
||||
* @brief This function is used to control which vendor events are generated by the HCI for the Host.
|
||||
*
|
||||
* @param[in] event_mask: The BLE vendor HCI event mask
|
||||
* @param[in] event_mask: Bit0: Legacy scan request received event
|
||||
* Bit1: Vendor channel map update complete event
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK : success
|
||||
* - other : failed
|
||||
*/
|
||||
esp_err_t esp_ble_gap_set_vendor_event_mask(esp_ble_vendor_evt_mask_t event_mask);
|
||||
esp_err_t esp_ble_gap_set_vendor_event_mask(uint32_t event_mask);
|
||||
|
||||
/**
|
||||
* @brief This function is used to read the current and maximum transmit power levels of the local Controller.
|
||||
|
||||
@@ -478,7 +478,7 @@ typedef uint8_t esp_gatt_char_prop_t;
|
||||
*
|
||||
* This definition specifies the maximum number of bytes that a GATT attribute can hold.
|
||||
*/
|
||||
#define ESP_GATT_MAX_ATTR_LEN 517 /*!< As same as GATT_MAX_ATTR_LEN. */
|
||||
#define ESP_GATT_MAX_ATTR_LEN 512 /*!< As same as GATT_MAX_ATTR_LEN. */
|
||||
|
||||
/**
|
||||
* @brief Enumerates the possible sources of a GATT service discovery.
|
||||
|
||||
@@ -345,11 +345,6 @@ esp_err_t esp_bt_hid_device_unregister_app(void);
|
||||
* called after esp_bt_hid_device_init(). When the operation is complete, the callback function will
|
||||
* be called with ESP_HIDD_OPEN_EVT.
|
||||
*
|
||||
* @note The connection between the HID Host and the HID Device is established as a virtual cable by default.
|
||||
* A new HID Host connection request will only be accepted after the previous HID Host has been
|
||||
* explicitly unplugged. For details on disconnection and virtual cable unplugging, please refer to API
|
||||
* `esp_bt_hid_device_disconnect` and `esp_bt_hid_device_virtual_cable_unplug`.
|
||||
*
|
||||
* @param[in] bd_addr: Remote host bluetooth device address.
|
||||
*
|
||||
* @return
|
||||
|
||||
@@ -733,7 +733,6 @@ void bta_dm_cfg_coex_status (tBTA_DM_MSG *p_data)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
void bta_dm_send_vendor_hci(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_VendorSpecificCommand(p_data->vendor_hci_cmd.opcode,
|
||||
@@ -742,28 +741,6 @@ void bta_dm_send_vendor_hci(tBTA_DM_MSG *p_data)
|
||||
p_data->vendor_hci_cmd.vendor_hci_cb);
|
||||
}
|
||||
|
||||
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_csa_support(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
APPL_TRACE_API("%s, csa_select = %d", __func__, p_data->ble_set_csa_support.csa_select);
|
||||
BTM_BleSetCsaSupport(p_data->ble_set_csa_support.csa_select, p_data->ble_set_csa_support.p_cback);
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_set_vendor_evt_mask(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
APPL_TRACE_API("%s, evt_mask = %d", __func__, p_data->ble_set_vendor_evt_mask.evt_mask);
|
||||
BTM_BleSetVendorEventMask(p_data->ble_set_vendor_evt_mask.evt_mask, p_data->ble_set_vendor_evt_mask.p_cback);
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_set_afh_channels
|
||||
@@ -5845,6 +5822,15 @@ void bta_dm_ble_gap_dtm_stop(tBTA_DM_MSG *p_data)
|
||||
}
|
||||
#endif // #if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
|
||||
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);
|
||||
@@ -5867,6 +5853,18 @@ void bta_dm_ble_gap_set_privacy_mode(tBTA_DM_MSG *p_data)
|
||||
p_data->ble_set_privacy_mode.privacy_mode, p_data->ble_set_privacy_mode.p_cback);
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_set_csa_support(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
APPL_TRACE_API("%s, csa_select = %d", __func__, p_data->ble_set_csa_support.csa_select);
|
||||
BTM_BleSetCsaSupport(p_data->ble_set_csa_support.csa_select, p_data->ble_set_csa_support.p_cback);
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_set_vendor_evt_mask(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
APPL_TRACE_API("%s, evt_mask = %d", __func__, p_data->ble_set_vendor_evt_mask.evt_mask);
|
||||
BTM_BleSetVendorEventMask(p_data->ble_set_vendor_evt_mask.evt_mask, p_data->ble_set_vendor_evt_mask.p_cback);
|
||||
}
|
||||
|
||||
void bta_dm_read_ble_channel_map(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
if (p_data && p_data->ch_map.read_ch_map_cb) {
|
||||
|
||||
@@ -231,7 +231,6 @@ void BTA_DmCfgCoexStatus(UINT8 op, UINT8 type, UINT8 status)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
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;
|
||||
@@ -247,57 +246,6 @@ void BTA_DmsendVendorHciCmd(UINT16 opcode, UINT8 param_len, UINT8 *p_param_buf,
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** 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);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapSetCsaSupport(uint8_t csa_select, tBTA_SET_CSA_SUPPORT_CMPL_CBACK *p_callback)
|
||||
{
|
||||
tBTA_DM_API_BLE_SET_CSA_SUPPORT *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_BLE_SET_CSA_SUPPORT *)osi_malloc(sizeof(tBTA_DM_API_BLE_SET_CSA_SUPPORT)))
|
||||
!= NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT;
|
||||
p_msg->csa_select = csa_select;
|
||||
p_msg->p_cback = p_callback;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapSetVendorEventMask(uint32_t evt_mask, tBTA_SET_VENDOR_EVT_MASK_CBACK *p_callback)
|
||||
{
|
||||
tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK *)osi_malloc(sizeof(tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK)))
|
||||
!= NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT;
|
||||
p_msg->evt_mask = evt_mask;
|
||||
p_msg->p_cback = p_callback;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
void BTA_DmConfigEir(tBTA_DM_EIR_CONF *eir_config)
|
||||
@@ -1948,6 +1896,30 @@ extern void BTA_DmBleBroadcast (BOOLEAN start, tBTA_START_STOP_ADV_CMPL_CBACK *p
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** 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 // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
#endif
|
||||
@@ -3042,6 +3014,32 @@ void BTA_DmClearRandAddress(void)
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapSetCsaSupport(uint8_t csa_select, tBTA_SET_CSA_SUPPORT_CMPL_CBACK *p_callback)
|
||||
{
|
||||
tBTA_DM_API_BLE_SET_CSA_SUPPORT *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_BLE_SET_CSA_SUPPORT *)osi_malloc(sizeof(tBTA_DM_API_BLE_SET_CSA_SUPPORT)))
|
||||
!= NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT;
|
||||
p_msg->csa_select = csa_select;
|
||||
p_msg->p_cback = p_callback;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapSetVendorEventMask(uint32_t evt_mask, tBTA_SET_VENDOR_EVT_MASK_CBACK *p_callback)
|
||||
{
|
||||
tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK *)osi_malloc(sizeof(tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK)))
|
||||
!= NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT;
|
||||
p_msg->evt_mask = evt_mask;
|
||||
p_msg->p_cback = p_callback;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
void BTA_DmBleGapEnhReadTransPwrLevel(uint16_t conn_handle, uint8_t phy)
|
||||
{
|
||||
|
||||
@@ -67,12 +67,7 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
#if (ESP_COEX_VSC_INCLUDED == TRUE)
|
||||
bta_dm_cfg_coex_status, /* BTA_DM_API_CFG_COEX_ST_EVT */
|
||||
#endif
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
bta_dm_send_vendor_hci, /* BTA_DM_API_SEND_VENDOR_HCI_CMD_EVT */
|
||||
bta_dm_ble_gap_clear_adv, /* BTA_DM_API_BLE_CLEAR_ADV_EVT */
|
||||
bta_dm_ble_gap_set_csa_support, /* BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT */
|
||||
bta_dm_ble_gap_set_vendor_evt_mask, /* BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT */
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
bta_dm_config_eir, /* BTA_DM_API_CONFIG_EIR_EVT */
|
||||
bta_dm_set_page_timeout, /* BTA_DM_API_PAGE_TO_SET_EVT */
|
||||
@@ -283,9 +278,14 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
#if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
bta_dm_ble_gap_dtm_stop, /* BTA_DM_API_DTM_STOP_EVT */
|
||||
#endif // #if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
bta_dm_ble_gap_clear_adv, /* BTA_DM_API_BLE_CLEAR_ADV_EVT */
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
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 */
|
||||
bta_dm_ble_gap_set_csa_support, /* BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT */
|
||||
bta_dm_ble_gap_set_vendor_evt_mask, /* BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT */
|
||||
bta_dm_read_ble_channel_map, /* BTA_DM_API_BLE_READ_CH_MAP_EVT */
|
||||
#endif
|
||||
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||
|
||||
@@ -57,12 +57,7 @@ enum {
|
||||
#if (ESP_COEX_VSC_INCLUDED == TRUE)
|
||||
BTA_DM_API_CFG_COEX_ST_EVT,
|
||||
#endif
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
BTA_DM_API_SEND_VENDOR_HCI_CMD_EVT,
|
||||
BTA_DM_API_BLE_CLEAR_ADV_EVT,
|
||||
BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT,
|
||||
BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT,
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
BTA_DM_API_CONFIG_EIR_EVT,
|
||||
BTA_DM_API_PAGE_TO_SET_EVT,
|
||||
@@ -274,9 +269,14 @@ enum {
|
||||
#if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
BTA_DM_API_DTM_STOP_EVT,
|
||||
#endif // #if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
BTA_DM_API_BLE_CLEAR_ADV_EVT,
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
BTA_DM_API_SET_RPA_TIMEOUT_EVT,
|
||||
BTA_DM_API_ADD_DEV_TO_RESOLVING_LIST_EVT,
|
||||
BTA_DM_API_SET_PRIVACY_MODE_EVT,
|
||||
BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT,
|
||||
BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT,
|
||||
BTA_DM_API_BLE_READ_CH_MAP_EVT,
|
||||
#endif
|
||||
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||
|
||||
@@ -166,9 +166,9 @@ uint32_t btc_get_ble_status(void)
|
||||
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
// Number of recorded devices
|
||||
extern uint8_t btm_ble_sec_dev_record_count(void);
|
||||
if (btm_ble_sec_dev_record_count()) {
|
||||
status |= BIT(BTC_BLE_STATUS_DEVICE_REC);
|
||||
extern uint8_t btm_ble_sec_dev_active_count(void);
|
||||
if (btm_ble_sec_dev_active_count()) {
|
||||
status |= BIT(BTC_BLE_STATUS_KEYS);
|
||||
}
|
||||
|
||||
// Number of saved bonded devices
|
||||
@@ -216,12 +216,5 @@ uint32_t btc_get_ble_status(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SMP_INCLUDED == TRUE
|
||||
extern uint8_t smp_get_state(void);
|
||||
if (smp_get_state()) {
|
||||
status |= BIT(BTC_BLE_STATUS_SMP_STATE);
|
||||
}
|
||||
#endif
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -34,14 +34,13 @@ typedef enum {
|
||||
BTC_BLE_STATUS_EXT_ADV, // Extended advertising exist
|
||||
BTC_BLE_STATUS_SCAN, // Scanning exist
|
||||
BTC_BLE_STATUS_CONN, // Connection exist
|
||||
BTC_BLE_STATUS_DEVICE_REC, // Device record exist
|
||||
BTC_BLE_STATUS_KEYS, // Device keys record exist
|
||||
BTC_BLE_STATUS_BOND, // Bond info exist
|
||||
BTC_BLE_STATUS_GATTC_CACHE, // GATTC cache exist
|
||||
BTC_BLE_STATUS_GATTC_APP, // GATTC application exist
|
||||
BTC_BLE_STATUS_GATTS_SRVC, // GATTS service exist
|
||||
BTC_BLE_STATUS_PRIVACY, // Privacy enabled
|
||||
BTC_BLE_STATUS_ADDR_RESOLVE_DISABLE,// Address resolution disable status
|
||||
BTC_BLE_STATUS_SMP_STATE, // SMP state machine
|
||||
} tBTC_BLE_STATUS;
|
||||
|
||||
future_t **btc_main_get_future_p(btc_main_future_type_t type);
|
||||
|
||||
@@ -303,6 +303,10 @@ static bool btc_avrc_tg_set_rn_supported_evt(uint16_t evt_set)
|
||||
|
||||
static inline void btc_avrc_ct_cb_to_app(esp_avrc_ct_cb_event_t event, esp_avrc_ct_cb_param_t *param)
|
||||
{
|
||||
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
|
||||
return;
|
||||
}
|
||||
|
||||
esp_avrc_ct_cb_t btc_avrc_ct_cb = (esp_avrc_ct_cb_t)btc_profile_cb_get(BTC_PID_AVRC_CT);
|
||||
if (btc_avrc_ct_cb) {
|
||||
btc_avrc_ct_cb(event, param);
|
||||
@@ -311,6 +315,10 @@ static inline void btc_avrc_ct_cb_to_app(esp_avrc_ct_cb_event_t event, esp_avrc_
|
||||
|
||||
static inline void btc_avrc_tg_cb_to_app(esp_avrc_tg_cb_event_t event, esp_avrc_tg_cb_param_t *param)
|
||||
{
|
||||
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
|
||||
return;
|
||||
}
|
||||
|
||||
esp_avrc_tg_cb_t btc_avrc_tg_cb = (esp_avrc_tg_cb_t)btc_profile_cb_get(BTC_PID_AVRC_TG);
|
||||
if (btc_avrc_tg_cb) {
|
||||
btc_avrc_tg_cb(event, param);
|
||||
@@ -1100,39 +1108,27 @@ BOOLEAN btc_rc_get_connected_peer(BD_ADDR peer_addr)
|
||||
*******************************************************************************/
|
||||
static void btc_avrc_ct_init(void)
|
||||
{
|
||||
esp_avrc_init_state_t state = ESP_AVRC_INIT_SUCCESS;
|
||||
|
||||
BTC_TRACE_DEBUG("## %s ##", __FUNCTION__);
|
||||
if (s_rc_ct_init == BTC_RC_CT_INIT_MAGIC) {
|
||||
BTC_TRACE_WARNING("%s already initialized", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
do {
|
||||
/// initialize CT-specific resources
|
||||
s_rc_ct_init = BTC_RC_CT_INIT_MAGIC;
|
||||
|
||||
if (s_rc_ct_init == BTC_RC_CT_INIT_MAGIC) {
|
||||
BTC_TRACE_WARNING("%s already initialized", __FUNCTION__);
|
||||
state = ESP_AVRC_INIT_ALREADY;
|
||||
break;
|
||||
/// initialize CT-TG shared resources
|
||||
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
|
||||
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb_t));
|
||||
|
||||
if (!g_av_with_rc) {
|
||||
g_av_with_rc = true;
|
||||
}
|
||||
|
||||
/// initialize CT-TG shared resources
|
||||
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
|
||||
if (g_a2dp_on_init) {
|
||||
BTC_TRACE_WARNING("AVRC Controller is expected to be initialized in advance of A2DP !!!");
|
||||
state = ESP_AVRC_INIT_FAIL;
|
||||
break;
|
||||
}
|
||||
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb_t));
|
||||
|
||||
if (!g_av_with_rc) {
|
||||
g_av_with_rc = true;
|
||||
}
|
||||
if (g_a2dp_on_init) {
|
||||
BTC_TRACE_WARNING("AVRC Controller is expected to be initialized in advance of A2DP !!!");
|
||||
}
|
||||
|
||||
/// initialize CT-specific resources
|
||||
s_rc_ct_init = BTC_RC_CT_INIT_MAGIC;
|
||||
} while (0);
|
||||
|
||||
esp_avrc_ct_cb_param_t param = {0};
|
||||
param.avrc_ct_init_stat.state = state;
|
||||
btc_avrc_ct_cb_to_app(ESP_AVRC_CT_PROF_STATE_EVT, ¶m);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1147,37 +1143,29 @@ static void btc_avrc_ct_init(void)
|
||||
***************************************************************************/
|
||||
static void btc_avrc_ct_deinit(void)
|
||||
{
|
||||
esp_avrc_init_state_t state = ESP_AVRC_DEINIT_SUCCESS;
|
||||
|
||||
BTC_TRACE_API("## %s ##", __FUNCTION__);
|
||||
|
||||
do {
|
||||
if (g_a2dp_on_deinit) {
|
||||
BTC_TRACE_WARNING("A2DP already deinit, AVRC CT should deinit in advance of A2DP !!!");
|
||||
if (g_a2dp_on_deinit) {
|
||||
BTC_TRACE_WARNING("A2DP already deinit, AVRC CT should deinit in advance of A2DP !!!");
|
||||
}
|
||||
|
||||
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
|
||||
BTC_TRACE_WARNING("%s not initialized", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
/// deinit CT-specific resources
|
||||
s_rc_ct_init = 0;
|
||||
|
||||
/// deinit CT-TG shared resources
|
||||
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
|
||||
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb_t));
|
||||
if (g_av_with_rc) {
|
||||
g_av_with_rc = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
|
||||
BTC_TRACE_WARNING("%s not initialized", __FUNCTION__);
|
||||
state = ESP_AVRC_DEINIT_ALREADY;
|
||||
break;
|
||||
}
|
||||
|
||||
/// deinit CT-specific resources
|
||||
s_rc_ct_init = 0;
|
||||
|
||||
/// deinit CT-TG shared resources
|
||||
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
|
||||
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb_t));
|
||||
if (g_av_with_rc) {
|
||||
g_av_with_rc = false;
|
||||
}
|
||||
}
|
||||
BTC_TRACE_API("## %s ## completed", __FUNCTION__);
|
||||
} while (0);
|
||||
|
||||
esp_avrc_ct_cb_param_t param = {0};
|
||||
param.avrc_ct_init_stat.state = state;
|
||||
btc_avrc_ct_cb_to_app(ESP_AVRC_CT_PROF_STATE_EVT, ¶m);
|
||||
BTC_TRACE_API("## %s ## completed", __FUNCTION__);
|
||||
}
|
||||
|
||||
static bt_status_t btc_avrc_ct_send_set_player_value_cmd(uint8_t tl, uint8_t attr_id, uint8_t value_id)
|
||||
@@ -1486,42 +1474,30 @@ static void btc_avrc_ct_cover_art_get_linked_thumbnail(UINT8 *image_handle)
|
||||
*******************************************************************************/
|
||||
static void btc_avrc_tg_init(void)
|
||||
{
|
||||
esp_avrc_init_state_t state = ESP_AVRC_INIT_SUCCESS;
|
||||
|
||||
BTC_TRACE_DEBUG("## %s ##", __FUNCTION__);
|
||||
if (s_rc_tg_init == BTC_RC_TG_INIT_MAGIC) {
|
||||
BTC_TRACE_WARNING("%s already initialized", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
do {
|
||||
if (s_rc_tg_init == BTC_RC_TG_INIT_MAGIC) {
|
||||
BTC_TRACE_WARNING("%s already initialized", __FUNCTION__);
|
||||
state = ESP_AVRC_INIT_ALREADY;
|
||||
break;
|
||||
/// initialize TG-specific resources
|
||||
memcpy(s_psth_supported_cmd, cs_psth_dft_supported_cmd, sizeof(s_psth_supported_cmd));
|
||||
s_rn_supported_evt = cs_rn_dft_supported_evt;
|
||||
|
||||
/// initialize CT-TG shared resources
|
||||
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
|
||||
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb));
|
||||
|
||||
if (!g_av_with_rc) {
|
||||
g_av_with_rc = true;
|
||||
}
|
||||
|
||||
/// initialize CT-TG shared resources
|
||||
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
|
||||
if (g_a2dp_on_init) {
|
||||
BTC_TRACE_WARNING("AVRC Target is expected to be initialized in advance of A2DP !!!");
|
||||
state = ESP_AVRC_INIT_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb));
|
||||
|
||||
if (!g_av_with_rc) {
|
||||
g_av_with_rc = true;
|
||||
}
|
||||
if (g_a2dp_on_init) {
|
||||
BTC_TRACE_WARNING("AVRC Target is expected to be initialized in advance of A2DP !!!");
|
||||
}
|
||||
}
|
||||
|
||||
/// initialize TG-specific resources
|
||||
memcpy(s_psth_supported_cmd, cs_psth_dft_supported_cmd, sizeof(s_psth_supported_cmd));
|
||||
s_rn_supported_evt = cs_rn_dft_supported_evt;
|
||||
|
||||
s_rc_tg_init = BTC_RC_TG_INIT_MAGIC;
|
||||
} while (0);
|
||||
|
||||
esp_avrc_tg_cb_param_t param = {0};
|
||||
param.avrc_tg_init_stat.state = state;
|
||||
btc_avrc_tg_cb_to_app(ESP_AVRC_TG_PROF_STATE_EVT, ¶m);
|
||||
s_rc_tg_init = BTC_RC_TG_INIT_MAGIC;
|
||||
}
|
||||
|
||||
|
||||
@@ -1536,40 +1512,31 @@ static void btc_avrc_tg_init(void)
|
||||
***************************************************************************/
|
||||
static void btc_avrc_tg_deinit(void)
|
||||
{
|
||||
esp_avrc_init_state_t state = ESP_AVRC_DEINIT_SUCCESS;
|
||||
|
||||
BTC_TRACE_API("## %s ##", __FUNCTION__);
|
||||
|
||||
do {
|
||||
if (g_a2dp_on_deinit) {
|
||||
BTC_TRACE_WARNING("A2DP already deinit, AVRC TG should deinit in advance of A2DP !!!");
|
||||
if (g_a2dp_on_deinit) {
|
||||
BTC_TRACE_WARNING("A2DP already deinit, AVRC TG should deinit in advance of A2DP !!!");
|
||||
}
|
||||
|
||||
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
|
||||
BTC_TRACE_WARNING("%s not initialized", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
/// deinit TG-specific resources
|
||||
memset(s_psth_supported_cmd, 0, sizeof(s_psth_supported_cmd));
|
||||
s_rn_supported_evt = 0;
|
||||
s_rc_tg_init = 0;
|
||||
|
||||
/// deinit CT-TG shared resources
|
||||
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
|
||||
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb));
|
||||
if (g_av_with_rc) {
|
||||
g_av_with_rc = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
|
||||
BTC_TRACE_WARNING("%s not initialized", __FUNCTION__);
|
||||
state = ESP_AVRC_DEINIT_ALREADY;
|
||||
break;
|
||||
}
|
||||
|
||||
/// deinit TG-specific resources
|
||||
memset(s_psth_supported_cmd, 0, sizeof(s_psth_supported_cmd));
|
||||
s_rn_supported_evt = 0;
|
||||
s_rc_tg_init = 0;
|
||||
|
||||
/// deinit CT-TG shared resources
|
||||
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
|
||||
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb));
|
||||
if (g_av_with_rc) {
|
||||
g_av_with_rc = false;
|
||||
}
|
||||
}
|
||||
|
||||
BTC_TRACE_API("## %s ## completed", __FUNCTION__);
|
||||
} while (0);
|
||||
|
||||
esp_avrc_tg_cb_param_t param = {0};
|
||||
param.avrc_tg_init_stat.state = state;
|
||||
btc_avrc_tg_cb_to_app(ESP_AVRC_TG_PROF_STATE_EVT, ¶m);
|
||||
BTC_TRACE_API("## %s ## completed", __FUNCTION__);
|
||||
}
|
||||
|
||||
static void btc_avrc_tg_send_rn_rsp(esp_avrc_rn_event_ids_t event_id, esp_avrc_rn_rsp_t rsp, const esp_avrc_rn_param_t *param)
|
||||
|
||||
@@ -467,6 +467,25 @@ static void btc_stop_adv_callback(uint8_t status)
|
||||
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_clear_adv_callback(uint8_t status)
|
||||
{
|
||||
esp_ble_gap_cb_param_t param;
|
||||
bt_status_t ret;
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT;
|
||||
param.adv_clear_cmpl.status = btc_hci_to_esp_status(status);
|
||||
|
||||
ret = btc_transfer_context(&msg, ¶m,
|
||||
sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
|
||||
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
void btc_update_duplicate_exceptional_list_callback(tBTA_STATUS status, uint8_t subcode, uint32_t length, uint8_t *device_info)
|
||||
@@ -1387,45 +1406,6 @@ void btc_dtm_stop_callback(void *p1)
|
||||
}
|
||||
#endif // #if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
|
||||
static void btc_ble_set_privacy_mode_callback(UINT8 status)
|
||||
{
|
||||
esp_ble_gap_cb_param_t param;
|
||||
bt_status_t ret;
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT;
|
||||
|
||||
param.set_privacy_mode_cmpl.status = btc_btm_status_to_esp_status(status);
|
||||
|
||||
ret = btc_transfer_context(&msg, ¶m, sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
|
||||
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
static void btc_clear_adv_callback(uint8_t status)
|
||||
{
|
||||
esp_ble_gap_cb_param_t param;
|
||||
bt_status_t ret;
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT;
|
||||
param.adv_clear_cmpl.status = btc_hci_to_esp_status(status);
|
||||
|
||||
ret = btc_transfer_context(&msg, ¶m,
|
||||
sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
|
||||
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_ble_vendor_hci_cmd_complete_callback(tBTA_VSC_CMPL *p_param)
|
||||
{
|
||||
bool param_invalid = false;
|
||||
@@ -1462,6 +1442,25 @@ static void btc_ble_vendor_hci_cmd_complete_callback(tBTA_VSC_CMPL *p_param)
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_ble_set_privacy_mode_callback(UINT8 status)
|
||||
{
|
||||
esp_ble_gap_cb_param_t param;
|
||||
bt_status_t ret;
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT;
|
||||
|
||||
param.set_privacy_mode_cmpl.status = btc_btm_status_to_esp_status(status);
|
||||
|
||||
ret = btc_transfer_context(&msg, ¶m, sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
|
||||
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_ble_set_csa_support_callback(UINT8 status)
|
||||
{
|
||||
esp_ble_gap_cb_param_t param;
|
||||
@@ -1491,7 +1490,7 @@ static void btc_ble_set_vendor_evt_mask_callback(UINT8 status)
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = ESP_GAP_BLE_SET_VENDOR_EVT_MASK_COMPLETE_EVT;
|
||||
|
||||
param.set_vendor_evt_mask_cmpl.status = btc_btm_status_to_esp_status(status);
|
||||
param.set_csa_support_cmpl.status = btc_btm_status_to_esp_status(status);
|
||||
|
||||
ret = btc_transfer_context(&msg, ¶m, sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
|
||||
|
||||
@@ -1505,52 +1504,20 @@ static void btc_ble_vendor_hci_event_callback(UINT8 subevt_code, UINT8 param_len
|
||||
esp_ble_gap_cb_param_t param = {0};
|
||||
bt_status_t ret;
|
||||
btc_msg_t msg = {0};
|
||||
esp_ble_vendor_evt_param_t *evt_param = ¶m.vendor_hci_evt.param;
|
||||
bool copy_param = false;
|
||||
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = ESP_GAP_BLE_VENDOR_HCI_EVT;
|
||||
|
||||
param.vendor_hci_evt.subevt_code = subevt_code;
|
||||
param.vendor_hci_evt.param_len = 0;
|
||||
param.vendor_hci_evt.param_buf = NULL;
|
||||
switch (subevt_code) {
|
||||
case BLE_VENDOR_PDU_RECV_EVT:
|
||||
param.vendor_hci_evt.subevt_code = ESP_BLE_VENDOR_PDU_RECV_EVT;
|
||||
STREAM_TO_UINT8(evt_param->pdu_recv.type, params);
|
||||
STREAM_TO_UINT8(evt_param->pdu_recv.handle, params);
|
||||
STREAM_TO_UINT8(evt_param->pdu_recv.addr_type, params);
|
||||
STREAM_TO_BDADDR(evt_param->pdu_recv.peer_addr, params);
|
||||
break;
|
||||
case BLE_VENDOR_CHMAP_UPDATE_EVT:
|
||||
param.vendor_hci_evt.subevt_code = ESP_BLE_VENDOR_CHAN_MAP_UPDATE_EVT;
|
||||
STREAM_TO_UINT8(evt_param->chan_map_update.status, params);
|
||||
STREAM_TO_UINT16(evt_param->chan_map_update.conn_handle, params);
|
||||
REVERSE_STREAM_TO_ARRAY(evt_param->chan_map_update.ch_map, params, ESP_GAP_BLE_CHANNELS_LEN);
|
||||
break;
|
||||
case BLE_VENDOR_SLEEP_WAKEUP_EVT:
|
||||
param.vendor_hci_evt.subevt_code = ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT;
|
||||
// No parameters
|
||||
break;
|
||||
default:
|
||||
copy_param = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (copy_param) {
|
||||
param.vendor_hci_evt.param_len = param_len;
|
||||
param.vendor_hci_evt.param_buf = (param_len) ? params : NULL;
|
||||
ret = btc_transfer_context(&msg, ¶m, sizeof(esp_ble_gap_cb_param_t), btc_gap_ble_cb_deep_copy, btc_gap_ble_cb_deep_free);
|
||||
} else {
|
||||
ret = btc_transfer_context(&msg, ¶m, sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
|
||||
}
|
||||
param.vendor_hci_evt.param_len = param_len;
|
||||
param.vendor_hci_evt.param_buf = params;
|
||||
ret = btc_transfer_context(&msg, ¶m, sizeof(esp_ble_gap_cb_param_t), btc_gap_ble_cb_deep_copy, btc_gap_ble_cb_deep_free);
|
||||
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
|
||||
void btc_get_whitelist_size(uint16_t *length)
|
||||
{
|
||||
@@ -1585,6 +1552,11 @@ static void btc_ble_stop_advertising(tBTA_START_STOP_ADV_CMPL_CBACK *stop_adv_cb
|
||||
|
||||
BTA_DmBleBroadcast(stop_adv, stop_adv_cb);
|
||||
}
|
||||
|
||||
static void btc_ble_clear_advertising(tBTA_CLEAR_ADV_CMPL_CBACK *clear_adv_cb)
|
||||
{
|
||||
BTA_DmBleClearAdv(clear_adv_cb);
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
@@ -1927,7 +1899,6 @@ void btc_gap_ble_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
case BTC_GAP_BLE_ACT_VENDOR_HCI_CMD_EVT: {
|
||||
btc_ble_gap_args_t *src = (btc_ble_gap_args_t *)p_src;
|
||||
btc_ble_gap_args_t *dst = (btc_ble_gap_args_t *)p_dest;
|
||||
@@ -1941,7 +1912,6 @@ void btc_gap_ble_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
case BTC_GAP_BLE_ACT_SET_DEV_NAME:{
|
||||
btc_ble_gap_args_t *src = (btc_ble_gap_args_t *)p_src;
|
||||
btc_ble_gap_args_t *dst = (btc_ble_gap_args_t *)p_dest;
|
||||
@@ -2095,7 +2065,6 @@ void btc_gap_ble_arg_deep_free(btc_msg_t *msg)
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
case BTC_GAP_BLE_ACT_VENDOR_HCI_CMD_EVT: {
|
||||
uint8_t *p_param_buf = ((btc_ble_gap_args_t *)msg->arg)->vendor_cmd_send.p_param_buf;
|
||||
if (p_param_buf) {
|
||||
@@ -2103,7 +2072,6 @@ void btc_gap_ble_arg_deep_free(btc_msg_t *msg)
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
case BTC_GAP_BLE_ACT_SET_DEV_NAME:{
|
||||
char *p_name = ((btc_ble_gap_args_t *)msg->arg)->set_dev_name.device_name;
|
||||
if (p_name) {
|
||||
@@ -2188,6 +2156,9 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
|
||||
case BTC_GAP_BLE_ACT_STOP_ADV:
|
||||
btc_ble_stop_advertising(btc_stop_adv_callback);
|
||||
break;
|
||||
case BTC_GAP_BLE_ACT_CLEAR_ADV:
|
||||
btc_ble_clear_advertising(btc_clear_adv_callback);
|
||||
break;
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
case BTC_GAP_BLE_ACT_UPDATE_CONN_PARAM:
|
||||
@@ -2647,27 +2618,22 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
|
||||
btc_ble_dtm_enhance_rx_start(arg_5->dtm_enh_rx_start.rx_channel, arg_5->dtm_enh_rx_start.phy, arg_5->dtm_enh_rx_start.modulation_index, btc_dtm_rx_start_callback);
|
||||
break;
|
||||
#endif // #if (BLE_50_DTM_TEST_EN == TRUE)
|
||||
case BTC_GAP_BLE_SET_PRIVACY_MODE:
|
||||
btc_ble_set_privacy_mode(arg->set_privacy_mode.addr_type, arg->set_privacy_mode.addr,
|
||||
arg->set_privacy_mode.privacy_mode, btc_ble_set_privacy_mode_callback);
|
||||
break;
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
case BTC_GAP_BLE_ACT_CLEAR_ADV:
|
||||
BTA_DmBleClearAdv(btc_clear_adv_callback);
|
||||
break;
|
||||
case BTC_GAP_BLE_ACT_VENDOR_HCI_CMD_EVT:
|
||||
BTA_DmsendVendorHciCmd(arg->vendor_cmd_send.opcode,
|
||||
arg->vendor_cmd_send.param_len,
|
||||
arg->vendor_cmd_send.p_param_buf,
|
||||
btc_ble_vendor_hci_cmd_complete_callback);
|
||||
break;
|
||||
case BTC_GAP_BLE_SET_PRIVACY_MODE:
|
||||
btc_ble_set_privacy_mode(arg->set_privacy_mode.addr_type, arg->set_privacy_mode.addr,
|
||||
arg->set_privacy_mode.privacy_mode, btc_ble_set_privacy_mode_callback);
|
||||
break;
|
||||
case BTC_GAP_BLE_SET_CSA_SUPPORT:
|
||||
BTA_DmBleGapSetCsaSupport(arg->set_csa_support.csa_select, btc_ble_set_csa_support_callback);
|
||||
break;
|
||||
case BTC_GAP_BLE_ACT_SET_VENDOR_EVT_MASK:
|
||||
BTA_DmBleGapSetVendorEventMask(arg->set_vendor_evt_mask.evt_mask, btc_ble_set_vendor_evt_mask_callback);
|
||||
break;
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
case BTC_GAP_BLE_ENH_READ_TRANS_POWER_LEVEL:
|
||||
BTA_DmBleGapEnhReadTransPwrLevel(arg_5->enh_read_trans_pwr_level.conn_handle, arg_5->enh_read_trans_pwr_level.phy);
|
||||
@@ -2716,9 +2682,7 @@ void btc_gap_callback_init(void)
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
BTM_BleGapRegisterCallback(btc_ble_5_gap_callback);
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
BTM_BleRegisterVendorHciEventCallback(btc_ble_vendor_hci_event_callback);
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
}
|
||||
|
||||
bool btc_gap_ble_init(void)
|
||||
|
||||
@@ -24,10 +24,6 @@ extern tBTA_BLE_ADV_DATA *gl_bta_scan_rsp_data_ptr;
|
||||
|
||||
#define BLE_ISVALID_PARAM(x, min, max) (((x) >= (min) && (x) <= (max)))
|
||||
|
||||
#define BLE_VENDOR_PDU_RECV_EVT (0xC0)
|
||||
#define BLE_VENDOR_CHMAP_UPDATE_EVT (0xC1)
|
||||
#define BLE_VENDOR_SLEEP_WAKEUP_EVT (0xC3)
|
||||
|
||||
typedef enum {
|
||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
BTC_GAP_BLE_ACT_CFG_ADV_DATA = 0,
|
||||
@@ -117,15 +113,15 @@ typedef enum {
|
||||
BTC_GAP_BLE_DTM_RX_START,
|
||||
#endif // #if (BLE_42_DTM_TEST_EN == TRUE)
|
||||
BTC_GAP_BLE_DTM_STOP,
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
BTC_GAP_BLE_ACT_CLEAR_ADV,
|
||||
BTC_GAP_BLE_ACT_VENDOR_HCI_CMD_EVT,
|
||||
BTC_GAP_BLE_SET_CSA_SUPPORT,
|
||||
BTC_GAP_BLE_ACT_SET_VENDOR_EVT_MASK,
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
BTC_GAP_BLE_ACT_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT,
|
||||
BTC_GAP_BLE_ACT_ADD_DEVICE_TO_RESOLVING_LIST,
|
||||
BTC_GAP_BLE_ACT_VENDOR_HCI_CMD_EVT,
|
||||
BTC_GAP_BLE_SET_PRIVACY_MODE,
|
||||
BTC_GAP_BLE_SET_CSA_SUPPORT,
|
||||
BTC_GAP_BLE_ACT_SET_VENDOR_EVT_MASK,
|
||||
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
BTC_GAP_BLE_ENH_READ_TRANS_POWER_LEVEL,
|
||||
BTC_GAP_BLE_READ_REM_TRANS_POWER_LEVEL,
|
||||
|
||||
@@ -364,12 +364,6 @@
|
||||
#define UC_BT_BLE_FEAT_CONN_SUBRATING FALSE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_BLE_VENDOR_HCI_EN
|
||||
#define UC_BT_BLE_VENDOR_HCI_EN CONFIG_BT_BLE_VENDOR_HCI_EN
|
||||
#else
|
||||
#define UC_BT_BLE_VENDOR_HCI_EN FALSE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL
|
||||
#define UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL
|
||||
#else
|
||||
|
||||
@@ -415,12 +415,6 @@
|
||||
#define BLE_FEAT_CONN_SUBRATING FALSE
|
||||
#endif
|
||||
|
||||
#if (UC_BT_BLE_VENDOR_HCI_EN == TRUE)
|
||||
#define BLE_VENDOR_HCI_EN TRUE
|
||||
#else
|
||||
#define BLE_VENDOR_HCI_EN FALSE
|
||||
#endif
|
||||
|
||||
#if (UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL == TRUE)
|
||||
#define BLE_HIGH_DUTY_ADV_INTERVAL TRUE
|
||||
#else
|
||||
|
||||
@@ -223,10 +223,12 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
#if (BT_BLE_LOG_SPI_OUT_HOST_ENABLED && !CLASSIC_BT_INCLUDED)
|
||||
|
||||
#define BTM_TRACE_ERROR(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_ERROR, "BT_BTM", fmt, ## args); \
|
||||
if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR && BT_LOG_LEVEL_CHECK(BTM, ERROR)) BT_PRINT_E("BT_BTM", fmt, ## args); \
|
||||
}
|
||||
|
||||
#define BTM_TRACE_WARNING(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_WARN, "BT_BTM", fmt, ## args); \
|
||||
if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING && BT_LOG_LEVEL_CHECK(BTM, WARNING)) BT_PRINT_W("BT_BTM", fmt, ## args); \
|
||||
}
|
||||
|
||||
@@ -241,6 +243,7 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
}
|
||||
|
||||
#define BTM_TRACE_DEBUG(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_BTM", fmt, ## args); \
|
||||
if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG && BT_LOG_LEVEL_CHECK(BTM, DEBUG)) BT_PRINT_D("BT_BTM", fmt, ## args); \
|
||||
}
|
||||
|
||||
@@ -259,10 +262,12 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
#if (BT_BLE_LOG_SPI_OUT_HOST_ENABLED && !CLASSIC_BT_INCLUDED)
|
||||
|
||||
#define L2CAP_TRACE_ERROR(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_ERROR, "BT_L2CAP", fmt, ## args); \
|
||||
if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR && BT_LOG_LEVEL_CHECK(L2CAP, ERROR)) BT_PRINT_E("BT_L2CAP", fmt, ## args); \
|
||||
}
|
||||
|
||||
#define L2CAP_TRACE_WARNING(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_WARN, "BT_L2CAP", fmt, ## args); \
|
||||
if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING && BT_LOG_LEVEL_CHECK(L2CAP, WARNING)) BT_PRINT_W("BT_L2CAP", fmt, ## args); \
|
||||
}
|
||||
|
||||
@@ -272,10 +277,12 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
}
|
||||
|
||||
#define L2CAP_TRACE_EVENT(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_L2CAP", fmt, ## args); \
|
||||
if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT && BT_LOG_LEVEL_CHECK(L2CAP, EVENT)) BT_PRINT_D("BT_L2CAP", fmt, ## args); \
|
||||
}
|
||||
|
||||
#define L2CAP_TRACE_DEBUG(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_L2CAP", fmt, ## args); \
|
||||
if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG && BT_LOG_LEVEL_CHECK(L2CAP, DEBUG)) BT_PRINT_D("BT_L2CAP", fmt, ## args); \
|
||||
}
|
||||
|
||||
@@ -310,10 +317,12 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
#if (BT_BLE_LOG_SPI_OUT_HOST_ENABLED && !CLASSIC_BT_INCLUDED)
|
||||
|
||||
#define GAP_TRACE_ERROR(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_ERROR, "BT_GAP", fmt, ## args); \
|
||||
if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR && BT_LOG_LEVEL_CHECK(GAP, ERROR)) BT_PRINT_E("BT_GAP", fmt, ## args); \
|
||||
}
|
||||
|
||||
#define GAP_TRACE_WARNING(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_WARN, "BT_GAP", fmt, ## args); \
|
||||
if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING && BT_LOG_LEVEL_CHECK(GAP, WARNING)) BT_PRINT_W("BT_GAP", fmt, ## args); \
|
||||
}
|
||||
|
||||
@@ -323,6 +332,7 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
}
|
||||
|
||||
#define GAP_TRACE_EVENT(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_GAP", fmt, ## args); \
|
||||
if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT && BT_LOG_LEVEL_CHECK(GAP, EVENT)) BT_PRINT_D("BT_GAP", fmt, ## args); \
|
||||
}
|
||||
|
||||
@@ -440,10 +450,12 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
#if (BT_BLE_LOG_SPI_OUT_HOST_ENABLED && !CLASSIC_BT_INCLUDED)
|
||||
|
||||
#define GATT_TRACE_ERROR(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_ERROR, "BT_GATT", fmt, ## args); \
|
||||
if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR && BT_LOG_LEVEL_CHECK(GATT, ERROR)) BT_PRINT_E("BT_GATT", fmt, ## args); \
|
||||
}
|
||||
|
||||
#define GATT_TRACE_WARNING(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_WARN, "BT_GATT", fmt, ## args); \
|
||||
if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING && BT_LOG_LEVEL_CHECK(GATT, WARNING)) BT_PRINT_W("BT_GATT", fmt, ## args); \
|
||||
}
|
||||
|
||||
@@ -453,10 +465,12 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
}
|
||||
|
||||
#define GATT_TRACE_EVENT(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_GATT", fmt, ## args); \
|
||||
if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT && BT_LOG_LEVEL_CHECK(GATT, EVENT)) BT_PRINT_D("BT_GATT", fmt, ## args); \
|
||||
}
|
||||
|
||||
#define GATT_TRACE_DEBUG(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_GATT", fmt, ## args); \
|
||||
if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG && BT_LOG_LEVEL_CHECK(GATT, DEBUG)) BT_PRINT_D("BT_GATT", fmt, ## args); \
|
||||
}
|
||||
|
||||
@@ -475,10 +489,12 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
#if (BT_BLE_LOG_SPI_OUT_HOST_ENABLED && !CLASSIC_BT_INCLUDED)
|
||||
|
||||
#define SMP_TRACE_ERROR(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_ERROR, "BT_SMP", fmt, ## args); \
|
||||
if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR && BT_LOG_LEVEL_CHECK(SMP, ERROR)) BT_PRINT_E("BT_SMP", fmt, ## args); \
|
||||
}
|
||||
|
||||
#define SMP_TRACE_WARNING(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_WARN, "BT_SMP", fmt, ## args); \
|
||||
if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING && BT_LOG_LEVEL_CHECK(SMP, WARNING)) BT_PRINT_W("BT_SMP", fmt, ## args); \
|
||||
}
|
||||
|
||||
@@ -488,10 +504,12 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
|
||||
}
|
||||
|
||||
#define SMP_TRACE_EVENT(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_SMP", fmt, ## args); \
|
||||
if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT && BT_LOG_LEVEL_CHECK(SMP, EVENT)) BT_PRINT_D("BT_SMP", fmt, ## args); \
|
||||
}
|
||||
|
||||
#define SMP_TRACE_DEBUG(fmt, args...) { \
|
||||
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_SMP", fmt, ## args); \
|
||||
if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG && BT_LOG_LEVEL_CHECK(SMP, DEBUG)) BT_PRINT_D("BT_SMP", fmt, ## args); \
|
||||
}
|
||||
|
||||
|
||||
@@ -2946,7 +2946,7 @@ uint8_t btm_ble_scan_active_count(void)
|
||||
}
|
||||
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
uint8_t btm_ble_sec_dev_record_count(void)
|
||||
uint8_t btm_ble_sec_dev_active_count(void)
|
||||
{
|
||||
tBTM_SEC_DEV_REC *p_dev_rec = NULL;
|
||||
list_node_t *p_node = NULL;
|
||||
@@ -2962,12 +2962,6 @@ uint8_t btm_ble_sec_dev_record_count(void)
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
void btm_ble_clear_sec_dev_record(void)
|
||||
{
|
||||
/* only used when connection is closed */
|
||||
if(btm_cb.p_sec_dev_rec_list) list_clear(btm_cb.p_sec_dev_rec_list);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (BLE_PRIVACY_SPT == TRUE)
|
||||
|
||||
@@ -613,7 +613,6 @@ tBTM_STATUS BTM_BleStartExtAdvRestart(uint8_t con_handle)
|
||||
}
|
||||
|
||||
if((index >= MAX_BLE_ADV_INSTANCE) || (!adv_record[index].invalid)) {
|
||||
BTM_TRACE_WARNING("%s failed to find extend adv, adv_handle %u con_handle %u", __func__, index, con_handle);
|
||||
return BTM_WRONG_MODE;
|
||||
}
|
||||
|
||||
@@ -1255,7 +1254,7 @@ void btm_ble_adv_set_terminated_evt(tBTM_BLE_ADV_TERMINAT *params)
|
||||
}
|
||||
|
||||
// adv terminated due to connection, save the adv handle and connection handle
|
||||
if(params->status == 0x00) {
|
||||
if(params->completed_event == 0x00) {
|
||||
adv_record[params->adv_handle].ter_con_handle = params->conn_handle;
|
||||
} else {
|
||||
adv_record[params->adv_handle].ter_con_handle = INVALID_VALUE;
|
||||
|
||||
@@ -201,12 +201,7 @@ BOOLEAN btm_add_dev_to_controller (BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_TY
|
||||
|
||||
/* Controller do not support resolvable address now, only support public address and static random address */
|
||||
BOOLEAN started = FALSE;
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
if (wl_addr_type > BLE_ADDR_RANDOM && wl_addr_type != BLE_ADDR_ANONYMOUS)
|
||||
#else
|
||||
if (wl_addr_type > BLE_ADDR_RANDOM)
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
{
|
||||
if(wl_addr_type > BLE_ADDR_RANDOM) {
|
||||
BTM_TRACE_ERROR("wl_addr_type is error\n");
|
||||
return started;
|
||||
}
|
||||
@@ -283,12 +278,7 @@ void btm_enq_wl_dev_operation(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_TYPE ad
|
||||
*******************************************************************************/
|
||||
BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type, tBTM_UPDATE_WHITELIST_CBACK *update_wl_cb)
|
||||
{
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
if (addr_type > BLE_ADDR_RANDOM && addr_type != BLE_ADDR_ANONYMOUS)
|
||||
#else
|
||||
if (addr_type > BLE_ADDR_RANDOM)
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
{
|
||||
if(addr_type > BLE_ADDR_RANDOM) {
|
||||
BTM_TRACE_ERROR("%s address type is error, unable to add device", __func__);
|
||||
if (update_wl_cb){
|
||||
update_wl_cb(HCI_ERR_ILLEGAL_PARAMETER_FMT,to_add);
|
||||
|
||||
@@ -72,9 +72,7 @@ static tBTM_BLE_CTRL_FEATURES_CBACK *p_ctrl_le_feature_rd_cmpl_cback = NULL;
|
||||
|
||||
tBTM_CallbackFunc conn_callback_func;
|
||||
// BLE vendor HCI event callback
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
static tBTM_BLE_VENDOR_HCI_EVT_CBACK *ble_vs_evt_callback = NULL;
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
** Local functions
|
||||
*******************************************************************************/
|
||||
@@ -355,12 +353,10 @@ void BTM_BleRegiseterPktLengthChangeCallback(tBTM_SET_PKT_DATA_LENGTH_CBACK *ptk
|
||||
conn_callback_func.set_pkt_data_length_cb = ptk_len_chane_cb;
|
||||
}
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
void BTM_BleRegisterVendorHciEventCallback(tBTM_BLE_VENDOR_HCI_EVT_CBACK *vendor_hci_evt_cb)
|
||||
{
|
||||
ble_vs_evt_callback = vendor_hci_evt_cb;
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -4552,7 +4548,6 @@ BOOLEAN btm_ble_update_mode_operation(UINT8 link_role, BD_ADDR bd_addr, UINT8 st
|
||||
return bg_con;
|
||||
}
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
static void btm_ble_vs_evt_callback(UINT8 len, UINT8 *p)
|
||||
{
|
||||
UINT8 sub_event;
|
||||
@@ -4564,7 +4559,7 @@ static void btm_ble_vs_evt_callback(UINT8 len, UINT8 *p)
|
||||
STREAM_TO_UINT8(sub_event, p);
|
||||
len--;
|
||||
|
||||
if (sub_event < HCI_VSE_LE_SUBEVT_BASE) {
|
||||
if (sub_event < HCI_VSE_LE_LEGACY_SCAN_REQ_RECEIVED_EVT) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4572,7 +4567,6 @@ static void btm_ble_vs_evt_callback(UINT8 len, UINT8 *p)
|
||||
ble_vs_evt_callback(sub_event, len, p);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -4632,9 +4626,8 @@ void btm_ble_init (void)
|
||||
btm_ble_adv_filter_init();
|
||||
#endif // #if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
|
||||
#endif
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
|
||||
BTM_RegisterForVSEvents(btm_ble_vs_evt_callback, TRUE);
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -4761,7 +4754,6 @@ BOOLEAN BTM_Ble_Authorization(BD_ADDR bd_addr, BOOLEAN authorize)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleClearAdv
|
||||
@@ -4783,30 +4775,6 @@ BOOLEAN BTM_BleClearAdv(tBTM_CLEAR_ADV_CMPL_CBACK *p_clear_adv_cback)
|
||||
p_cb->inq_var.p_clear_adv_cb = p_clear_adv_cback;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOLEAN BTM_BleSetCsaSupport(UINT8 csa_select, tBTM_SET_CSA_SUPPORT_CMPL_CBACK *p_callback)
|
||||
{
|
||||
if (btsnd_hcic_ble_set_csa_support(csa_select) != TRUE) {
|
||||
BTM_TRACE_ERROR("LE SetCsaSupport csa_select=%d: error", csa_select);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
btm_cb.ble_ctr_cb.set_csa_support_cmpl_cb = p_callback;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOLEAN BTM_BleSetVendorEventMask(UINT32 evt_mask, tBTM_SET_VENDOR_EVT_MASK_CBACK *p_callback)
|
||||
{
|
||||
if (btsnd_hcic_ble_set_vendor_evt_mask(evt_mask) != TRUE) {
|
||||
BTM_TRACE_ERROR("LE SetVendorEventMask evt_mask=%x: error", evt_mask);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
btm_cb.ble_ctr_cb.set_vendor_evt_mask_cmpl_cb = p_callback;
|
||||
return TRUE;
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
|
||||
BOOLEAN BTM_BleSetRpaTimeout(uint16_t rpa_timeout,tBTM_SET_RPA_TIMEOUT_CMPL_CBACK *p_set_rpa_timeout_cback)
|
||||
{
|
||||
if ((btsnd_hcic_ble_set_rand_priv_addr_timeout(rpa_timeout)) != TRUE) {
|
||||
@@ -4842,6 +4810,28 @@ BOOLEAN BTM_BleSetPrivacyMode(UINT8 addr_type, BD_ADDR bd_addr, UINT8 privacy_mo
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOLEAN BTM_BleSetCsaSupport(UINT8 csa_select, tBTM_SET_CSA_SUPPORT_CMPL_CBACK *p_callback)
|
||||
{
|
||||
if (btsnd_hcic_ble_set_csa_support(csa_select) != TRUE) {
|
||||
BTM_TRACE_ERROR("LE SetCsaSupport csa_select=%d: error", csa_select);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
btm_cb.ble_ctr_cb.set_csa_support_cmpl_cb = p_callback;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOLEAN BTM_BleSetVendorEventMask(UINT32 evt_mask, tBTM_SET_VENDOR_EVT_MASK_CBACK *p_callback)
|
||||
{
|
||||
if (btsnd_hcic_ble_set_vendor_evt_mask(evt_mask) != TRUE) {
|
||||
BTM_TRACE_ERROR("LE SetVendorEventMask evt_mask=%x: error", evt_mask);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
btm_cb.ble_ctr_cb.set_vendor_evt_mask_cmpl_cb = p_callback;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
bool btm_ble_adv_pkt_ready(void)
|
||||
{
|
||||
|
||||
@@ -187,10 +187,8 @@ BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr, tBT_TRANSPORT transport)
|
||||
}
|
||||
|
||||
if ((p_dev_rec = btm_find_dev(bd_addr)) != NULL) {
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/* Tell controller to get rid of the link key, if it has one stored */
|
||||
BTM_DeleteStoredLinkKey (p_dev_rec->bd_addr, NULL);
|
||||
#endif // (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
btm_sec_free_dev(p_dev_rec, transport);
|
||||
}
|
||||
|
||||
@@ -1149,7 +1149,6 @@ tBTM_STATUS BTM_EnableTestMode(void)
|
||||
}
|
||||
#endif // #if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_DeleteStoredLinkKey
|
||||
@@ -1224,7 +1223,6 @@ void btm_delete_stored_link_key_complete (UINT8 *p)
|
||||
}
|
||||
}
|
||||
|
||||
#endif // (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_report_device_status
|
||||
|
||||
@@ -612,12 +612,12 @@ static tBTM_STATUS btm_send_connect_request(UINT16 acl_handle,
|
||||
** If so, we cannot use SCO-only packet types (HFP 1.7)
|
||||
*/
|
||||
if (BTM_BothEndsSupportSecureConnections(p_acl->remote_addr)) {
|
||||
temp_pkt_types &= ~(BTM_SCO_LINK_ONLY_MASK);
|
||||
temp_pkt_types &= ~(BTM_SCO_PKT_TYPE_MASK);
|
||||
BTM_TRACE_DEBUG("%s: SCO Conn: pkt_types after removing SCO (0x%04x)", __FUNCTION__,
|
||||
temp_pkt_types);
|
||||
|
||||
/* Return error if no packet types left */
|
||||
if (temp_pkt_types == BTM_SCO_EXCEPTION_PKTS_MASK) {
|
||||
if (temp_pkt_types == 0) {
|
||||
BTM_TRACE_ERROR("%s: SCO Conn (BR/EDR SC): No packet types available",__FUNCTION__);
|
||||
return (BTM_WRONG_MODE);
|
||||
}
|
||||
|
||||
@@ -1001,12 +1001,12 @@ tBTM_STATUS btm_sec_bond_by_transport (BD_ADDR bd_addr, tBT_TRANSPORT transport,
|
||||
return (BTM_SUCCESS);
|
||||
}
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/* Tell controller to get rid of the link key if it has one stored */
|
||||
if ((BTM_DeleteStoredLinkKey (bd_addr, NULL)) != BTM_SUCCESS) {
|
||||
return (BTM_NO_RESOURCES);
|
||||
}
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/* Save the PIN code if we got a valid one */
|
||||
if (p_pin && (pin_len <= PIN_CODE_LEN) && (pin_len != 0)) {
|
||||
btm_cb.pin_code_len = pin_len;
|
||||
|
||||
@@ -1088,6 +1088,27 @@ BOOLEAN btsnd_hcic_ble_set_channels (BLE_CHANNELS channels)
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN btsnd_hcic_ble_clear_adv (void)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
if ((p = HCI_GET_CMD_BUF (HCIC_PARAM_SIZE_BLE_CLEAR_ADV)) == NULL) {
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_CLEAR_ADV;
|
||||
p->offset = 0;
|
||||
|
||||
UINT16_TO_STREAM (pp, HCI_VENDOR_BLE_CLEAR_ADV);
|
||||
UINT8_TO_STREAM (pp, HCIC_PARAM_SIZE_BLE_CLEAR_ADV);
|
||||
|
||||
btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#define HCIC_BLE_CMD_CREATED(p, pp, size) do{\
|
||||
if ((p = HCI_GET_CMD_BUF(size)) == NULL) { \
|
||||
return FALSE; \
|
||||
@@ -1927,28 +1948,6 @@ BOOLEAN btsnd_hcic_ble_set_privacy_mode(UINT8 addr_type, BD_ADDR addr, UINT8 pri
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
BOOLEAN btsnd_hcic_ble_clear_adv (void)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
if ((p = HCI_GET_CMD_BUF (HCIC_PARAM_SIZE_BLE_CLEAR_ADV)) == NULL) {
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_CLEAR_ADV;
|
||||
p->offset = 0;
|
||||
|
||||
UINT16_TO_STREAM (pp, HCI_VENDOR_BLE_CLEAR_ADV);
|
||||
UINT8_TO_STREAM (pp, HCIC_PARAM_SIZE_BLE_CLEAR_ADV);
|
||||
|
||||
btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOLEAN btsnd_hcic_ble_set_csa_support (UINT8 csa_select)
|
||||
{
|
||||
BT_HDR *p;
|
||||
@@ -1992,7 +1991,6 @@ BOOLEAN btsnd_hcic_ble_set_vendor_evt_mask (UINT32 evt_mask)
|
||||
btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return TRUE;
|
||||
}
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
#endif
|
||||
|
||||
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||
|
||||
@@ -486,7 +486,6 @@ typedef struct {
|
||||
#define BLE_ADDR_RANDOM_ID 0x03
|
||||
#define BLE_ADDR_TYPE_MAX BLE_ADDR_RANDOM_ID
|
||||
#define BLE_ADDR_UNKNOWN_TYPE 0XFF
|
||||
#define BLE_ADDR_ANONYMOUS 0xFF
|
||||
typedef UINT8 tBLE_ADDR_TYPE;
|
||||
#define BLE_ADDR_TYPE_MASK (BLE_ADDR_RANDOM | BLE_ADDR_PUBLIC)
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ typedef UINT16 tGATT_DISCONN_REASON;
|
||||
/* max length of an attribute value
|
||||
*/
|
||||
#ifndef GATT_MAX_ATTR_LEN
|
||||
#define GATT_MAX_ATTR_LEN GATT_MAX_MTU_SIZE
|
||||
#define GATT_MAX_ATTR_LEN 512
|
||||
#endif
|
||||
|
||||
/* default GATT MTU size over LE link
|
||||
|
||||
@@ -927,9 +927,9 @@
|
||||
#define HCI_VENDOR_CH_CLASSIFICATION_EVT_SUBCODE 0x06
|
||||
#define HCI_VENDOR_CH_CLASSIFICATION_REPORTING_MODE_EVT_SUBCODE 0x07
|
||||
|
||||
#define HCI_VENDOR_SPECIFIC_EVT 0xFF /* Vendor specific events */
|
||||
#define HCI_VSE_LE_SUBEVT_BASE 0xC0 /* BLE vendor event code base */
|
||||
#define HCI_VSE_LE_EVT_MAX 0xFF /* BLE vendor event code max */
|
||||
#define HCI_VSE_LE_LEGACY_SCAN_REQ_RECEIVED_EVT 0xC0
|
||||
#define HCI_VSE_LE_CHAN_MAP_UPDATE_CMPL_EVT 0xC1
|
||||
#define HCI_VSE_LE_EVT_MAX 0xFF
|
||||
#define HCI_NAP_TRACE_EVT 0xFF /* was define 0xFE, 0xFD, change to 0xFF
|
||||
because conflict w/ TCI_EVT and per
|
||||
specification compliant */
|
||||
|
||||
@@ -480,8 +480,6 @@ BOOLEAN l2c_link_hci_disc_comp (UINT16 handle, UINT8 reason)
|
||||
if (l2cu_create_conn(p_lcb, BT_TRANSPORT_LE)) {
|
||||
btm_acl_removed (p_lcb->remote_bd_addr, BT_TRANSPORT_LE);
|
||||
lcb_is_free = FALSE; /* still using this lcb */
|
||||
} else {
|
||||
L2CAP_TRACE_ERROR("master retry connect failed");
|
||||
}
|
||||
}
|
||||
#endif // (GATTC_CONNECT_RETRY_EN == TRUE)
|
||||
@@ -491,10 +489,7 @@ BOOLEAN l2c_link_hci_disc_comp (UINT16 handle, UINT8 reason)
|
||||
if(btm_ble_inter_get() && p_lcb->link_role == HCI_ROLE_SLAVE) {
|
||||
p_lcb->retry_create_con ++;
|
||||
L2CAP_TRACE_DEBUG("slave restart extend adv, retry count %d reason 0x%x\n", p_lcb->retry_create_con, reason);
|
||||
tBTM_STATUS start_adv_status = BTM_BleStartExtAdvRestart(handle);
|
||||
if (start_adv_status != BTM_SUCCESS) {
|
||||
L2CAP_TRACE_ERROR("slave restart extend adv failed (err 0x%x)", start_adv_status);
|
||||
}
|
||||
BTM_BleStartExtAdvRestart(handle);
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
@@ -504,10 +499,7 @@ BOOLEAN l2c_link_hci_disc_comp (UINT16 handle, UINT8 reason)
|
||||
if(!btm_ble_inter_get() && p_lcb->link_role == HCI_ROLE_SLAVE) {
|
||||
p_lcb->retry_create_con ++;
|
||||
L2CAP_TRACE_DEBUG("slave resatrt adv, retry count %d reason 0x%x\n", p_lcb->retry_create_con, reason);
|
||||
tBTM_STATUS start_adv_status = btm_ble_start_adv();
|
||||
if (start_adv_status != BTM_SUCCESS) {
|
||||
L2CAP_TRACE_ERROR("slave resatrt adv failed (err 0x%x)", start_adv_status);
|
||||
}
|
||||
btm_ble_start_adv();
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
@@ -1092,9 +1084,7 @@ void l2c_link_check_send_pkts (tL2C_LCB *p_lcb, tL2C_CCB *p_ccb, BT_HDR *p_buf)
|
||||
p_lcb_cur = list_node(p_node);
|
||||
if (p_lcb_cur == p_lcb) {
|
||||
p_node = list_next(p_node);
|
||||
if (p_node) {
|
||||
p_lcb = list_node(p_node);
|
||||
}
|
||||
p_lcb = list_node(p_node);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1553,7 +1553,7 @@ void smp_fast_conn_param(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
|
||||
}
|
||||
/* Disable L2CAP connection parameter updates while bonding since
|
||||
some peripherals are not able to revert to fast connection parameters
|
||||
during the start of service discovery. Connection parameter updates
|
||||
during the start of service discovery. Connection paramter updates
|
||||
get enabled again once service discovery completes. */
|
||||
#if (BT_MULTI_CONNECTION_ENBALE == FALSE)
|
||||
L2CA_EnableUpdateBleConnParams(p_cb->pairing_bda, FALSE);
|
||||
@@ -1648,8 +1648,6 @@ void smp_process_local_nonce(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
|
||||
/* slave calculates and sends local commitment */
|
||||
smp_calculate_local_commitment(p_cb);
|
||||
smp_send_commitment(p_cb, NULL);
|
||||
/* Ensure the connection is still active */
|
||||
if (smp_get_state() == SMP_STATE_IDLE) return;
|
||||
/* slave has to wait for peer nonce */
|
||||
smp_set_state(SMP_STATE_WAIT_NONCE);
|
||||
} else { /* i.e. master */
|
||||
@@ -1660,8 +1658,6 @@ void smp_process_local_nonce(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
|
||||
p_cb->selected_association_model);
|
||||
p_cb->flags &= ~SMP_PAIR_FLAG_HAVE_PEER_COMM;
|
||||
smp_send_rand(p_cb, NULL);
|
||||
/* Ensure the connection is still active */
|
||||
if (smp_get_state() == SMP_STATE_IDLE) return;
|
||||
smp_set_state(SMP_STATE_WAIT_NONCE);
|
||||
}
|
||||
}
|
||||
@@ -1676,8 +1672,6 @@ void smp_process_local_nonce(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
|
||||
if (p_cb->flags & SMP_PAIR_FLAG_HAVE_PEER_COMM) {
|
||||
/* master commitment is already received */
|
||||
smp_send_commitment(p_cb, NULL);
|
||||
/* Ensure the connection is still active */
|
||||
if (smp_get_state() == SMP_STATE_IDLE) return;
|
||||
smp_set_state(SMP_STATE_WAIT_NONCE);
|
||||
}
|
||||
}
|
||||
@@ -1685,8 +1679,6 @@ void smp_process_local_nonce(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
|
||||
case SMP_MODEL_SEC_CONN_OOB:
|
||||
if (p_cb->role == HCI_ROLE_MASTER) {
|
||||
smp_send_rand(p_cb, NULL);
|
||||
/* Ensure the connection is still active */
|
||||
if (smp_get_state() == SMP_STATE_IDLE) return;
|
||||
}
|
||||
|
||||
smp_set_state(SMP_STATE_WAIT_NONCE);
|
||||
@@ -2010,7 +2002,7 @@ void smp_link_encrypted(BD_ADDR bda, UINT8 encr_enable)
|
||||
SMP_TRACE_DEBUG("%s encr_enable=%d\n", __func__, encr_enable);
|
||||
|
||||
if (memcmp(&smp_cb.pairing_bda[0], bda, BD_ADDR_LEN) == 0) {
|
||||
/* encryption completed with STK, remember the key size now, could be overwrite
|
||||
/* encryption completed with STK, remmeber the key size now, could be overwite
|
||||
* when key exchange happens */
|
||||
if (p_cb->loc_enc_size != 0 && encr_enable) {
|
||||
/* update the link encryption key size if a SMP pairing just performed */
|
||||
|
||||
@@ -156,7 +156,7 @@ config BT_NIMBLE_ROLE_BROADCASTER
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
default y
|
||||
help
|
||||
Enables broadcaster role
|
||||
Enables broadcaster role
|
||||
|
||||
config BT_NIMBLE_ROLE_OBSERVER
|
||||
bool "Enable BLE Observer role"
|
||||
@@ -165,20 +165,6 @@ config BT_NIMBLE_ROLE_OBSERVER
|
||||
help
|
||||
Enables observer role
|
||||
|
||||
config BT_NIMBLE_GATT_CLIENT
|
||||
bool "Enable BLE GATT Client support"
|
||||
depends on BT_NIMBLE_ROLE_CENTRAL
|
||||
default y
|
||||
help
|
||||
Enables support for GATT Client
|
||||
|
||||
config BT_NIMBLE_GATT_SERVER
|
||||
bool "Enable BLE GATT Server support"
|
||||
depends on BT_NIMBLE_ROLE_PERIPHERAL
|
||||
default y
|
||||
help
|
||||
Enables support for GATT Server
|
||||
|
||||
config BT_NIMBLE_NVS_PERSIST
|
||||
bool "Persist the BLE Bonding keys in NVS"
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
@@ -251,13 +237,6 @@ config BT_NIMBLE_SM_SC_ONLY
|
||||
help
|
||||
Enable Secure Connections Only Mode
|
||||
|
||||
config BT_NIMBLE_PRINT_ERR_NAME
|
||||
bool "Enable feature to print Error description"
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
default y
|
||||
help
|
||||
Enable feature to give useful explanation for HCI errors
|
||||
|
||||
config BT_NIMBLE_DEBUG
|
||||
bool "Enable extra runtime asserts and host debugging"
|
||||
default n
|
||||
@@ -295,13 +274,6 @@ config BT_NIMBLE_ATT_PREFERRED_MTU
|
||||
This is the default value of ATT MTU indicated by the device during an ATT MTU exchange.
|
||||
This value can be changed using API ble_att_set_preferred_mtu()
|
||||
|
||||
config BT_NIMBLE_ATT_MAX_PREP_ENTRIES
|
||||
int "Max Prepare write entries"
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
default 64
|
||||
help
|
||||
This is the default value of ATT Maximum prepare entries
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEARANCE
|
||||
hex "External appearance of the device"
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
@@ -412,7 +384,7 @@ config BT_NIMBLE_GATT_MAX_PROCS
|
||||
|
||||
config BT_NIMBLE_HS_FLOW_CTRL
|
||||
bool "Enable Host Flow control"
|
||||
depends on BT_NIMBLE_ENABLED && !SOC_ESP_NIMBLE_CONTROLLER
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
default y if IDF_TARGET_ESP32
|
||||
default n
|
||||
help
|
||||
@@ -628,13 +600,6 @@ if BT_NIMBLE_50_FEATURE_SUPPORT
|
||||
will be supported from BLE 5.0 onwards.
|
||||
|
||||
if BT_NIMBLE_EXT_ADV
|
||||
config BT_NIMBLE_EXT_ADV_V2
|
||||
bool "Enable support for extended adv v2"
|
||||
default n
|
||||
depends on BT_NIMBLE_EXT_ADV
|
||||
help
|
||||
Enable this option to use Extended Adv V2 command instead of V1.
|
||||
|
||||
config BT_NIMBLE_MAX_EXT_ADV_INSTANCES
|
||||
int "Maximum number of extended advertising instances."
|
||||
range 0 4
|
||||
@@ -743,19 +708,6 @@ menuconfig BT_NIMBLE_GATT_CACHING
|
||||
select BT_NIMBLE_DYNAMIC_SERVICE
|
||||
help
|
||||
Enable GATT caching
|
||||
config BT_NIMBLE_GATT_CACHING_INCLUDE_SERVICES
|
||||
bool "Include services in GATT caching"
|
||||
depends on BT_NIMBLE_GATT_CACHING
|
||||
default n
|
||||
help
|
||||
Enable this option to include *included services* (e.g., services referenced by other services)
|
||||
in the GATT database cache. Disabling this will skip caching of included service entries.
|
||||
config BT_NIMBLE_INCL_SVC_DISCOVERY
|
||||
bool "Enable Included service discovery"
|
||||
default y if BT_NIMBLE_GATT_CACHING_INCLUDE_SERVICES
|
||||
default n
|
||||
help
|
||||
Enable this option to start discovery for included service.
|
||||
config BT_NIMBLE_GATT_CACHING_MAX_CONNS
|
||||
int "Maximum connections to be cached"
|
||||
depends on BT_NIMBLE_GATT_CACHING
|
||||
@@ -768,12 +720,6 @@ config BT_NIMBLE_GATT_CACHING_MAX_SVCS
|
||||
default 64
|
||||
help
|
||||
Set this option to set the upper limit on number of services per connection to be cached.
|
||||
config BT_NIMBLE_GATT_CACHING_MAX_INCL_SVCS
|
||||
int "Maximum number of included services per connection"
|
||||
depends on BT_NIMBLE_GATT_CACHING
|
||||
default 64
|
||||
help
|
||||
Set this option to set the upper limit on number of included services per connection to be cached.
|
||||
config BT_NIMBLE_GATT_CACHING_MAX_CHRS
|
||||
int "Maximum number of characteristics per connection"
|
||||
depends on BT_NIMBLE_GATT_CACHING
|
||||
@@ -835,172 +781,8 @@ config BT_NIMBLE_BLE_GATT_BLOB_TRANSFER
|
||||
This option is used when data to be sent is more than 512 bytes. For peripheral role,
|
||||
BT_NIMBLE_MSYS_1_BLOCK_COUNT needs to be increased according to the need.
|
||||
|
||||
menu "BLE Services"
|
||||
depends on BT_NIMBLE_GATT_SERVER
|
||||
|
||||
config BT_NIMBLE_PROX_SERVICE
|
||||
bool "Proximity service"
|
||||
default y
|
||||
help
|
||||
Enable Proximity Service support
|
||||
|
||||
config BT_NIMBLE_ANS_SERVICE
|
||||
bool "Alert Notification service"
|
||||
default y
|
||||
help
|
||||
Enable Alert Notification Service support
|
||||
|
||||
config BT_NIMBLE_CTS_SERVICE
|
||||
bool "Current Time Service"
|
||||
default y
|
||||
help
|
||||
Enable Current Time Service support
|
||||
|
||||
config BT_NIMBLE_HTP_SERVICE
|
||||
bool "Health Thermometer service"
|
||||
default y
|
||||
help
|
||||
Enable Health Thermometer Service support
|
||||
|
||||
config BT_NIMBLE_IPSS_SERVICE
|
||||
bool "Internet Protocol Support service"
|
||||
default y
|
||||
help
|
||||
Enable Internet Protocol Service support
|
||||
|
||||
config BT_NIMBLE_TPS_SERVICE
|
||||
bool "Tx Power service"
|
||||
default y
|
||||
help
|
||||
Enable Tx Power Service support
|
||||
|
||||
config BT_NIMBLE_IAS_SERVICE
|
||||
bool "Immediate Alert service"
|
||||
default y
|
||||
help
|
||||
Enable Immediate Alert Service support
|
||||
|
||||
config BT_NIMBLE_LLS_SERVICE
|
||||
bool "Link Loss service"
|
||||
default y
|
||||
help
|
||||
Enable Link Loss Service support
|
||||
|
||||
config BT_NIMBLE_SPS_SERVICE
|
||||
bool "Serial Port service"
|
||||
default y
|
||||
help
|
||||
Enable Serial Port Service support
|
||||
|
||||
config BT_NIMBLE_HR_SERVICE
|
||||
bool "Heart Rate service"
|
||||
default y
|
||||
help
|
||||
Enable HeartRate Service support
|
||||
|
||||
menuconfig BT_NIMBLE_HID_SERVICE
|
||||
bool "HID service"
|
||||
default n
|
||||
help
|
||||
Enable HID service support
|
||||
|
||||
config BT_NIMBLE_SVC_HID_MAX_INSTANCES
|
||||
depends on BT_NIMBLE_HID_SERVICE
|
||||
int "Maximum HID service instances"
|
||||
default 2
|
||||
help
|
||||
Defines maximum number of HID service instances
|
||||
|
||||
config BT_NIMBLE_SVC_HID_MAX_RPTS
|
||||
depends on BT_NIMBLE_HID_SERVICE
|
||||
int "Maximum HID Report characteristics per service instance"
|
||||
default 3
|
||||
help
|
||||
Defines maximum number of report characteristics per service instance
|
||||
|
||||
menuconfig BT_NIMBLE_BAS_SERVICE
|
||||
bool "Battery service"
|
||||
default y
|
||||
help
|
||||
Enable Battery service support
|
||||
|
||||
config BT_NIMBLE_SVC_BAS_BATTERY_LEVEL_NOTIFY
|
||||
depends on BT_NIMBLE_BAS_SERVICE
|
||||
bool "BAS Battery Level NOTIFY permission"
|
||||
help
|
||||
Enable/Disable notifications on BAS Battery Level Characteristic
|
||||
|
||||
menuconfig BT_NIMBLE_DIS_SERVICE
|
||||
bool "DIS service"
|
||||
default y
|
||||
help
|
||||
Enable DIS service support
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_MANUFACTURER_NAME
|
||||
depends on BT_NIMBLE_DIS_SERVICE
|
||||
bool "Manufacturer Name"
|
||||
default n
|
||||
help
|
||||
Enable the DIS characteristic Manufacturer Name String characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_SERIAL_NUMBER
|
||||
depends on BT_NIMBLE_DIS_SERVICE
|
||||
bool "Serial Number"
|
||||
default n
|
||||
help
|
||||
Enable the DIS Serial Number characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_HARDWARE_REVISION
|
||||
depends on BT_NIMBLE_DIS_SERVICE
|
||||
bool "Hardware Revision"
|
||||
default n
|
||||
help
|
||||
Enable the DIS Hardware Revision characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_FIRMWARE_REVISION
|
||||
depends on BT_NIMBLE_DIS_SERVICE
|
||||
bool "Firmware Revision"
|
||||
default n
|
||||
help
|
||||
Enable the DIS Firmware Revision characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_SOFTWARE_REVISION
|
||||
depends on BT_NIMBLE_DIS_SERVICE
|
||||
bool "Software Revision"
|
||||
default n
|
||||
help
|
||||
Enable the DIS Software Revision characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_SYSTEM_ID
|
||||
depends on BT_NIMBLE_DIS_SERVICE
|
||||
bool "System ID"
|
||||
default n
|
||||
help
|
||||
Enable the DIS System ID characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_PNP_ID
|
||||
depends on BT_NIMBLE_DIS_SERVICE
|
||||
bool "PnP ID"
|
||||
default n
|
||||
help
|
||||
Enable the DIS PnP ID characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_INCLUDED
|
||||
depends on BT_NIMBLE_DIS_SERVICE
|
||||
bool "DIS as an Included Service"
|
||||
default n
|
||||
help
|
||||
Use DIS as an included service
|
||||
|
||||
menuconfig BT_NIMBLE_GAP_SERVICE
|
||||
bool "GAP Service"
|
||||
default y
|
||||
help
|
||||
Enable GAP Service support
|
||||
|
||||
menu "GAP Service"
|
||||
menu "GAP Appearance write permissions"
|
||||
depends on BT_NIMBLE_GAP_SERVICE
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE
|
||||
bool "Write"
|
||||
default n
|
||||
@@ -1010,12 +792,14 @@ menu "BLE Services"
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
|
||||
depends on BT_NIMBLE_SVC_GAP_APPEAR_WRITE
|
||||
bool "Write with encryption"
|
||||
default n
|
||||
help
|
||||
Enable write with encryption permission (BLE_GATT_CHR_F_WRITE_ENC)
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
|
||||
depends on BT_NIMBLE_SVC_GAP_APPEAR_WRITE
|
||||
bool "Write with authentication"
|
||||
default n
|
||||
help
|
||||
Enable write with authentication permission (BLE_GATT_CHR_F_WRITE_AUTHEN)
|
||||
|
||||
@@ -1025,49 +809,48 @@ menu "BLE Services"
|
||||
default n
|
||||
help
|
||||
Enable write with authorisation permission (BLE_GATT_CHR_F_WRITE_AUTHOR)
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE
|
||||
default 8 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ENC
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
|
||||
default 4096 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHN
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
|
||||
default 8192 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHR
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHOR
|
||||
default 16384 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHOR
|
||||
endmenu
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE
|
||||
default 8 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ENC
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
|
||||
default 4096 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHN
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
|
||||
default 8192 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHR
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHOR
|
||||
default 16384 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHOR
|
||||
|
||||
choice BT_NIMBLE_SVC_GAP_CENT_ADDR_RESOLUTION
|
||||
prompt "GAP Characteristic - Central Address Resolution"
|
||||
depends on BT_NIMBLE_GAP_SERVICE
|
||||
default BT_NIMBLE_SVC_GAP_CAR_CHAR_NOT_SUPP
|
||||
help
|
||||
Weather or not Central Address Resolution characteristic is supported on
|
||||
the device, and if supported, weather or not Central Address Resolution
|
||||
is supported.
|
||||
Weather or not Central Address Resolution characteristic is supported on
|
||||
the device, and if supported, weather or not Central Address Resolution
|
||||
is supported.
|
||||
|
||||
- Central Address Resolution characteristic not supported
|
||||
- Central Address Resolution not supported
|
||||
- Central Address Resolution supported
|
||||
- Central Address Resolution characteristic not supported
|
||||
- Central Address Resolution not supported
|
||||
- Central Address Resolution supported
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_CAR_CHAR_NOT_SUPP
|
||||
bool "Characteristic not supported"
|
||||
config BT_NIMBLE_SVC_GAP_CAR_CHAR_NOT_SUPP
|
||||
bool "Characteristic not supported"
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_CAR_NOT_SUPP
|
||||
bool "Central Address Resolution not supported"
|
||||
config BT_NIMBLE_SVC_GAP_CAR_NOT_SUPP
|
||||
bool "Central Address Resolution not supported"
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_CAR_SUPP
|
||||
bool "Central Address Resolution supported"
|
||||
config BT_NIMBLE_SVC_GAP_CAR_SUPP
|
||||
bool "Central Address Resolution supported"
|
||||
endchoice
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_CENT_ADDR_RESOLUTION
|
||||
@@ -1076,9 +859,7 @@ menu "BLE Services"
|
||||
default 0 if BT_NIMBLE_SVC_GAP_CAR_NOT_SUPP
|
||||
default 1 if BT_NIMBLE_SVC_GAP_CAR_SUPP
|
||||
|
||||
|
||||
menu "GAP device name write permissions"
|
||||
depends on BT_NIMBLE_GAP_SERVICE
|
||||
config BT_NIMBLE_SVC_GAP_NAME_WRITE
|
||||
bool "Write"
|
||||
default n
|
||||
@@ -1107,40 +888,6 @@ menu "BLE Services"
|
||||
Enable write with authorisation permission (BLE_GATT_CHR_F_WRITE_AUTHOR)
|
||||
endmenu
|
||||
|
||||
menu "PPCP settings"
|
||||
depends on BT_NIMBLE_GAP_SERVICE
|
||||
config BT_NIMBLE_SVC_GAP_PPCP_MAX_CONN_INTERVAL
|
||||
int "PPCP Connection Interval Max (Unit: 1.25 ms)"
|
||||
depends on BT_NIMBLE_ROLE_PERIPHERAL && BT_NIMBLE_GAP_SERVICE
|
||||
default 0
|
||||
help
|
||||
Peripheral Preferred Connection Parameter: Connection Interval maximum value
|
||||
Interval Max = value * 1.25 ms
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_PPCP_MIN_CONN_INTERVAL
|
||||
int "PPCP Connection Interval Min (Unit: 1.25 ms)"
|
||||
depends on BT_NIMBLE_ROLE_PERIPHERAL && BT_NIMBLE_GAP_SERVICE
|
||||
default 0
|
||||
help
|
||||
Peripheral Preferred Connection Parameter: Connection Interval minimum value
|
||||
Interval Min = value * 1.25 ms
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_PPCP_SLAVE_LATENCY
|
||||
int "PPCP Slave Latency"
|
||||
depends on BT_NIMBLE_GAP_SERVICE
|
||||
default 0
|
||||
help
|
||||
Peripheral Preferred Connection Parameter: Slave Latency
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_PPCP_SUPERVISION_TMO
|
||||
int "PPCP Supervision Timeout (Uint: 10 ms)"
|
||||
depends on BT_NIMBLE_GAP_SERVICE
|
||||
default 0
|
||||
help
|
||||
Peripheral Preferred Connection Parameter: Supervision Timeout
|
||||
Timeout = Value * 10 ms
|
||||
endmenu
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM
|
||||
int
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_NAME_WRITE
|
||||
@@ -1161,6 +908,35 @@ menu "BLE Services"
|
||||
default 0 if !BT_NIMBLE_SVC_GAP_NAME_WRITE_AUTHOR
|
||||
default 16384 if BT_NIMBLE_SVC_GAP_NAME_WRITE_AUTHOR
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_PPCP_MAX_CONN_INTERVAL
|
||||
int "PPCP Connection Interval Max (Unit: 1.25 ms)"
|
||||
depends on BT_NIMBLE_ROLE_PERIPHERAL
|
||||
default 0
|
||||
help
|
||||
Peripheral Preferred Connection Parameter: Connection Interval maximum value
|
||||
Interval Max = value * 1.25 ms
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_PPCP_MIN_CONN_INTERVAL
|
||||
int "PPCP Connection Interval Min (Unit: 1.25 ms)"
|
||||
depends on BT_NIMBLE_ROLE_PERIPHERAL
|
||||
default 0
|
||||
help
|
||||
Peripheral Preferred Connection Parameter: Connection Interval minimum value
|
||||
Interval Min = value * 1.25 ms
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_PPCP_SLAVE_LATENCY
|
||||
int "PPCP Slave Latency"
|
||||
default 0
|
||||
help
|
||||
Peripheral Preferred Connection Parameter: Slave Latency
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_PPCP_SUPERVISION_TMO
|
||||
int "PPCP Supervision Timeout (Uint: 10 ms)"
|
||||
default 0
|
||||
help
|
||||
Peripheral Preferred Connection Parameter: Supervision Timeout
|
||||
Timeout = Value * 10 ms
|
||||
|
||||
config BT_NIMBLE_SVC_GAP_GATT_SECURITY_LEVEL
|
||||
bool "LE GATT Security Level Characteristic"
|
||||
default n
|
||||
@@ -1175,6 +951,94 @@ menu "BLE Services"
|
||||
|
||||
endmenu
|
||||
|
||||
menu "BLE Services"
|
||||
menuconfig BT_NIMBLE_HID_SERVICE
|
||||
bool "HID service"
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
default n
|
||||
help
|
||||
Enable HID service support
|
||||
|
||||
config BT_NIMBLE_SVC_HID_MAX_INSTANCES
|
||||
depends on BT_NIMBLE_HID_SERVICE
|
||||
int "Maximum HID service instances"
|
||||
default 2
|
||||
help
|
||||
Defines maximum number of HID service instances
|
||||
|
||||
config BT_NIMBLE_SVC_HID_MAX_RPTS
|
||||
depends on BT_NIMBLE_HID_SERVICE
|
||||
int "Maximum HID Report characteristics per service instance"
|
||||
default 3
|
||||
help
|
||||
Defines maximum number of report characteristics per service instance
|
||||
|
||||
config BT_NIMBLE_SVC_BAS_BATTERY_LEVEL_NOTIFY
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "BAS Battery Level NOTIFY permission"
|
||||
default n
|
||||
help
|
||||
Enable/Disable notifications on BAS Battery Level Characteristic
|
||||
|
||||
menu "Device Information Service"
|
||||
config BT_NIMBLE_SVC_DIS_MANUFACTURER_NAME
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "Manufacturer Name"
|
||||
default n
|
||||
help
|
||||
Enable the DIS characteristic Manufacturer Name String characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_SERIAL_NUMBER
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "Serial Number"
|
||||
default n
|
||||
help
|
||||
Enable the DIS Serial Number characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_HARDWARE_REVISION
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "Hardware Revision"
|
||||
default n
|
||||
help
|
||||
Enable the DIS Hardware Revision characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_FIRMWARE_REVISION
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "Firmware Revision"
|
||||
default n
|
||||
help
|
||||
Enable the DIS Firmware Revision characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_SOFTWARE_REVISION
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "Software Revision"
|
||||
default n
|
||||
help
|
||||
Enable the DIS Software Revision characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_SYSTEM_ID
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "System ID"
|
||||
default n
|
||||
help
|
||||
Enable the DIS System ID characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_PNP_ID
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "PnP ID"
|
||||
default n
|
||||
help
|
||||
Enable the DIS PnP ID characteristic
|
||||
|
||||
config BT_NIMBLE_SVC_DIS_INCLUDED
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
bool "DIS as an Included Service"
|
||||
default n
|
||||
help
|
||||
Use DIS as an included service
|
||||
endmenu
|
||||
endmenu
|
||||
|
||||
config BT_NIMBLE_VS_SUPPORT
|
||||
bool "Enable support for VSC and VSE"
|
||||
help
|
||||
@@ -1211,7 +1075,8 @@ config BT_NIMBLE_HIGH_DUTY_ADV_ITVL
|
||||
|
||||
config BT_NIMBLE_HOST_ALLOW_CONNECT_WITH_SCAN
|
||||
bool "Allow Connections with scanning in progress"
|
||||
depends on BT_NIMBLE_ENABLED && !(IDF_TARGET_ESP32C2)
|
||||
depends on BT_NIMBLE_ENABLED
|
||||
depends on (!SOC_ESP_NIMBLE_CONTROLLER || IDF_TARGET_ESP32C6 || IDF_TARGET_ESP32H2)
|
||||
help
|
||||
This enables support for user to initiate a new connection with scan in progress
|
||||
|
||||
|
||||
Submodule components/bt/host/nimble/nimble updated: cc3ac5416b...7c18dde8d7
@@ -98,14 +98,6 @@
|
||||
#define MYNEWT_VAL_BLE_EXT_ADV (CONFIG_BT_NIMBLE_EXT_ADV)
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_EXT_ADV_V2
|
||||
#ifdef CONFIG_BT_NIMBLE_EXT_ADV_V2
|
||||
#define MYNEWT_VAL_BLE_EXT_ADV_V2 (CONFIG_BT_NIMBLE_EXT_ADV_V2)
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_EXT_ADV_V2 (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_BT_NIMBLE_EXT_ADV_MAX_SIZE
|
||||
#define MYNEWT_VAL_BLE_EXT_ADV_MAX_SIZE (31)
|
||||
#else
|
||||
@@ -137,27 +129,11 @@
|
||||
#define MYNEWT_VAL_BLE_MAX_PERIODIC_ADVERTISER_LIST (CONFIG_BT_NIMBLE_MAX_PERIODIC_ADVERTISER_LIST)
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_INCL_SVC_DISCOVERY
|
||||
#ifdef CONFIG_BT_NIMBLE_INCL_SVC_DISCOVERY
|
||||
#define MYNEWT_VAL_BLE_INCL_SVC_DISCOVERY (CONFIG_BT_NIMBLE_INCL_SVC_DISCOVERY)
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_INCL_SVC_DISCOVERY (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_BT_NIMBLE_GATT_CACHING
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING (0)
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING (CONFIG_BT_NIMBLE_GATT_CACHING)
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_GATT_CACHING_INCLUDE_SERVICES
|
||||
#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_INCLUDE_SERVICES
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING_INCLUDE_SERVICES (CONFIG_BT_NIMBLE_GATT_CACHING_INCLUDE_SERVICES)
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING_INCLUDE_SERVICES (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CONNS
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_CONNS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CONNS)
|
||||
#else
|
||||
@@ -170,14 +146,6 @@
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_SVCS (0)
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_GATT_CACHING_MAX_INCL_SVCS
|
||||
#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_MAX_INCL_SVCS
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_INCL_SVCS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_INCL_SVCS)
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_INCL_SVCS (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CHRS
|
||||
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_CHRS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CHRS)
|
||||
#else
|
||||
@@ -244,18 +212,6 @@
|
||||
#define MYNEWT_VAL_BLE_ROLE_PERIPHERAL (CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_BT_NIMBLE_GATT_CLIENT
|
||||
#define MYNEWT_VAL_BLE_GATTC (0)
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_GATTC (CONFIG_BT_NIMBLE_GATT_CLIENT)
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_BT_NIMBLE_GATT_SERVER
|
||||
#define MYNEWT_VAL_BLE_GATTS (0)
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_GATTS (CONFIG_BT_NIMBLE_GATT_SERVER)
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_WHITELIST
|
||||
#define MYNEWT_VAL_BLE_WHITELIST (1)
|
||||
#endif
|
||||
@@ -596,7 +552,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_ATT_SVR_MAX_PREP_ENTRIES
|
||||
#define MYNEWT_VAL_BLE_ATT_SVR_MAX_PREP_ENTRIES CONFIG_BT_NIMBLE_ATT_MAX_PREP_ENTRIES
|
||||
#define MYNEWT_VAL_BLE_ATT_SVR_MAX_PREP_ENTRIES (64)
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_ATT_SVR_NOTIFY
|
||||
@@ -2076,16 +2032,4 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_ERR_CHECK
|
||||
#ifdef CONFIG_BT_NIMBLE_PRINT_ERR_NAME
|
||||
#define MYNEWT_VAL_BLE_ERR_CHECK CONFIG_BT_NIMBLE_PRINT_ERR_NAME
|
||||
#else
|
||||
#define MYNEWT_VAL_BLE_ERR_CHECK (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MYNEWT_VAL_BLE_USED_IN_IDF
|
||||
#define MYNEWT_VAL_BLE_USED_IN_IDF (1)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,7 +30,7 @@ extern "C" {
|
||||
*
|
||||
* @note Please do not modify this value
|
||||
*/
|
||||
#define ESP_BT_CTRL_CONFIG_VERSION 0x02505080
|
||||
#define ESP_BT_CTRL_CONFIG_VERSION 0x02502230
|
||||
|
||||
/**
|
||||
* @brief Internal use only
|
||||
@@ -268,7 +268,7 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
|
||||
#define BT_CTRL_RUN_IN_FLASH_ONLY (0)
|
||||
#endif
|
||||
|
||||
|
||||
#if (BT_CTRL_RUN_IN_FLASH_ONLY == 1)
|
||||
|
||||
#if defined(CONFIG_BT_CTRL_DTM_ENABLE)
|
||||
#define BT_CTRL_DTM_ENABLE CONFIG_BT_CTRL_DTM_ENABLE
|
||||
@@ -288,11 +288,20 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
|
||||
#define BT_CTRL_BLE_TEST (0)
|
||||
#endif
|
||||
|
||||
#if defined (CONFIG_BT_NIMBLE_SECURITY_ENABLE) || defined (CONFIG_BT_BLE_SMP_ENABLE)
|
||||
#ifdef CONFIG_BT_NIMBLE_SECURITY_ENABLE
|
||||
#define BLE_SECURITY_ENABLE (CONFIG_BT_NIMBLE_SECURITY_ENABLE)
|
||||
#endif //CONFIG_BT_NIMBLE_SECURITY_ENABLE
|
||||
#ifdef CONFIG_BT_BLE_SMP_ENABLE
|
||||
#define BLE_SECURITY_ENABLE (CONFIG_BT_BLE_SMP_ENABLE)
|
||||
#endif //CONFIG_BT_BLE_SMP_ENABLE
|
||||
#else
|
||||
#if defined (CONFIG_BT_CTRL_BLE_SECURITY_ENABLE)
|
||||
#define BLE_SECURITY_ENABLE (CONFIG_BT_CTRL_BLE_SECURITY_ENABLE)
|
||||
#else
|
||||
#define BLE_SECURITY_ENABLE (0)
|
||||
#endif
|
||||
#endif // (CONFIG_BT_NIMBLE_SECURITY_ENABLE) || (CONFIG_BT_BLE_SMP_ENABLE)
|
||||
|
||||
#if defined (CONFIG_BT_CTRL_BLE_SCAN)
|
||||
#define BT_CTRL_BLE_SCAN CONFIG_BT_CTRL_BLE_SCAN
|
||||
@@ -300,11 +309,13 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
|
||||
#define BT_CTRL_BLE_SCAN (0)
|
||||
#endif
|
||||
|
||||
#if defined (CONFIG_BT_CTRL_BLE_ADV)
|
||||
#define BT_CTRL_BLE_ADV CONFIG_BT_CTRL_BLE_ADV
|
||||
#else
|
||||
#define BT_CTRL_BLE_ADV (0)
|
||||
#endif
|
||||
#define BT_CTRL_BLE_MASTER (1)
|
||||
#define BT_CTRL_DTM_ENABLE (1)
|
||||
#define BT_CTRL_BLE_TEST (1)
|
||||
#define BLE_SECURITY_ENABLE (1)
|
||||
#define BT_CTRL_BLE_SCAN (1)
|
||||
#endif // (BT_CTRL_RUN_IN_FLASH_ONLY == 1)
|
||||
|
||||
#ifdef CONFIG_BT_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
|
||||
#define BLE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED CONFIG_BT_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
|
||||
@@ -373,12 +384,11 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
|
||||
.dtm_en = BT_CTRL_DTM_ENABLE, \
|
||||
.enc_en = BLE_SECURITY_ENABLE, \
|
||||
.qa_test = BT_CTRL_BLE_TEST, \
|
||||
.connect_en = BT_CTRL_BLE_MASTER, \
|
||||
.master_en = BT_CTRL_BLE_MASTER, \
|
||||
.scan_en = BT_CTRL_BLE_SCAN, \
|
||||
.ble_aa_check = BLE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED, \
|
||||
.ble_log_mode_en = BLE_LOG_MODE_EN, \
|
||||
.ble_log_level = BLE_LOG_LEVEL, \
|
||||
.adv_en = BT_CTRL_BLE_ADV, \
|
||||
}
|
||||
|
||||
#else
|
||||
@@ -498,15 +508,14 @@ typedef struct {
|
||||
uint8_t ble_llcp_disc_flag; /*!< Flag indicating whether the Controller disconnects after Instant Passed (0x28) error occurs. Configurable in menuconfig.
|
||||
- The Controller does not disconnect after Instant Passed (0x28) by default. */
|
||||
bool run_in_flash; /*!< True if the Controller code is in flash (flash model); false otherwise (default). Configurable in menuconfig. */
|
||||
bool dtm_en; /*!< True if the DTM feature is enabled; false otherwise (default). Configurable in menuconfig. */
|
||||
bool enc_en; /*!< True if the encryption feature is enabled (default); false otherwise. Configurable in menuconfig. */
|
||||
bool qa_test; /*!< True if the QA test feature is enabled; false otherwise (default). Configurable in menuconfig.*/
|
||||
bool connect_en; /*!< True if the connection feature is enabled (default); false otherwise. Configurable in menuconfig.*/
|
||||
bool scan_en; /*!< True if the scan feature is enabled (default); false otherwise. Configurable in menuconfig.*/
|
||||
bool dtm_en; /*!< In the flash mode, True if the DTM feature is enabled; false otherwise (default). Configurable in menuconfig. */
|
||||
bool enc_en; /*!< In the flash mode, True if the encryption feature is enabled (default); false otherwise. Configurable in menuconfig. */
|
||||
bool qa_test; /*!< In the flash mode, True if the QA test feature is enabled; false otherwise (default). Configurable in menuconfig.*/
|
||||
bool master_en; /*!< In the flash mode, True if the master feature is enabled (default); false otherwise. Configurable in menuconfig.*/
|
||||
bool scan_en; /*!< In the flash mode, True if the scan feature is enabled (default); false otherwise. Configurable in menuconfig.*/
|
||||
bool ble_aa_check; /*!< True if adds a verification step for the Access Address within the CONNECT_IND PDU; false otherwise. Configurable in menuconfig */
|
||||
uint32_t ble_log_mode_en; /*!< BLE log mode enable */
|
||||
uint8_t ble_log_level; /*!< BLE log level */
|
||||
bool adv_en; /*!< True if the ADV feature is enabled (default); false otherwise. Configurable in menuconfig.*/
|
||||
} esp_bt_controller_config_t;
|
||||
|
||||
/**
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user